wulfric.Crystal#

class wulfric.Crystal(lattice: Lattice = None, atoms=None, relative=True, **kwargs)[source]#

Crystal class.

It is a child of Lattice class.

Iterable over atoms. All attributes of the Lattice are accessible directly from the crystal:

>>> import wulfric as wulf
>>> cub = wulf.lattice_example("CUB")
>>> crystal = wulf.Crystal(cub)
>>> crystal.pearson_symbol
'cP'

For the full description of the lattice attributes and methods see Lattice.

Parameters:
latticeLattice, optional

Lattice of the crystal. If not provided, then orthonormal lattice is used ("CUB with \(a = 1\)).

atomslist, optional

List of Atom objects.

relativebool, default True

Whether atoms positions are in relative coordinates.

**kwargs

Keyword arguments for Lattice initialization.

Attributes:
atomslist

List of atoms of the crystal.

Methods:

add_atom([new_atom, relative])

Add atom to the crystal.

copy()

Copy of the crystal.

cure_negative()

Shifts all atoms with the same vector in a way that all relative coordinates becomes non-negative.

find_primitive_cell()

Detect primitive cell.

get_atom(name[, index, return_all])

Return atom object of the crystal.

get_atom_coordinates(atom[, R, index, relative])

Getter for the atom coordinates.

get_distance(atom1, atom2[, R, index1, ...])

Getter for distance between the atom1 and atom2.

get_vector(atom1, atom2[, R, index1, ...])

Getter for vector from atom1 to atom2.

remove_atom(atom[, index])

Remove atom from the crystal.

shift_atoms([gravity_point, relative])

Shifts all atoms with the same vector in a way that the gravity_point is located in the middle between minimum and maximum relative coordinates of the atoms, individually for each lattice vector.

standardize()

Standardize cell with respect to the Bravais lattice type as defined in [R01e341c7223d-1].

type([eps_rel, angle_tol])

Identify the lattice type.

voronoi_cell([reciprocal, normalize])

Computes Voronoi edges around (0,0,0) point.

Properties:

C_matrix

Transformation matrix that transforms primitive cell (Lattice.cell()) to the conventional standardized cell.

S_matrix

Transformation matrix that transforms the primitive cell to the standardized primitive cell.

a

Length of the first lattice vector \(\vert\boldsymbol{a_1}\vert\).

a1

First lattice vector \(\boldsymbol{a_1}\).

a2

Second lattice vector \(\boldsymbol{a_2}\).

a3

Third lattice vector \(\boldsymbol{a_3}\).

alpha

Angle between second and third lattice vector.

angle_tol

Absolute tolerance for the angle.

b

Length of the second lattice vector \(\vert\boldsymbol{a_2}\vert\).

b1

First reciprocal lattice vector.

b2

Second reciprocal lattice vector.

b3

Third reciprocal lattice vector.

beta

Angle between first and third lattice vector.

c

Length of the third lattice vector \(\vert\boldsymbol{a_3}\vert\).

cell

Unit cell of the lattice.

centring_type

Centring type.

conv_a

Length of the first vector of the conventional cell.

conv_a1

First vector of the conventional cell.

conv_a2

Second vector of the conventional cell.

conv_a3

Third vector of the conventional cell.

conv_alpha

Angle between second and third conventional lattice vector.

conv_b

Length of the second vector of the conventional cell.

conv_beta

Angle between first and third conventional lattice vector.

conv_c

Length of the third vector of the conventional cell.

conv_cell

Conventional cell.

conv_gamma

Angle between first and second conventional lattice vector.

conv_parameters

Return conventional cell parameters.

conv_unit_cell_volume

Volume of the conventional unit cell.

convention

Convention used for the standardization of the unit cell.

crystal_family

Crystal family.

eps

Absolute tolerance for the distance.

eps_rel

Relative tolerance for the distance.

gamma

Angle between first and second lattice vector.

k_a

Length of the first reciprocal lattice vector \(\vert\boldsymbol{b_1}\vert\).

k_alpha

Angle between second and third reciprocal lattice vector.

k_b

Length of the second reciprocal lattice vector \(\vert\boldsymbol{b_2}\vert\).

k_beta

Angle between first and third reciprocal lattice vector.

k_c

Length of the third reciprocal lattice vector \(\vert\boldsymbol{b_3}\vert\).

k_gamma

Angle between first and second reciprocal lattice vector.

kpoints

Instance of Kpoints with the high symmetry points and path.

lattice

Lattice of the crystal.

name

Human-readable name of the Bravais lattice type.

parameters

Return cell parameters.

pearson_symbol

Pearson symbol.

rcell

Reciprocal cell.

reciprocal_cell

Reciprocal cell.

reciprocal_cell_volume

Volume of the reciprocal cell.

reciprocal_parameters

Return reciprocal cell parameters.

unit_cell_volume

Volume of the unit cell.

variation

Variation of the lattice, if any.