Skip to content

Commit

Permalink
enhance LocalCorrelation and CoupledCluster
Browse files Browse the repository at this point in the history
  • Loading branch information
EBB2675 committed Jan 14, 2025
1 parent d90eac1 commit 95e319c
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 39 deletions.
6 changes: 1 addition & 5 deletions src/nomad_simulations/schema_packages/basis_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -344,17 +344,13 @@ class AtomCenteredBasisSet(BasisSetComponent):

total_number_of_basis_functions = Quantity(
type=np.int32,
description=""""the total number of basis functions""",
description=""""The total number of basis functions.""",
)

functional_composition = SubSection(
sub_section=AtomCenteredFunction.m_def, repeats=True
)

def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)
# self.name = self.m_def.name


class APWBaseOrbital(ArchiveSection):
"""
Expand Down
74 changes: 40 additions & 34 deletions src/nomad_simulations/schema_packages/model_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -1223,7 +1223,7 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)


class MolecularOrbital(ArchiveSection):
class BaseMolecularOrbital(ArchiveSection):
"""
A section representing a single molecular orbital.
"""
Expand All @@ -1248,9 +1248,9 @@ class MolecularOrbital(ArchiveSection):
)


class LCAO(ArchiveSection):
class MolecularOrbitals(ArchiveSection):
"""
A base class for molecular orbital schemes used in quantum chemistry calculations.
A section for molecular orbital schemes used in quantum chemistry calculations.
Supports unrestricted (UHF, UKS), restricted (RHF, RKS), and restricted open-shell (ROHF, ROKS) schemes.
"""

Expand Down Expand Up @@ -1302,7 +1302,7 @@ class LCAO(ArchiveSection):
)

molecular_orbitals = SubSection(
sub_section=MolecularOrbital.m_def,
sub_section=BaseMolecularOrbital.m_def,
repeats=True,
description="""
Detailed information about each molecular orbital,
Expand Down Expand Up @@ -1398,6 +1398,7 @@ class GTOIntegralDecomposition(BaseModelMethod):
RIJ : also known as RIJONX, where only Coulomb integrals are approximated.
RIJK : both Coulomb and exchange integrals.
RIJCOSX : RIJ for Coulomb and COSX for HF exchange.
SENEX : Similar to COSX, relevant for Turbomole.
""",
)

Expand Down Expand Up @@ -1448,8 +1449,8 @@ class PerturbationMethod(ModelMethodElectronic):
density = Quantity(
type=MEnum('relaxed', 'unrelaxed'),
description="""
unrelaxed density: MP2 expectation value density
relaxed density : incorporates orbital relaxation
unrelaxed density: MP2 expectation value density.
relaxed density : incorporates orbital relaxation.
""",
)

Expand All @@ -1461,18 +1462,17 @@ class LocalCorrelation(ArchiveSection):
It has a corresponding localization method.
"""

method = Quantity(
type=MEnum('LMP2', 'LCCD', 'LCCSD', 'LCCSD(T)', 'DLPNO-CCSD(T)', 'LocalDFT'),
type = Quantity(
type=MEnum('PNO', 'domain'),
description="""
The local correlation method applied. For example:
- LMP2: Local Møller-Plesset perturbation theory
- LCCD: Local Coupled-Cluster with Doubles
- LCCSD: Local Coupled-Cluster with Singles and Doubles
- LCCSD(T): Local Coupled-Cluster with Singles, Doubles, and Perturbative Triples
- DLPNO-CCSD(T): Domain-Based Local Pair Natural Orbital CCSD(T)
- LocalDFT: Local Density Functional Theory.
the type of local correlation.
""",
)

# TODO: improve list!
ansatz = Quantity(
type=MEnum('LMP2', 'LCC', 'LocalDFT'),
description="""
The underlying ansatz for the local correlation treatment.
""",
)

Expand All @@ -1493,40 +1493,49 @@ class CoupledCluster(ModelMethodElectronic):
a_eln=ELNAnnotation(component='StringEditQuantity'),
)

reference_determinant = Quantity(
type=MEnum('UHF', 'RHF', 'ROHF', 'UKS', 'RKS', 'ROKS'),
description="""
The type of reference determinant.
""",
)

excitation_order = Quantity(
type=np.int32,
shape=['*'],
description="""
Orders at which the excitation are used.
1 = single, 2 = double, 3 = triple, 4 = quadruple, etc.
"""
""",
)

reference_determinant = Quantity(
type=MEnum('UHF','RHF','ROHF',
'UKS', 'RKS', 'ROKS'),
perturbative_correction_order = Quantity(
type=np.int32,
shape=['*'],
description="""
The type of reference determinant.
Orders at which the excitation are used.
1 = single, 2 = double, 3 = triple, 4 = quadruple, etc.
""",
)

perturbation_method = SubSection(sub_section=PerturbationMethod.m_def)

local_correlation = SubSection(sub_section=LocalCorrelation.m_def)

perturbative_correction = Quantity(
type=MEnum('(T)', '[T]',
'(T0)', '[T0]',
'(Q)'),
type=MEnum('(T)', '[T]', '(T0)', '[T0]', '(Q)'),
description="""
The type of perturbative corrections.
A perturbative correction is different than a perturbation method.
"""
""",
)

