Source code for aiida_atomistic.data.structure.constants
"""Constants used throughout the structure module."""
import numpy as np
from aiida.common.constants import elements
[docs]
_MASS_THRESHOLD = 1.0e-3
[docs]
_MAGMOM_THRESHOLD = 1.0e-4
# Threshold to check if the sum is one or not
[docs]
_SUM_THRESHOLD = 1.0e-6
[docs]
_valid_symbols = tuple(i["symbol"] for i in elements.values())
[docs]
_atomic_masses = {el["symbol"]: el["mass"] for el in elements.values()}
[docs]
_atomic_numbers = {data["symbol"]: num for num, data in elements.items()}
# Default cell
[docs]
_DEFAULT_CELL = [[0.0, 0.0, 0.0]] * 3
[docs]
_DEFAULT_PBC = [True, True, True]
[docs]
_DEFAULT_VALUES = {
"kind_name": "",
"mass": 0,
"charge": 0,
"magmom": np.array([0, 0, 0]),
"magnetization": 0,
"hubbard": None,
"weight": (1,)
}
[docs]
_CONVERSION_PLURAL_SINGULAR = {
"positions": "position",
"symbols": "symbol",
"masses": "mass",
"charges": "charge",
"magmoms": "magmom",
"magnetizations": "magnetization",
"hubbards": "hubbard",
"weights": "weight",
"kind_names": "kind_name"
}
[docs]
_GLOBAL_PROPERTIES = [
"pbc",
"cell",
"custom",
"hubbard",
"tot_magmom",
"tot_charge",
]
[docs]
_COMPUTED_PROPERTIES = [
"kinds",
"cell_volume",
"dimensionality",
"formula",
"is_alloy",
"has_vacancies",
]