# Crystal3DLattice¶

class sknano.core.crystallography.Crystal3DLattice(a=None, b=None, c=None, alpha=None, beta=None, gamma=None, a1=None, a2=None, a3=None, cell_matrix=None, orientation_matrix=None, offset=None)[source] [edit on github][source]

3D crystal lattice class.

Parameters: b, c (a,) – beta, gamma (alpha,) – a2, a3 (a1,) – cell_matrix (array_like) – orientation_matrix (array_like, optional) –

Attributes

 a Length of lattice vector $$\mathbf{a}$$. a1 Lattice vector $$\mathbf{a}_1=\mathbf{a}$$. a2 Lattice vector $$\mathbf{a}_2=\mathbf{b}$$. a3 Lattice vector $$\mathbf{a}_3=\mathbf{c}$$. alpha Angle between lattice vectors $$\mathbf{b}$$ and $$\mathbf{c}$$ in degrees. angles Tuple of lattice parameter angles $$\alpha, \beta, \gamma$$. b Length of lattice_vector $$\mathbf{b}$$. b1 3D reciprocal lattice vector $$\mathbf{b}_1=\mathbf{a}^{*}$$. b2 3D reciprocal lattice vector $$\mathbf{b}_2=\mathbf{b}^{*}$$. b3 3D reciprocal lattice vector $$\mathbf{b}_3=\mathbf{c}^{*}$$. beta Angle between lattice vectors $$\mathbf{a}$$ and $$\mathbf{c}$$ in degrees. bounding_box region bounding_box. c Length of lattice vector $$\mathbf{c}$$. cell Alias for cell_matrix. cell_matrix Matrix of lattice row vectors. cell_volume Alias for volume. centroid Region centroid. cos_alpha $$\cos\alpha$$ cos_alpha_star $$\cos\alpha^*$$ cos_beta $$\cos\beta$$ cos_beta_star $$\cos\beta^*$$ cos_gamma $$\cos\gamma$$ cos_gamma_star $$\cos\gamma^*$$ fmtstr Format string. fractional_matrix Transformation matrix to convert from cartesian coordinates to fractional coordinates. gamma Angle between lattice vectors $$\mathbf{a}$$ and $$\mathbf{b}$$ in degrees. lattice_parameters Tuple of lattice parameters a, b, c, alpha, beta, gamma. lattice_vectors Tuple of lattice vectors $$\mathbf{a}_1, \mathbf{a}_2, \mathbf{a}_3$$. lengths Tuple of lattice vector lengths $$a, b, c$$. lengths_and_angles Alias for attr:Crystal3DLattice.lattice_parameters. matrix Alias for cell_matrix. metric_tensor Metric tensor. offset Lattice offset. ortho_matrix Transformation matrix to convert from fractional coordinates to cartesian coordinates. reciprocal_lattice Reciprocal lattice of this Crystal3DLattice. region Parallelepiped defined by lattice vectors. sin_alpha $$\sin\alpha$$ sin_alpha_star $$\sin\alpha^*$$ sin_beta $$\sin\beta$$ sin_beta_star $$\sin\beta^*$$ sin_gamma $$\sin\gamma$$ sin_gamma_star $$\sin\gamma^*$$ volume Crystal cell volume.

Methods

 cartesian_to_fractional(ccoords) Convert cartesian coordinate to fractional coordinate. cubic(a) Generate a cubic 3D lattice with lattice parameter $$a$$. fractional_diff(fcoords1, fcoords2) Compute difference between fractional coordinates. fractional_to_cartesian(fcoords) Convert fractional coordinate to cartesian coordinate. hexagonal(a, c) Generate a hexagonal 3D lattice with lattice parameters $$a, c$$. monoclinic(a, b, c, beta) Generate a monoclinic 3D lattice with lattice parameters $$a, b, c, \beta$$. orthorhombic(a, b, c) Generate an orthorhombic 3D lattice with lattice parameters $$a, b, c$$. rotate(**kwargs) Rotate unit cell. tetragonal(a, c) Generate a tetragonal 3D lattice with lattice parameters $$a, c$$. todict() Return dict of Crystal3DLattice parameters. translate(t) Translate lattice. triclinic(a, b, c, alpha, beta, gamma) Generate a triclinic 3D lattice with lattice parameters $$a, b, c, \alpha, \beta, \gamma$$. wrap_cartesian_coordinate(p[, epsilon, pbc]) Wrap cartesian coordinate to lie within unit cell. wrap_cartesian_coordinates(points[, ...]) Wrap array of cartesian coordinates to lie within unit cell. wrap_fractional_coordinate(p[, epsilon, pbc]) Wrap fractional coordinate to lie within unit cell. wrap_fractional_coordinates(points[, ...]) Wrap array of fractional coordinates to lie within unit cell.

