ferrodispcalc.compute package#

Submodules#

ferrodispcalc.compute.backend module#

class ferrodispcalc.compute.backend.ComputeBackend(input, type_map: list[str] = None, prefix: str = None)[source]#

Bases: ABC

abstractmethod get_averaged_structure(select: list[int]) Atoms[source]#
abstractmethod get_displacement(select: list[int], nl: ndarray) ndarray[source]#
abstractmethod get_polarization(select: list[int], nl: ndarray) ndarray[source]#

ferrodispcalc.compute.pybackend module#

class ferrodispcalc.compute.pybackend.PyCompute(input, type_map: list[str] = None, prefix: str = None)[source]#

Bases: ComputeBackend

get_averaged_structure(select: list[int]) Atoms[source]#
get_displacement(select: list[int], nl: ndarray) ndarray[source]#
get_local_lattice(select: list[int], nl: ndarray) ndarray[source]#

Calculates the local lattice vectors for each unit cell.

This method determines the local lattice by classifying neighbor atoms based on their position relative to a central atom and averaging their displacement vectors.

Parameters:
  • select – A list of frame indices to include in the calculation.

  • nl – The neighbor list array (n_unitcells, 9), with the first column being the central atom and the rest being its neighbors. Indices are 1-based.

Returns:

A NumPy array of shape (nframes, n_unitcells, 9) containing the flattened local lattice vectors (ax,ay,az,bx,by,bz,cx,cy,cz).

get_polarization(select: ~numpy.ndarray, nl_ba: ~numpy.ndarray, nl_bx: ~numpy.ndarray, born_effective_charge: dict[slice(<class 'str'>, list[float], None)]) ndarray[source]#

Module contents#