Get lengths from box#
Extracting edge lengths from periodic box matrices.
The function molsysmt.pbc.get_lengths_from_box() computes the Euclidean lengths of the three cell vectors \((a, b, c)\) defining a periodic box matrix.
Added in version 1.0.0.
API documentation
Follow this link for a detailed description of the input arguments, raised errors, and returned objects of this function: molsysmt.pbc.get_lengths_from_box().
Basic usage#
Let’s extract edge lengths from a periodic box matrix:
import molsysmt as msm
import pyunitwizard as puw
box = msm.pbc.get_box_with_shape(shape='cubic', length='3.5 nm')
lengths = msm.pbc.get_lengths_from_box(box)
print('Box lengths:', lengths)
Box lengths: [[3.5 3.5 3.5]] nanometer
See also
Related Tools & References
Get box with shape: Generate standard boxes with
molsysmt.pbc.get_box_with_shape().Get angles from box: Extract box angles with
molsysmt.pbc.get_angles_from_box().Get volume from box: Compute box volume with
molsysmt.pbc.get_volume_from_box().