perturbation_method = SubSection(sub_section=PerturbationMethod.m_def)

local_correlation = SubSection(sub_section=LocalCorrelation.m_def, repeats=True)

gto_integral_decomposition = SubSection(
sub_section=GTOIntegralDecomposition.m_def, repeats=True
)

explicit_correlation = Quantity(
type=MEnum('F12', 'F12a', 'F12b', 'F12c',
'R12', ''),
type=MEnum('F12', 'F12a', 'F12b', 'F12c', 'R12', ''),
default='',
description="""
Explicit correlation treatment.
Expand All @@ -1545,6 +1554,3 @@ class CoupledCluster(ModelMethodElectronic):
FC approximations differ between quantum chemistry codes.
""",
)



98 changes: 98 additions & 0 deletions src/nomad_simulations/schema_packages/numerical_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,6 +966,7 @@ class OrbitalLocalization(SelfConsistency):

orbital_window = Quantity(
shape=['*'],
type=str,
description="""
the Molecular orbital range to be localized.
""",
Expand All @@ -978,5 +979,102 @@ class OrbitalLocalization(SelfConsistency):
""",
)


class PNOSettings(NumericalSettings):
"""Numerical settings that control pair natural orbitals (PNOs).
The nomenclature has been adapted from Molpro.
"""

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).
""",
)

t_close_pair = 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
""",
)

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)

1 comment on commit 95e319c

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/nomad_simulations
   __init__.py4250%3–4
   _version.py11282%5–6
src/nomad_simulations/schema_packages
   __init__.py15287%39–41
   atoms_state.py1902189%13–15, 201–204, 228, 283–284, 352–353, 355, 537, 549–550, 611–615, 630–634, 641
   basis_set.py2654085%8–9, 122–133, 172–185, 275–302, 532–536, 558–559, 603–606, 725, 756, 758
   general.py89891%4–7, 121, 185, 295–296, 306
   model_method.py33110070%10–12, 171–174, 177–184, 276–277, 297, 318–339, 355–381, 384–401, 587, 780, 791, 833–840, 878, 897, 977, 1034, 1109, 1223, 1332–1334, 1343–1355, 1358–1379
   model_system.py3503789%45–51, 235, 254, 258, 261, 264, 290, 376–377, 454–455, 472–473, 686–689, 736–743, 917–918, 1155–1159, 1165–1166, 1174–1175, 1180, 1203
   numerical_settings.py2946777%12–14, 204–210, 280, 282–283, 286–289, 293–294, 301–304, 313–316, 320–323, 325–328, 333–336, 342–345, 532–559, 634, 669–672, 696, 699, 744, 746–749, 753, 757, 804, 808–829, 884–885, 952, 1080
   outputs.py1201092%9–10, 252–255, 295–298, 323, 325, 362, 381
   physical_property.py102793%20–22, 202, 331–333
   variables.py861286%8–10, 98, 121, 145, 167, 189, 211, 233, 256, 276
src/nomad_simulations/schema_packages/properties
   band_gap.py51590%8–10, 135–136
   band_structure.py1232580%9–11, 232–265, 278, 285, 321–322, 325, 372–373, 378
   energies.py42979%7–9, 36, 57, 82, 103, 119, 134
   fermi_surface.py17476%7–9, 40
   forces.py22673%7–9, 36, 56, 79
   greens_function.py991387%7–9, 210–211, 214, 235–236, 239, 260–261, 264, 400
   hopping_matrix.py29583%7–9, 58, 94
   permittivity.py48883%7–9, 97–105
   spectral_profile.py26012851%9–11, 57–60, 95–98, 199–300, 356–368, 393–396, 416, 421–424, 466–502, 526, 573–576, 592–593, 598–604
   thermodynamics.py752764%7–9, 35, 56, 72, 81, 90, 101, 110, 137, 147, 157, 172–174, 177, 193, 213–215, 218, 234, 254–256, 259
src/nomad_simulations/schema_packages/utils
   utils.py791680%8–11, 65–74, 83–84, 89, 92, 169–170
TOTAL271355480% 

Tests Skipped Failures Errors Time
423 0 💤 0 ❌ 0 🔥 7.272s ⏱️

Please sign in to comment.