SiteIndexConverter#

class libcasm.xtal.SiteIndexConverter(
self: SiteIndexConverter,
transformation_matrix_to_super: numpy.ndarray[numpy.int64[3, 3]],
n_sublattice: int,
)#

Bases: pybind11_object

Convert between integral site indices \((b,i,j,k)\) and linear site index \(l\).

Constructor

Parameters:
  • transformation_matrix_to_super (array_like, shape=(3,3), dtype=int) – The transformation matrix, T, relating the superstructure lattice vectors, S, to the unit structure lattice vectors, L, according to S = L @ T, where S and L are shape=(3,3) matrices with lattice vectors as columns.

  • n_sublattice (int) – The number of sublattices in the Prim.

Methods

always_bring_within

Automatically bring IntegralSiteCoordinate values within the supercell when querying for the index (on by default).

bring_within

Bring the given IntegralSiteCoordinate into the superlattice using superlattice translations.

integral_site_coordinate

Given the linear index of a site, retrieve the corresponding IntegralSiteCoordinate.

linear_site_index

Given the IntegralSiteCoordinate of a site, retrieve its corresponding linear index.

never_bring_within

Prevent the index converter from bringing IntegralSiteCoordinate within the supercell when querying for the index.

total_sites

Returns the total number of sites within the superlattice.