graph2mat.core.data.basis

Utilities to describe a basis set for a point type.

Functions

get_atom_basis(atom)

For a given atom, returns the representation of its basis.

get_change_of_basis(original, target)

Change of basis matrix for the given convention.

Classes

NoBasisAtom(*args, **kwargs)

Placeholder for atoms without orbitals.

PointBasis(type, R[, basis, basis_convention])

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: Literal['cartesian', 'spherical', 'siesta_spherical'] = 'spherical')[source]

Bases: object

Stores the basis set for a point type.

Parameters:
  • type (Union[str, int]) – The type ID, e.g. some meaningful name or a number.

  • basis_convention (BasisConvention) – The spherical harmonics convention used for the basis.

  • 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.

  • 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.

Examples

R: float | ndarray
__init__(type: str | int, R: float | ndarray, basis: str | Sequence[int | Tuple[int, int, int]] = (), basis_convention: Literal['cartesian', 'spherical', 'siesta_spherical'] = 'spherical') None
basis: str | Sequence[int | Tuple[int, int, int]] = ()
basis_convention: Literal['cartesian', 'spherical', 'siesta_spherical'] = 'spherical'
property basis_size: int

Returns the number of basis functions per point.

copy(**kwargs)[source]
property e3nn_irreps

Returns the irreps in the e3nn format.

classmethod from_sisl_atom(atom: Atom, basis_convention: Literal['cartesian', 'spherical', 'siesta_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.

maxR() float[source]

Returns the maximum reach of 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.

to_sisl_atom(Z: int = 1) Atom[source]

Converts the basis to a sisl atom.

Parameters:

Z – The atomic number of the atom.

type: str | int
graph2mat.core.data.basis.get_atom_basis(atom: Atom)[source]

For a given atom, returns the representation of its basis.

Parameters:

atom (sisl.Atom) – The atom for which we want the irreps of its basis.

Returns:

the basis representation.

Return type:

Tuple[int, int, int]

graph2mat.core.data.basis.get_change_of_basis(original: Literal['cartesian', 'spherical', 'siesta_spherical'], target: Literal['cartesian', 'spherical', 'siesta_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