Previous topic

geomm.arrhenius module

Next topic

geomm.centering module

This Page

geomm.box_vectors module

geomm.box_vectors.box_vectors_to_lengths_angles(box_vectors)[source]

Convert box vectors for a single ‘frame’ to lengths and angles.

geomm.box_vectors.lengths_and_angles_to_box_vectors(lengths, angles)[source]

Convert from the lengths/angles of the unit cell to the box vectors (Bravais vectors). The angles should be in degrees.

Parameters
  • lengths (arraylike of dim 3) – The lengths of each box vector

  • angles (arraylike of dim 3) – The angles between each box vector, in degrees.

Returns

box_vectors – If the inputs are scalar, the vectors will one dimensional (length 3). If the inputs are one dimension, shape=(n_frames, ), then the output will be (n_frames, 3)

Return type

arraylike of shape (3, 3)

Examples

>>> import numpy as np
>>> result = lengths_and_angles_to_box_vectors(1, 1, 1, 90.0, 90.0, 90.0)

Notes

This code is adapted from gyroid, which is licensed under the BSD http://pythonhosted.org/gyroid/_modules/gyroid/unitcell.html