Skip to content

Commit

Permalink
add type and auxiliary_type quantities to AtomCenteredBasisSet
Browse files Browse the repository at this point in the history
  • Loading branch information
EBB2675 committed Oct 8, 2024
1 parent 8866ab7 commit c7b078a
Showing 1 changed file with 21 additions and 71 deletions.
92 changes: 21 additions & 71 deletions src/nomad_simulations/schema_packages/basis_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from nomad import utils
from nomad.datamodel.data import ArchiveSection
from nomad.datamodel.metainfo.annotations import ELNAnnotation
from nomad.metainfo import MEnum, Quantity, SubSection, JSON
from nomad.metainfo import JSON, MEnum, Quantity, SubSection
from nomad.units import ureg

from nomad_simulations.schema_packages.atoms_state import AtomsState
Expand Down Expand Up @@ -187,13 +187,16 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:

class AtomCenteredFunction(ArchiveSection):
"""
Specifies a single function (term) in an atom-centered basis set.
Specifies a single function (term) in a Gaussian-type basis set.
Cartesian Gaussian-type orbitals (GTOs)
"""

function_type = Quantity(
type=MEnum('s', 'p', 'd', 'f', 'g', 'h', 'i', 'j'),
description="""
the angular momentum of the shell to be added.
the l value:
l = i + j + k
the angular momentum of GTO to be added.
""",
)

Expand Down Expand Up @@ -224,98 +227,45 @@ def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)
# self.name = self.m_def.name

class AtomCenteredBasisSet(BasisSetComponent):
"""
Defines an atom-centered basis set, using a single JSON quantity for all basis set types,
while allowing different AtomState references for each basis set type.
"""

basis_set_data = Quantity(
type=JSON, # Use JSON to store basis set information, including atom references
description="""
JSON object containing all the basis set information along with atom references. Example:
{
"main_basis_set": {
"name": "cc-pVTZ",
"atoms_ref": [ref_to_atoms_1, ref_to_atoms_2]
},
"aux_c_basis_set": {
"name": "cc-pVTZ/C",
"atoms_ref": [ref_to_atoms_3]
},
"aux_j_basis_set": {
"name": "RIJ",
"atoms_ref": [ref_to_atoms_4]
},
"aux_jk_basis_set": {
"name": "aug-cc-pVTZ/JK",
"atoms_ref": [ref_to_atoms_1, ref_to_atoms_5]
}
}
""",
)

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

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



'''
class AtomCenteredBasisSet(BasisSetComponent):
"""
Defines an atom-centered basis set.
"""

main_basis_set = Quantity(
basis_set = Quantity(
type=str,
description="""
Name of the main basis set.
name of the basis set
""",
)

aux_c_basis_set = Quantity(
type=str,
type = Quantity(
type=MEnum('STO', 'GTO'),
description="""
AuxC type of basis set.
Type of the basis set, e.g. STO or GTO.
""",
)

aux_j_basis_set = Quantity(
type=str,
description="""
AuxJ type of basis set.
""",
)
# TODO: connect RI approximation

aux_jk_basis_set = Quantity(
type=str,
auxiliary_type = Quantity(
type=MEnum('AuxC', 'AuxJ', 'AuxJK'),
description="""
AuxJK type of basis set.
""",
)
atoms_ref = Quantity(
type=AtomsState,
shape=['*'],
description="""
References to the `AtomsState` sections that define the atoms this basis set applies to.
the type of RI approximation.
AuxJ and AuxJK: Fock matrix construction.
AuxC: all other integral generation steps, e.g. post-HF methods.
Since a JK-type basis set can be assined to AuxJ, this quantity is needed.
""",
)

functional_composition = SubSection(
sub_section=AtomCenteredFunction.m_def, repeats=True
) # TODO change name
)

def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)
# self.name = self.m_def.name
# TODO: set name based on basis functions
# ? use basis set names from Basis Set Exchange
'''
#self.name = self.m_def.name


class APWBaseOrbital(ArchiveSection):
"""
Expand Down

1 comment on commit c7b078a

@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.py2482988%8–9, 122–133, 172–185, 227, 266, 447–451, 473–474, 518–521, 640, 671, 673
   general.py89891%4–7, 121, 185, 295–296, 306
   model_method.py2697871%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
   model_system.py3172592%25–27, 378, 410–411, 621–624, 671–678, 852–853, 1074–1078, 1084–1085, 1093–1094, 1099, 1122
   numerical_settings.py2596176%12–14, 217, 219–220, 223–226, 230–231, 238–241, 250–253, 257–260, 262–265, 270–273, 279–282, 469–496, 571, 606–609, 633, 636, 681, 683–686, 690, 694, 741, 745–766, 821–822, 889
   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.py701480%8–11, 65–74, 83–84, 89, 92
TOTAL255750180% 

Tests Skipped Failures Errors Time
409 0 💤 0 ❌ 0 🔥 5.855s ⏱️

Please sign in to comment.