pydft_qmmm.utils.lattice

Helper functions for operations involving periodic lattices.

Functions

compute_lattice_constants(box)

Calculate the length and angle constants from lattice vectors.

compute_lattice_vectors(a, b, c, alpha, ...)

Calculate the lattice vectors from length and angle constants.

compute_least_mirror(i_vector, j_vector, box)

Calculate the least mirror vector.

pydft_qmmm.utils.lattice.compute_lattice_constants(box)[source]

Calculate the length and angle constants from lattice vectors.

Returns the lattice constants a, b, c, \(\mathrm{\alpha}\), \(\mathrm{\beta}\), and \(\mathrm{\gamma}\) using a set of box vectors for a periodic triclinic system.

Parameters:

box (ndarray[tuple[Any, ...], dtype[float64]]) – The lattice vectors (\(\mathrm{\mathring{A}}\)) of an arbitrary triclinic box.

Return type:

tuple[float, ...]

Returns:

The characteristic lengths (\(\mathrm{\mathring{A}}\)) and angles (\(\mathrm{^{\circ}}\)) of an arbitrary triclinic box.

pydft_qmmm.utils.lattice.compute_lattice_vectors(a, b, c, alpha, beta, gamma)[source]

Calculate the lattice vectors from length and angle constants.

Parameters:
  • a (float) – The first characteristic length (\(\mathrm{\mathring{A}}\)) of an arbitrary triclinic box.

  • b (float) – The second characteristic length (\(\mathrm{\mathring{A}}\)) of an arbitrary triclinic box.

  • b – The third characteristic length (\(\mathrm{\mathring{A}}\)) of an arbitrary triclinic box.

  • alpha (float) – The first characteristic angle (\(\mathrm{^{\circ}}\)), \(\mathrm{\alpha}\), of an arbitrary triclinic box.

  • beta (float) – The second characteristic angle (\(\mathrm{^{\circ}}\)), \(\mathrm{\beta}\), of an arbitrary triclinic box.

  • gamma (float) – The third characteristic angle (\(\mathrm{^{\circ}}\)), \(\mathrm{\gamma}\), of an arbitrary triclinic box.

  • c (float)

Return type:

ndarray[tuple[Any, ...], dtype[float64]]

Returns:

The lattice vectors (\(\mathrm{\mathring{A}}\)) of an arbitrary triclinic box.

pydft_qmmm.utils.lattice.compute_least_mirror(i_vector, j_vector, box)[source]

Calculate the least mirror vector.

Parameters:
Return type:

ndarray[tuple[Any, ...], dtype[float64]]

Returns:

Returns the least mirror coordinates of i_vector with respect to j_vector given a set of lattice vectors from a periodic triclinic system.