diff --git a/src/nomad_simulations/schema_packages/basis_set.py b/src/nomad_simulations/schema_packages/basis_set.py index 976319e8..606beb51 100644 --- a/src/nomad_simulations/schema_packages/basis_set.py +++ b/src/nomad_simulations/schema_packages/basis_set.py @@ -1,16 +1,17 @@ import itertools +from collections.abc import Iterable +from typing import Any, Callable, Optional + import numpy as np import pint -from scipy import constants as const -from structlog.stdlib import BoundLogger -from typing import Iterable, Optional, Any, Callable - from nomad import utils from nomad.datamodel.data import ArchiveSection from nomad.datamodel.datamodel import EntryArchive from nomad.datamodel.metainfo.annotations import ELNAnnotation from nomad.metainfo import MEnum, Quantity, SubSection from nomad.units import ureg +from scipy import constants as const +from structlog.stdlib import BoundLogger from nomad_simulations.schema_packages.atoms_state import AtomsState from nomad_simulations.schema_packages.numerical_settings import ( @@ -84,7 +85,7 @@ def normalize(self, archive, logger): class PlaneWaveBasisSet(BasisSet, Mesh): """ - Basis set over a reciprocal mesh, where each point $k_n$ represents a planar-wave basis function $\frac{1}{\sqrt{\omega}} e^{i k_n r}$. + Basis set over a reciprocal mesh, where each point $k_n$ represents a planar-wave basis function $\frac{1}{\\sqrt{\\omega}} e^{i k_n r}$. Typically the grid itself is cartesian with only points within a designated sphere considered. The cutoff radius may be defined by a reciprocal length, or more commonly, the equivalent kinetic energy for a free particle. @@ -303,8 +304,8 @@ def __init__(self, *args, **kwargs): class APWOrbital(APWBaseOrbital): """ - Implementation of `APWWavefunction` capturing the foundational (S)(L)APW basis sets, all of the form $\sum_{lm} \left[ \sum_o c_{lmo} \frac{\partial}{\partial r}u_l(r, \epsilon_l) \right] Y_lm$. - The energy parameter $\epsilon_l$ is always considered fixed during diagonalization, opposed to the original APW formulation. + Implementation of `APWWavefunction` capturing the foundational (S)(L)APW basis sets, all of the form $\\sum_{lm} \\left[ \\sum_o c_{lmo} \frac{\\partial}{\\partial r}u_l(r, \\epsilon_l) \right] Y_lm$. + The energy parameter $\\epsilon_l$ is always considered fixed during diagonalization, opposed to the original APW formulation. This representation then has to match the plane-wave $k_n$ points within the muffin-tin sphere. * D. J. Singh and L. Nordström, \"INTRODUCTION TO THE LAPW METHOD,\" in Planewaves, pseudopotentials, and the LAPW method, 2nd ed. New York, NY: Springer, 2006, pp. 43-52. @@ -312,7 +313,7 @@ class APWOrbital(APWBaseOrbital): type = Quantity( type=MEnum('apw', 'lapw', 'slapw'), # ? where to put 'spherical_dirac' - description=""" + description=r""" Type of augmentation contribution. Abbreviations stand for: | name | description | radial product | |------|-------------|----------------| @@ -364,7 +365,7 @@ class APWLocalOrbital(APWBaseOrbital): type = Quantity( type=MEnum('lo', 'LO', 'custom'), - description=""" + description=r""" Type of augmentation contribution. Abbreviations stand for: | name | description | radial product | |------|-------------|----------------| @@ -471,10 +472,6 @@ def normalize(self, archive: EntryArchive, logger: BoundLogger) -> None: super(BasisSet).normalize(archive, logger) self.n_orbitals = len(self.orbitals) - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self._is_normalized = False - class MuffinTinRegion(BasisSet, Mesh): """ @@ -643,7 +640,7 @@ def generate_apw( l_max=sp['l_max'], l_channels=[ APWLChannel( - name=l, + name=l_channel, orbitals=list( itertools.chain( (APWOrbital(type=orb) for orb in sp['orb_type']), @@ -651,7 +648,7 @@ def generate_apw( ) ), ) - for l in range(sp['l_max'] + 1) + for l_channel in range(sp['l_max'] + 1) ], ) ] diff --git a/tests/conftest.py b/tests/conftest.py index 4c768eb3..9a63dde5 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -23,6 +23,7 @@ import pytest from nomad.datamodel import EntryArchive from nomad.units import ureg + from nomad_simulations.schema_packages.atoms_state import AtomsState, OrbitalsState from nomad_simulations.schema_packages.general import Simulation from nomad_simulations.schema_packages.model_method import ModelMethod diff --git a/tests/test_atoms_state.py b/tests/test_atoms_state.py index 65a1e3d0..dd2aa70c 100644 --- a/tests/test_atoms_state.py +++ b/tests/test_atoms_state.py @@ -22,6 +22,7 @@ import pytest from nomad.datamodel import EntryArchive from nomad.units import ureg + from nomad_simulations.schema_packages.atoms_state import ( AtomsState, CoreHole, diff --git a/tests/test_band_gap.py b/tests/test_band_gap.py index 20688217..c8cc53fa 100644 --- a/tests/test_band_gap.py +++ b/tests/test_band_gap.py @@ -22,6 +22,7 @@ import pytest from nomad.datamodel import EntryArchive from nomad.units import ureg + from nomad_simulations.schema_packages.properties import ElectronicBandGap from nomad_simulations.schema_packages.variables import Temperature diff --git a/tests/test_band_structure.py b/tests/test_band_structure.py index 2e410112..4679fe65 100644 --- a/tests/test_band_structure.py +++ b/tests/test_band_structure.py @@ -21,6 +21,7 @@ import numpy as np import pytest from nomad.datamodel import EntryArchive + from nomad_simulations.schema_packages.properties import ElectronicEigenvalues from . import logger diff --git a/tests/test_basis_set.py b/tests/test_basis_set.py index 09d0f9de..5a2bd73f 100644 --- a/tests/test_basis_set.py +++ b/tests/test_basis_set.py @@ -1,30 +1,29 @@ from itertools import chain from typing import Any, Optional -from nomad_simulations.schema_packages.atoms_state import AtomsState -from nomad_simulations.schema_packages.general import Simulation -from nomad_simulations.schema_packages.model_method import ModelMethod -from nomad_simulations.schema_packages.model_system import AtomicCell, ModelSystem +import numpy as np import pytest - from nomad.datamodel.datamodel import EntryArchive -from . import logger from nomad.units import ureg -import numpy as np - -from tests.conftest import refs_apw +from nomad_simulations.schema_packages.atoms_state import AtomsState from nomad_simulations.schema_packages.basis_set import ( APWBaseOrbital, - APWOrbital, - APWLocalOrbital, APWLChannel, + APWLocalOrbital, + APWOrbital, APWPlaneWaveBasisSet, BasisSet, BasisSetContainer, MuffinTinRegion, generate_apw, ) +from nomad_simulations.schema_packages.general import Simulation +from nomad_simulations.schema_packages.model_method import ModelMethod +from nomad_simulations.schema_packages.model_system import AtomicCell, ModelSystem +from tests.conftest import refs_apw + +from . import logger def test_cutoff(): diff --git a/tests/test_fermi_surface.py b/tests/test_fermi_surface.py index dde4ce1f..05c7206b 100644 --- a/tests/test_fermi_surface.py +++ b/tests/test_fermi_surface.py @@ -19,6 +19,7 @@ from typing import Optional import pytest + from nomad_simulations.schema_packages.properties import FermiSurface diff --git a/tests/test_general.py b/tests/test_general.py index e722e03e..06a360c9 100644 --- a/tests/test_general.py +++ b/tests/test_general.py @@ -19,6 +19,7 @@ import numpy as np import pytest from nomad.datamodel import EntryArchive + from nomad_simulations.schema_packages.general import Simulation from nomad_simulations.schema_packages.model_system import ( AtomicCell, diff --git a/tests/test_hopping_matrix.py b/tests/test_hopping_matrix.py index cfe6ada2..b7cf43d7 100644 --- a/tests/test_hopping_matrix.py +++ b/tests/test_hopping_matrix.py @@ -19,6 +19,7 @@ from typing import Optional import pytest + from nomad_simulations.schema_packages.properties import ( CrystalFieldSplitting, HoppingMatrix, diff --git a/tests/test_model_method.py b/tests/test_model_method.py index b66c5e25..7e51e22d 100644 --- a/tests/test_model_method.py +++ b/tests/test_model_method.py @@ -20,6 +20,7 @@ import pytest from nomad.datamodel import EntryArchive + from nomad_simulations.schema_packages.atoms_state import AtomsState, OrbitalsState from nomad_simulations.schema_packages.general import Simulation from nomad_simulations.schema_packages.model_method import ( diff --git a/tests/test_model_system.py b/tests/test_model_system.py index ecb67a76..6ead47e8 100644 --- a/tests/test_model_system.py +++ b/tests/test_model_system.py @@ -21,6 +21,7 @@ import numpy as np import pytest from nomad.datamodel import EntryArchive + from nomad_simulations.schema_packages.model_system import ( ChemicalFormula, ModelSystem, diff --git a/tests/test_numerical_settings.py b/tests/test_numerical_settings.py index 966d2651..d61be29d 100644 --- a/tests/test_numerical_settings.py +++ b/tests/test_numerical_settings.py @@ -22,6 +22,7 @@ import pytest from nomad.datamodel import EntryArchive from nomad.units import ureg + from nomad_simulations.schema_packages.numerical_settings import ( KLinePath, KMesh, diff --git a/tests/test_outputs.py b/tests/test_outputs.py index 73eef906..8ff3f42b 100644 --- a/tests/test_outputs.py +++ b/tests/test_outputs.py @@ -20,6 +20,7 @@ import pytest from nomad.datamodel import EntryArchive + from nomad_simulations.schema_packages.model_method import ModelMethod from nomad_simulations.schema_packages.model_system import ModelSystem from nomad_simulations.schema_packages.numerical_settings import SelfConsistency diff --git a/tests/test_permittivity.py b/tests/test_permittivity.py index 9cb58fbc..f6955f97 100644 --- a/tests/test_permittivity.py +++ b/tests/test_permittivity.py @@ -20,6 +20,7 @@ import numpy as np import pytest + from nomad_simulations.schema_packages.properties import Permittivity from nomad_simulations.schema_packages.variables import Frequency, KMesh, Variables diff --git a/tests/test_physical_properties.py b/tests/test_physical_properties.py index 12191221..b9e9e1bf 100644 --- a/tests/test_physical_properties.py +++ b/tests/test_physical_properties.py @@ -23,6 +23,7 @@ from nomad.datamodel import EntryArchive from nomad.metainfo import Quantity from nomad.units import ureg + from nomad_simulations.schema_packages.physical_property import ( PhysicalProperty, validate_quantity_wrt_value, diff --git a/tests/test_spectral_profile.py b/tests/test_spectral_profile.py index 003bd029..4184bbb7 100644 --- a/tests/test_spectral_profile.py +++ b/tests/test_spectral_profile.py @@ -22,6 +22,7 @@ import pytest from nomad.datamodel import EntryArchive from nomad.units import ureg + from nomad_simulations.schema_packages.atoms_state import AtomsState from nomad_simulations.schema_packages.general import Simulation from nomad_simulations.schema_packages.model_system import AtomicCell, ModelSystem diff --git a/tests/test_utils.py b/tests/test_utils.py index 8cf7512a..3d3e69cf 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -17,6 +17,7 @@ # import pytest + from nomad_simulations.schema_packages.model_system import ( AtomicCell, ModelSystem, diff --git a/tests/test_variables.py b/tests/test_variables.py index 2fd63a00..c64faf91 100644 --- a/tests/test_variables.py +++ b/tests/test_variables.py @@ -18,6 +18,7 @@ import pytest from nomad.datamodel import EntryArchive + from nomad_simulations.schema_packages.variables import Variables from . import logger