molsysmt.pbc.get_lengths_and_angles_from_box#

molsysmt.pbc.get_lengths_and_angles_from_box(box, skip_digestion=False)[source]#

Return box lengths and angles from a 3x3 box matrix or an array of boxes.

Parameters:
  • box (PyUnitWizard quantity) – Periodic box vectors with shape (n_structures, 3, 3) in units of length.

  • skip_digestion (bool, default=False) – Whether to skip MolSysMT’s internal argument digestion mechanism.

Returns:

  • lengths, angles –

    • lengths: |v0|, |v1|, |v2| in the same units as the input (often labeled as a, b, c in other libraries/software).

    • angles: (alpha, beta, gamma) in radians where:

      alpha = angle between v1 and v2, beta = angle between v0 and v2, gamma = angle between v0 and v1.

      This matches the conventional nomenclature (alpha between b and c, beta between a and c, gamma between a and b).

  • .. versionadded:: 1.0.0