elastic_constants.crystal module#

Crystallography module.

class elastic_constants.crystal.Crystal[source]#

Bases: object

Crystal class.

Periodic arrangement of atoms.

symmetry_dataset#

Dataclass containing symmetry related information.

Type:

spglib.spg.SpglibDataset

Examples

Create a body-centered caesium chloride crystal using:

>>> lattice = [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
>>> positions = [[0, 0, 0], [0.5, 0.5, 0.5]]
>>> numbers = [55, 17]
>>> crystal = Crystal(lattice, positions, numbers)
>>> crystal.symmetry_dataset.number
221
__init__(lattice, positions, numbers, *, symmetry_precision=1e-05, angle_tolerance=-1.0)[source]#

Initialize an instance of the crystal class.

Parameters:
  • lattice (numpy.typing.ArrayLike) – Matrix containing the three crystal lattice vectors as its rows.

  • positions (numpy.typing.ArrayLike) – List of atomic positions given as fractional coordinates.

  • numbers (numpy.typing.ArrayLike) – List of (arbitrary) numbers to distinguish the different atomic species.

  • symmetry_precision (float) – Distance tolerance in cartesian coordinates during symmetry search. See symprec.

  • angle_tolerance (float) – Tolerance of angle between basis vectors in degrees during symmetry search. See angle_tolerance.

Raises:

ValueError – If the symmetry search failed.