httk.atomistic.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.cell_params.CellParams(obj: Any, **hints: Any)[source]

Bases: httk.atomistic.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 no orientation, so a cell → parameters → cell round-trip reproduces lengths, angles, and volume, but not the original orientation. unwrap returns the original raw object.

property basis: httk.core.SurdVector[source]
property scale: httk.core.SurdScalar[source]
property unscaled_basis: httk.core.SurdVector[source]
property params: tuple[fractions.Fraction, Ellipsis][source]

The stored (a, b, c, alpha, beta, gamma) as exact Fractions (angles in degrees).

unwrap() Any[source]

Return the most raw representation possible of this backend, i.e., if it uses a backend with an internal representaion - or if it can (possibly lossly) convert itself into a more raw representation that still would be recognized as a <Something>Like type, that representation will be returned. If this is not possible, the instance itself is returned.