graph2mat.core.data.basis
Utilities to describe a basis set for a point type.
Functions
|
For a given atom, returns the representation of its basis. |
|
Change of basis matrix for the given convention. |
Classes
|
Placeholder for atoms without orbitals. |
|
Stores the basis set for a point type. |
- class graph2mat.core.data.basis.NoBasisAtom(*args, **kwargs)[source]
Bases:
Atom
Placeholder for atoms without orbitals.
This should no longer be needed once sisl allows atoms with 0 orbitals.
Atoms with no basis are for example needed for the fitting of QM/MM simulations.
- property no
The number of orbitals belonging to this atom.
- property q0
The initial charge of the orbitals of this atom.
- class graph2mat.core.data.basis.PointBasis(type: str | int, R: float | ndarray, basis: str | Sequence[int | Tuple[int, int, int]] = (), basis_convention: str | Literal['cartesian', 'spherical', 'siesta_spherical', 'qe_spherical'] = 'spherical')[source]
Bases:
object
Stores the basis set for a point type.
- Parameters:
type (str | int) – The type ID, e.g. some meaningful name or a number.
R (Union[float, np.ndarray]) –
The reach of the basis. If a float, the same reach is used for all functions.
If an array, the reach is different for each SET of functions. E.g. for a basis with 3 l=0 functions and 2 sets of l=1 functions, you must provide an array of length 5.
The reach of the functions will determine if the point interacts with other points.
basis (str | Sequence[int | Tuple[int, int, int]]) –
Specification of the basis set that the point type has. It can be a list of specifications, then each item in the list can be the number of sets of functions for a given l (determined by the position of the item in the list), or a tuple specifying (n_sets, l, parity).
It can also be a string representing the irreps of the basis in the
e3nn
format. E.g. “3x0e+2x1o” would mean 3 l=0 and 2 l=1 sets.basis_convention (str | Literal['cartesian', 'spherical', 'siesta_spherical', 'qe_spherical']) – The convention used for the basis. It can be any combination of
"xyz"
with optional minus signs, e.g."xyz"
,"-yz-x"
,"z-x-y"
. You can also use the aliases that we provide, such as"cartesian"
or"spherical"
.
Examples
from graph2mat import PointBasis # Let's create a basis with 3 l=0 functions and 2 sets of l=1 functions. # The convention for spherical harmonics will be the standard one. # We call this type of basis set "A", and functions have a reach of 5. basis = PointBasis("A", R=5, basis=[3, 2], basis_convention="spherical") # Same but with a different reach for l=0 (R=5) and l=1 functions (R=3). basis = PointBasis("A", R=np.array([5, 5, 5, 3, 3, 3, 3, 3, 3]), irreps=[3, 2], basis_convention="spherical" ) # Equivalent specification of the basis using tuples: basis = PointBasis("A", R=5, basis=[(3, 0, 1), (2, 1, -1)], basis_convention="spherical")
- __init__(type: str | int, R: float | ndarray, basis: str | Sequence[int | Tuple[int, int, int]] = (), basis_convention: str | Literal['cartesian', 'spherical', 'siesta_spherical', 'qe_spherical'] = 'spherical') None
- basis_convention: str | Literal['cartesian', 'spherical', 'siesta_spherical', 'qe_spherical'] = 'spherical'
- property e3nn_irreps
Returns the irreps in the e3nn format.
- classmethod from_sisl_atom(atom: Atom, basis_convention: str | Literal['cartesian', 'spherical', 'siesta_spherical', 'qe_spherical'] = 'siesta_spherical')[source]
Creates a point basis from a sisl atom.
- Parameters:
atom – The atom from which to create the basis.
basis_convention – The spherical harmonics convention used for the basis.
- property num_sets: int
Returns the number of sets of functions.
E.g. for a basis with 3 l=0 functions and 2 sets of l=1 functions, this returns 5.
- graph2mat.core.data.basis.get_atom_basis(atom: Atom)[source]
For a given atom, returns the representation of its basis.
- graph2mat.core.data.basis.get_change_of_basis(original: str | Literal['cartesian', 'spherical', 'siesta_spherical', 'qe_spherical'], target: str | Literal['cartesian', 'spherical', 'siesta_spherical', 'qe_spherical']) Tuple[ndarray, ndarray] [source]
Change of basis matrix for the given convention.
- Parameters:
convention – The convention for spherical harmonics.
- Returns:
change_of_basis_matrix
inverse_change_of_basis