httk.atomistic.models.cell.numeric

The NumericCell presentation: a Cell exposed as plain numpy numbers.

Classes

NumericCell

A plain-numpy presentation of a Cell.

Module Contents

class httk.atomistic.models.cell.numeric.NumericCell(cell)[source]

A plain-numpy presentation of a Cell.

Where a Cell holds its geometry exactly (a SurdVector basis, exact SurdScalar lengths/volume, exact Fraction angles), a NumericCell mirrors that interface but returns plain numpy numbers — a float64 numpy.ndarray for every vector and a plain float for every scalar — for callers who do not need exact arithmetic and just want numpy arrays.

The presentation is numpy-backed, so constructing a NumericCell requires numpy (the httk-atomistic[numpy] extra) and raises ImportError eagerly when it is unavailable. The exact object is always one hop away via exact.

Parameters:

cell (httk.atomistic.models.cell.like.CellLike) – The cell or cell-like object to present.

property scale: float[source]

The overall length factor.

Returns:

The scale as a floating-point value.

Return type:

float

property precision: float | None[source]

The cell precision, or None if unknown.

Returns:

The absolute precision as a floating-point value.

Return type:

float | None

property periodicity: tuple[bool, bool, bool][source]

Which of the three basis rows is a genuine lattice translation.

Returns:

Flags identifying the periodic basis rows.

Return type:

tuple[bool, bool, bool]

property nperiodic_dimensions: int[source]

How many of the three directions are periodic.

Returns:

The number of periodic directions.

Return type:

int

property unscaled_basis: httk.core.NumericVector[source]

The 3x3 cell vectors before applying scale.

Returns:

The unscaled lattice vectors as floating-point values.

Return type:

httk.core.NumericVector

property basis: httk.core.NumericVector[source]

The 3x3 lattice vectors scale * unscaled_basis.

Returns:

The scaled lattice vectors as floating-point values.

Return type:

httk.core.NumericVector

property lengths: httk.core.NumericVector[source]

The three cell-vector lengths.

Returns:

The lengths as floating-point values.

Return type:

httk.core.NumericVector

property angles: httk.core.NumericVector[source]

The cell angles (alpha, beta, gamma) in degrees.

Returns:

The angles as floating-point values.

Return type:

httk.core.NumericVector

property volume: float[source]

The cell volume.

Returns:

The volume as a floating-point value.

Raises:

ValueError – If the exact cell is not periodic in all three directions.

Return type:

float

metric()[source]

The Gram matrix basis * basis^T.

Returns:

The Gram matrix as floating-point values.

Return type:

httk.core.NumericVector

property exact: httk.atomistic.models.cell.cell.Cell[source]

The exact cell this presentation wraps.

Returns:

The exact cell.

Return type:

httk.atomistic.models.cell.cell.Cell