Lattices (erlab.lattice)

Tools related to the real and reciprocal lattice.

Functions

angle_between(v1, v2)

Return the angle between two vectors.

abc2avec(a, b, c, alpha, beta, gamma)

Construct lattice vectors from lattice parameters.

avec2abc(avec)

Determine lattice parameters from lattice vectors.

to_reciprocal(avec)

Construct the reciprocal lattice vectors from real lattice vectors.

to_real(bvec)

Construct the real lattice vectors from reciprocal lattice vectors.

erlab.lattice.abc2avec(a, b, c, alpha, beta, gamma)[source]

Construct lattice vectors from lattice parameters.

Parameters:
  • a (floating) – Lattice parameter \(a\).

  • b (floating) – Lattice parameter \(b\).

  • c (floating) – Lattice parameter \(c\).

  • alpha (floating) – Lattice parameter \(\alpha\) in degrees.

  • beta (floating) – Lattice parameter \(\beta\) in degrees.

  • gamma (floating) – Lattice parameter \(\gamma\) in degrees.

Returns:

avec – Real lattice vectors, given as a 3 by 3 numpy array with each basis vector given in each row.

Return type:

ndarray[tuple[int, …], dtype[floating]]

erlab.lattice.angle_between(v1, v2)[source]

Return the angle between two vectors.

Parameters:
  • v1 (array-like) – 1D array of length 3, specifying a vector.

  • v2 (array-like) – 1D array of length 3, specifying a vector.

Returns:

float – The angle in degrees.

Return type:

float

erlab.lattice.avec2abc(avec)[source]

Determine lattice parameters from lattice vectors.

Parameters:

avec (ndarray[tuple[int, ...], dtype[floating]]) – Real lattice vectors, given as a 3 by 3 numpy array with each basis vector given in each row.

Returns:

a, b, c, alpha, beta, gamma

Return type:

tuple[float, float, float, float, float, float]

erlab.lattice.to_real(bvec)[source]

Construct the real lattice vectors from reciprocal lattice vectors.

Parameters:

bvec (ndarray[tuple[int, ...], dtype[floating]]) – Reciprocal lattice vectors, given as a 3 by 3 numpy array with each basis vector given in each row.

Returns:

avec – The real lattice vectors.

Return type:

ndarray[tuple[int, …], dtype[floating]]

erlab.lattice.to_reciprocal(avec)[source]

Construct the reciprocal lattice vectors from real lattice vectors.

Parameters:

avec (ndarray[tuple[int, ...], dtype[floating]]) – Real lattice vectors, given as a 3 by 3 numpy array with each basis vector given in each row.

Returns:

bvec – The reciprocal lattice vectors.

Return type:

ndarray[tuple[int, …], dtype[floating]]