diff --git a/src/nomad_simulations/schema_packages/atoms_state.py b/src/nomad_simulations/schema_packages/atoms_state.py index b2b97b06..790df1e7 100644 --- a/src/nomad_simulations/schema_packages/atoms_state.py +++ b/src/nomad_simulations/schema_packages/atoms_state.py @@ -660,20 +660,6 @@ class MolecularOrbitals(Entity): """ - mo_type = Quantity( - type=str, - shape=['mo_num'], - description=""" - Type of the molecular orbitals - e.g. 'canonical', 'localized'. - In case of CASSCF calculations, there will be orbital subspaces of different nature. - E.g. : - Internal orbitals : canonical - Active orbitals : natural - Virtual orbitals : canonical - """, - ) - mo_num = Quantity( type=np.int32, description=""" @@ -689,6 +675,20 @@ class MolecularOrbitals(Entity): """, ) + mo_type = Quantity( + type=str, + shape=['mo_num'], + description=""" + Type of the molecular orbitals + e.g. 'canonical', 'localized'. + In case of CASSCF calculations, there will be orbital subspaces of different nature. + E.g. : + Internal orbitals : canonical + Active orbitals : natural + Virtual orbitals : canonical + """, + ) + coefficient = Quantity( type=np.float64, shape=['mo_num', 'ao_num'], @@ -743,5 +743,3 @@ class MolecularOrbitals(Entity): Typically 0 for alpha, 1 for beta. """, ) - - diff --git a/src/nomad_simulations/schema_packages/basis_set.py b/src/nomad_simulations/schema_packages/basis_set.py index b66d2f50..536a39dd 100644 --- a/src/nomad_simulations/schema_packages/basis_set.py +++ b/src/nomad_simulations/schema_packages/basis_set.py @@ -187,18 +187,18 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: class AtomCenteredFunction(ArchiveSection): """ - Specifies a single contracted basis function in an atom-centered basis set. - - In many quantum-chemistry codes, an atom-centered basis set is composed of - several "shells," each shell containing one or more basis functions of a certain - angular momentum. For instance, a shell of p-type orbitals (L=1) typically + Specifies a single contracted basis function in an atom-centered basis set. + + In many quantum-chemistry codes, an atom-centered basis set is composed of + several "shells," each shell containing one or more basis functions of a certain + angular momentum. For instance, a shell of p-type orbitals (L=1) typically consists of 3 degenerate functions (p_x, p_y, p_z) if `harmonic_type='cartesian'` or 3 spherical harmonics if `harmonic_type='spherical'`. - - A single "atom-centered function" can be a linear combination of multiple - primitive Gaussians (or Slater-type orbitals, STOs). - In practice, these contract together to form the final basis function used by - the SCF or post-SCF method. Often, each contraction is labeled by its + + A single "atom-centered function" can be a linear combination of multiple + primitive Gaussians (or Slater-type orbitals, STOs). + In practice, these contract together to form the final basis function used by + the SCF or post-SCF method. Often, each contraction is labeled by its angular momentum (e.g., s, p, d, f) and a set of exponents and coefficients. **References**: @@ -353,16 +353,16 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: class AtomCenteredBasisSet(BasisSetComponent): """ Defines an **atom-centered basis set** for quantum chemistry calculations. - Unlike plane-wave methods, these expansions are typically built around each atom's + Unlike plane-wave methods, these expansions are typically built around each atom's position, using either: - Slater-type orbitals (STO) - Gaussian-type orbitals (GTO) - Numerical atomic orbitals (NAO) - Effective-core potentials or point-charges (PC, cECP, etc.) - + This section references multiple `AtomCenteredFunction` objects, each describing - a single contracted function or shell. Additionally, one can label the overall - basis set name (e.g., "cc-pVTZ", "def2-SVP", "6-31G**") and specify the high-level + a single contracted function or shell. Additionally, one can label the overall + basis set name (e.g., "cc-pVTZ", "def2-SVP", "6-31G**") and specify the high-level role of the basis set in the calculation. **Common examples**: @@ -411,7 +411,7 @@ class AtomCenteredBasisSet(BasisSetComponent): 'orbital', 'auxiliary_scf', 'auxiliary_post_hf', - 'cabs', + 'cabs', ), description=""" The role of this basis set in the calculation: diff --git a/src/nomad_simulations/schema_packages/model_method.py b/src/nomad_simulations/schema_packages/model_method.py index d3055ffc..c0e20aa1 100644 --- a/src/nomad_simulations/schema_packages/model_method.py +++ b/src/nomad_simulations/schema_packages/model_method.py @@ -1272,17 +1272,17 @@ class IntegralDecomposition(BaseModelMethod): class HartreeFock(ModelMethodElectronic): """ - Defines a Hartree–Fock (HF) calculation using a specified reference determinant + Defines a Hartree–Fock (HF) calculation using a specified reference determinant (RHF, UHF, or ROHF). In HF theory: - RHF = Restricted Hartree–Fock, for closed-shell systems. - UHF = Unrestricted Hartree–Fock, allows different orbitals for alpha/beta spin. - - ROHF = Restricted Open-Shell Hartree–Fock, a partially restricted approach for + - ROHF = Restricted Open-Shell Hartree–Fock, a partially restricted approach for open-shell systems. **References**: - - Roothaan, C. C. J. (1951). "New Developments in Molecular Orbital Theory." + - Roothaan, C. C. J. (1951). "New Developments in Molecular Orbital Theory." Rev. Mod. Phys. 23, 69. - Szabo, A., & Ostlund, N. S. (1989). *Modern Quantum Chemistry*. McGraw-Hill. - Jensen, F. (2007). *Introduction to Computational Chemistry*. 2nd ed., Wiley. @@ -1306,7 +1306,7 @@ class HartreeFock(ModelMethodElectronic): def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: """ Perform minimal consistency checks between the HF reference determinant - and the final molecular orbitals spin array (if available). + and the final molecular orbitals spin array (if available).NumericalIntegration """ super().normalize(archive, logger) @@ -1319,15 +1319,15 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: # For RHF, we typically expect spin=0 (alpha) only if not np.all(mo_spin == 0): logger.warning( - "RHF reference used, but molecular_orbitals.spin contains non-zero spin indices." + 'RHF reference used, but molecular_orbitals.spin contains non-zero spin indices.' ) elif self.reference_determinant == 'UHF': # UHF often has spin=0 for alpha and spin=1 for beta # If we only see spin=0, that's effectively no spin polarization if len(unique_spins) == 1 and unique_spins[0] == 0: logger.info( - "UHF reference chosen, but only alpha spin found in MOs (spin=0). " - "This might still be valid if spin polarization is zero." + 'UHF reference chosen, but only alpha spin found in MOs (spin=0). ' + 'This might still be valid if spin polarization is zero.' ) # For ROHF, spin indexing can vary across codes, so no strict check here. @@ -1376,7 +1376,6 @@ class PerturbationMethod(ModelMethodElectronic): ) - class LocalCorrelation(ArchiveSection): """ A base section used to define the parameters of a local correlation method for diff --git a/src/nomad_simulations/schema_packages/numerical_settings.py b/src/nomad_simulations/schema_packages/numerical_settings.py index eca33e56..b43a2177 100644 --- a/src/nomad_simulations/schema_packages/numerical_settings.py +++ b/src/nomad_simulations/schema_packages/numerical_settings.py @@ -955,7 +955,7 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: class OrbitalLocalization(SelfConsistency): """ Numerical settings that control orbital localization, typically applied - to transform canonical molecular orbitals into localized orbitals. + to transform canonical molecular orbitals into localized orbitals. These localized orbitals can then be used for: - Local correlation methods (e.g., LMP2, local CC) - Interpretable chemical analysis (e.g., identifying bonds, lone pairs) @@ -965,10 +965,10 @@ class OrbitalLocalization(SelfConsistency): iterative, requiring thresholds and iteration limits akin to an SCF loop. References: - - R. F. Boys, "Construction of Some Molecular Orbitals to Be Approximately Invariant + - R. F. Boys, "Construction of Some Molecular Orbitals to Be Approximately Invariant for Changes in Molecular Conformation," Rev. Mod. Phys. 32, 296 (1960). [Boys] - J. Pipek, P. G. Mezey, J. Chem. Phys. 90, 4916 (1989). [PM method] - - J. L. Knizia, "Intrinsic Atomic Orbitals: An Unbiased Bridge between Quantum Theory + - J. L. Knizia, "Intrinsic Atomic Orbitals: An Unbiased Bridge between Quantum Theory and Chemical Concepts," J. Chem. Theory Comput. 9, 4834 (2013). [IBO method] - P. Pulay, Chem. Phys. Lett. 100, 151 (1983). [Local correlation context] """ @@ -1010,113 +1010,50 @@ class OrbitalLocalization(SelfConsistency): ) -class PNOSettings(NumericalSettings): +class PairApproximationSettings(NumericalSettings): """ - Numerical settings that control **Pair Natural Orbitals (PNOs)** in local correlation approaches. + Numerical settings that control Pair Natural Orbitals (PNOs) in local correlation approaches. PNOs are a compact representation of the virtual orbital space for each pair (or domain) of occupied orbitals, improving efficiency in post-HF methods (e.g., local MP2, local CC). + The nomenclature for these thresholds is adapted from different programs (e.g., Molpro, ORCA). + This class is code-agnostic and allows a single 'approximation_level' to store + code-specific presets such as: + 'tightPNO', 'normalPNO', 'loosePNO' (ORCA) or + 'default', 'tight', 'vtight' (Molpro), etc. + + For more fine-grained custom thresholds, the user can fill the other + domain/pair fields (occupancies, energy thresholds, etc.) on the parser side as needed. + The nomenclature for these thresholds is adapted from Molpro, ORCA, etc. See also: - H.-J. Werner, P. J. Knowles, G. Knizia, F. R. Manby, M. Schütz, - "Molpro: a general-purpose quantum chemistry program package," + "Molpro: a general-purpose quantum chemistry program package," WIREs Comput. Mol. Sci. 2, 242 (2012). - - F. Neese, "The ORCA program system," + - F. Neese, "The ORCA program system," WIREs Comput. Mol. Sci. 2, 73-78 (2012) for DLPNO expansions. - - G. Knizia, "Intrinsic Bond Orbitals," + - G. Knizia, "Intrinsic Bond Orbitals," J. Chem. Theory Comput. 9, 4834 (2013) for orbital transformations in local correlation. """ - domain_connectivity = Quantity( - type=int, - description=""" - the connectivity parameter for domain extension. - """, - ) - - domain_radius = Quantity( - type=int, - description=""" - the radius parameter for domain extension. - """, - ) - - t_domain_osv_occ = Quantity( - type=np.float32, - description=""" - OSV domain occupation number threshold. - """, - ) - - t_occ_lmp2 = Quantity( - type=np.float32, - description=""" - LMP2 PNO domains (occ. number threshold). - """, - ) - - t_energy_lmp2 = Quantity( - type=np.float32, - description=""" - LMP2 PNO domains (energy threshold). - """, - ) - - t_occ_lccsd = Quantity( - type=np.float32, - description=""" - LCCSD PNO domains (occ. number threshold). - """, - ) - - t_energy_lccsd = Quantity( - type=np.float32, - description=""" - LCCSD PNO domains (energy threshold). - """, - ) + # type = Quantity( + # type=MEnum('PAO', 'OSV', 'PNO'), + # description=""" + # PAO : pair atomic orbitals + # OSV : orbital-specific virtuals + # PNO : pair natural orbitals + # """, + # ) - t_close_pair = Quantity( + code_specific_approximation_tier = Quantity( type=str, description=""" - close pair energy threshold. - """, - ) - - t_weak_pair = Quantity( - type=np.float32, - description=""" - weak pair energy threshold. - """, - ) - - t_distant_pair = Quantity( - type=np.float32, - description=""" - distant pair energy threshold - """, - ) - - t_verydistant_pair = Quantity( - type=np.float32, - description=""" - very distant pair energy threshold + A single keyword or label indicating a preset PNO approximation level. Examples: + - In ORCA: 'loosePNO', 'normalPNO', 'tightPNO' + - In Molpro: 'default', 'tight', 'vtight' + - In Psi4: 'loose', 'normal', 'tight' for PNO_CONVERGENCE keyword + - Or any other custom label recognized by your code + + This field is purely descriptive to unify different codes' preset naming. """, ) - - t_triples_preselection = Quantity( - type=np.float32, - description=""" - preselection of triples list. - """, - ) - - t_triples_iteration = Quantity( - type=np.float32, - description=""" - selection of triples for iterations - """, - ) - - def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None: - super().normalize(archive, logger)