Attributes Summary

 a Length of lattice vector $$\mathbf{a}$$. a1 Lattice vector $$\mathbf{a}_1=\mathbf{a}$$. a2 Lattice vector $$\mathbf{a}_2=\mathbf{b}$$. a3 Lattice vector $$\mathbf{a}_3=\mathbf{c}$$. alpha Angle between lattice vectors $$\mathbf{b}$$ and $$\mathbf{c}$$ in degrees. angles Tuple of lattice parameter angles $$\alpha, \beta, \gamma$$. b Length of lattice_vector $$\mathbf{b}$$. beta Angle between lattice vectors $$\mathbf{a}$$ and $$\mathbf{c}$$ in degrees. c Length of lattice vector $$\mathbf{c}$$. cell_volume Alias for volume. cos_alpha $$\cos\alpha$$ cos_beta $$\cos\beta$$ cos_gamma $$\cos\gamma$$ gamma Angle between lattice vectors $$\mathbf{a}$$ and $$\mathbf{b}$$ in degrees. lattice_parameters Tuple of lattice parameters a, b, c, alpha, beta, gamma. lattice_vectors Tuple of lattice vectors $$\mathbf{a}_1, \mathbf{a}_2, \mathbf{a}_3$$. lengths Tuple of lattice vector lengths $$a, b, c$$. lengths_and_angles Alias for attr:Crystal3DLattice.lattice_parameters. ortho_matrix Transformation matrix to convert from fractional coordinates to cartesian coordinates. reciprocal_lattice Reciprocal lattice of this Crystal3DLattice. sin_alpha $$\sin\alpha$$ sin_beta $$\sin\beta$$ sin_gamma $$\sin\gamma$$ volume Crystal cell volume.

Methods Summary

 cubic(a) Generate a cubic 3D lattice with lattice parameter $$a$$. hexagonal(a, c) Generate a hexagonal 3D lattice with lattice parameters $$a, c$$. monoclinic(a, b, c, beta) Generate a monoclinic 3D lattice with lattice parameters $$a, b, c, \beta$$. orthorhombic(a, b, c) Generate an orthorhombic 3D lattice with lattice parameters $$a, b, c$$. tetragonal(a, c) Generate a tetragonal 3D lattice with lattice parameters $$a, c$$. todict() Return dict of Crystal3DLattice parameters. triclinic(a, b, c, alpha, beta, gamma) Generate a triclinic 3D lattice with lattice parameters $$a, b, c, \alpha, \beta, \gamma$$.

Attributes Documentation

a

Length of lattice vector $$\mathbf{a}$$.

a1

Lattice vector $$\mathbf{a}_1=\mathbf{a}$$.

a2

Lattice vector $$\mathbf{a}_2=\mathbf{b}$$.

a3

Lattice vector $$\mathbf{a}_3=\mathbf{c}$$.

alpha

Angle between lattice vectors $$\mathbf{b}$$ and $$\mathbf{c}$$ in degrees.

angles

Tuple of lattice parameter angles $$\alpha, \beta, \gamma$$.

b

Length of lattice_vector $$\mathbf{b}$$.

beta

Angle between lattice vectors $$\mathbf{a}$$ and $$\mathbf{c}$$ in degrees.

c

Length of lattice vector $$\mathbf{c}$$.

cell_volume

Alias for volume.

cos_alpha

$$\cos\alpha$$

cos_beta

$$\cos\beta$$

cos_gamma

$$\cos\gamma$$

gamma

Angle between lattice vectors $$\mathbf{a}$$ and $$\mathbf{b}$$ in degrees.

lattice_parameters

Tuple of lattice parameters a, b, c, alpha, beta, gamma.

lattice_vectors

Tuple of lattice vectors $$\mathbf{a}_1, \mathbf{a}_2, \mathbf{a}_3$$.

lengths

Tuple of lattice vector lengths $$a, b, c$$.

lengths_and_angles

Alias for attr:Crystal3DLattice.lattice_parameters.

ortho_matrix

Transformation matrix to convert from fractional coordinates to cartesian coordinates.

reciprocal_lattice

Reciprocal lattice of this Crystal3DLattice.

sin_alpha

$$\sin\alpha$$

sin_beta

$$\sin\beta$$

sin_gamma

$$\sin\gamma$$

volume

Crystal cell volume.

Methods Documentation

classmethod cubic(a)[source] [edit on github][source]

Generate a cubic 3D lattice with lattice parameter $$a$$.

classmethod hexagonal(a, c)[source] [edit on github][source]

Generate a hexagonal 3D lattice with lattice parameters $$a, c$$.

classmethod monoclinic(a, b, c, beta)[source] [edit on github][source]

Generate a monoclinic 3D lattice with lattice parameters $$a, b, c, \beta$$.

classmethod orthorhombic(a, b, c)[source] [edit on github][source]

Generate an orthorhombic 3D lattice with lattice parameters $$a, b, c$$.

classmethod tetragonal(a, c)[source] [edit on github][source]

Generate a tetragonal 3D lattice with lattice parameters $$a, c$$.

todict()[source] [edit on github][source]

Return dict of Crystal3DLattice parameters.

classmethod triclinic(a, b, c, alpha, beta, gamma)[source] [edit on github][source]

Generate a triclinic 3D lattice with lattice parameters $$a, b, c, \alpha, \beta, \gamma$$.