httk.atomistic.numeric_structure

The NumericStructure presentation: a Structure exposed as plain numpy numbers.

Classes

NumericStructure

A plain-numpy presentation of a Structure.

Module Contents

class httk.atomistic.numeric_structure.NumericStructure(structure: httk.atomistic.structure_like.StructureLike)[source]

A plain-numpy presentation of a Structure.

Where a Structure holds its geometry exactly (a surd cell basis, rational reduced coordinates, an exact Cartesian frame), a NumericStructure mirrors that interface but returns plain numpy numbers: its cell is a NumericCell, its sites a NumericSites, and cartesian_sites() a float64 numpy array. The species/species_at_sites are passed through unchanged (they are already plain data). It is for callers who do not need exact arithmetic and just want numpy arrays.

The presentation is numpy-backed, so constructing a NumericStructure 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.

property cell: httk.atomistic.numeric_cell.NumericCell[source]

The cell as a NumericCell.

property sites: httk.atomistic.numeric_sites.NumericSites[source]

The sites as a NumericSites.

property species: tuple[httk.atomistic.species.Species, Ellipsis][source]

The distinct species, passed through unchanged.

property species_at_sites: tuple[str, Ellipsis][source]

The species name occupying each site, passed through unchanged.

cartesian_sites() httk.core.NumericVector[source]

The Cartesian site positions as an (N, 3) float64 numpy array.

property exact: httk.atomistic.structure.Structure[source]

The exact Structure this presentation wraps.