httk.atomistic.models.cell.params

Backend wrapping cell parameters (a, b, c, alpha, beta, gamma).

Classes

CellParams

Backend for a cell backed by cell parameters (a, b, c, alpha, beta, gamma).

Module Contents

class httk.atomistic.models.cell.params.CellParams(obj, **hints)[source]

Bases: httk.atomistic.models.cell.backend.CellBackend

Backend for a cell backed by cell parameters (a, b, c, alpha, beta, gamma).

The native representation is a flat length-6 vector-like of the cell-vector lengths a/b/c and the angles alpha/beta/gamma in degrees, stored as exact Fraction values (parsed via any_to_fraction()). The exact basis is derived lazily and cached using the standard crystallographic orientation convention (first cell vector along x, second in the xy-plane); for the common Niven angles it is exact (radicals intact). Since parameters carry no separate length factor, scale is the exact 1 and unscaled_basis == basis. Parameters carry neither orientation nor periodicity, so a cell → parameters → cell round-trip reproduces lengths and angles, and reproduces volume only for a fully periodic source. Reconstruction uses the fully periodic default and therefore discards any non-3D periodicity as well as the original orientation. unwrap returns the original raw object.

Parameters:
  • obj (Any) – The six cell parameters in crystallographic order.

  • **hints (Any) – Backend-selection hints.

property basis: httk.core.SurdVector[source]

Return the basis derived from the stored parameters.

Returns:

The standard-orientation cell vectors.

Return type:

httk.core.SurdVector

property scale: httk.core.SurdScalar[source]

Return the unit scale factor.

Returns:

The factor applied to unscaled_basis.

Return type:

httk.core.SurdScalar

property unscaled_basis: httk.core.SurdVector[source]

Return the parameter-derived basis before scaling.

Returns:

The cell vectors.

Return type:

httk.core.SurdVector

property lengths: tuple[httk.core.SurdScalar, Ellipsis][source]

Return the natively stored cell-vector lengths.

Returns:

The exact stored a, b, and c lengths.

Return type:

tuple[httk.core.SurdScalar, Ellipsis]

property angles: tuple[fractions.Fraction, Ellipsis][source]

Return the natively stored cell angles in degrees.

Returns:

The exact stored alpha, beta, and gamma angles.

Return type:

tuple[fractions.Fraction, Ellipsis]

property params: tuple[fractions.Fraction, Ellipsis][source]

The stored (a, b, c, alpha, beta, gamma) in degrees.

Returns:

The exact cell parameters.

Return type:

tuple[fractions.Fraction, Ellipsis]

unwrap()[source]

Return the original parameter object.

Returns:

The raw parameter representation.

Return type:

Any