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.

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