Skip to content

Commit

Permalink
add MEnum for GTOIntegralDecomposition
Browse files Browse the repository at this point in the history
  • Loading branch information
EBB2675 committed Jan 2, 2025
1 parent 816c7ba commit 09b0dfc
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/nomad_simulations/schema_packages/model_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -1242,7 +1242,7 @@ class MolecularOrbital(ArchiveSection):
type=str, description='Symmetry label of the molecular orbital.'
)

reference_orbital = SubSection(
orbital_ref = SubSection(
sub_section=OrbitalsState.m_def,
description='Reference to the underlying atomic orbital state.',
)
Expand Down Expand Up @@ -1275,7 +1275,7 @@ class LCAO(ArchiveSection):
- canonical: Default canonical molecular orbitals.
- natural: Natural orbitals obtained from the density matrix.
- localized: Localized orbitals such as Boys or Foster-Boys localization.
TODO: this will be later connected to many other things.
TODO: this will be later connected to MCSCF.
""",
a_eln=ELNAnnotation(component='EnumEditQuantity'),
)
Expand Down Expand Up @@ -1346,7 +1346,7 @@ def validate_scheme(self, logger: 'BoundLogger') -> bool:
f'For {self.reference_type}, the number of alpha and beta electrons must be equal.'
)
return False
if self.reference_type in ['ROHF', 'ROKS']:
elif self.reference_type in ['ROHF', 'ROKS']:
if abs(self.n_alpha_electrons - self.n_beta_electrons) != 1:
logger.error(
f'For {self.reference_type}, there must be exactly one unpaired electron.'
Expand Down Expand Up @@ -1383,7 +1383,7 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:

class GTOIntegralDecomposition(BaseModelMethod):
"""
A general class for integral decomposition techniques for Coulomb and exchange integrals.
A general class for integral decomposition techniques for Coulomb and exchange integrals to speed up the calculation.
Examples:
Resolution of identity (RI-approximation):
RI
Expand All @@ -1393,23 +1393,22 @@ class GTOIntegralDecomposition(BaseModelMethod):
"""

approximation_type = Quantity(
type=str,
type=MEnum('RIJ', 'RIJK', 'RIK', 'SENEX', 'RIJCOSX'),
description="""
RIJ, RIK, RIJK,
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.
""",
)

approximated_term = Quantity(
type=str,
description="""
such as coulomb, exchange, explicit-correlation
to be converted to an MEnum later.
Such as coulomb, exchange, explicit-correlation, MP2 integrals and so on.
TODO: MEnum.
""",
)

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


class HartreeFock(ModelMethodElectronic):
"""
Expand All @@ -1427,6 +1426,7 @@ class HartreeFock(ModelMethodElectronic):
class PerturbationMethod(ModelMethodElectronic):
type = Quantity(
type=MEnum('MP', 'RS', 'BW'),
default='MP',
description="""
Perturbation approach. The abbreviations stand for:
| Abbreviation | Description |
Expand All @@ -1435,8 +1435,8 @@ class PerturbationMethod(ModelMethodElectronic):
| `'RS'` | Rayleigh-Schrödigner |
| `'BW'` | Brillouin-Wigner |
""",
a_eln=ELNAnnotation(component='EnumEditQuantity'),
) # TODO: check if the special symbols are supported
# a_eln=ELNAnnotation(component='EnumEditQuantity'),
)

order = Quantity(
type=np.int32,
Expand Down Expand Up @@ -1475,5 +1475,5 @@ class LocalCorrelation(ArchiveSection):
# TODO: improve list!
""",
a_eln=ELNAnnotation(component='EnumEditQuantity'),
# a_eln=ELNAnnotation(component='EnumEditQuantity'),
)

1 comment on commit 09b0dfc

@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.py2674085%8–9, 122–133, 172–185, 275–302, 536–540, 562–563, 607–610, 729, 760, 762
   general.py89891%4–7, 121, 185, 295–296, 306
   model_method.py31910069%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.py2806776%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, 982
   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
TOTAL268955479% 

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

Please sign in to comment.