httk.atomistic.models.sites.sites¶
The Sites class for httk-atomistic.
Classes¶
The sites of a crystal structure: the Nx3 matrix of reduced coordinates, held exactly. |
Module Contents¶
- class httk.atomistic.models.sites.sites.Sites(reduced_coords, precision=None)[source]¶
Bases:
httk.atomistic.models.sites.backend.SitesBackendThe sites of a crystal structure: the Nx3 matrix of reduced coordinates, held exactly.
Reduced (fractional) coordinates are the symmetry-native frame: point-group operations are integer matrices and translations are rationals, so no radicals ever appear. They are therefore stored as an exact rational
FracVectorof shape(N, 3). A Sites object is iterable and indexable over its length-3 coordinate rows (each aFracVector), withlengiving the number of sites.Inputs embed exactly: rationals (and rational-valued floats), rational strings, and numpy arrays all land on their exact rational value. An irrational
SurdVectorinput is rejected; the exact Cartesian frame — where radicals belong — is obtained instead viacartesian_sites().- Parameters:
reduced_coords (httk.core.VectorLike) – The reduced coordinates, one site per row.
precision (Any) – The fractional precision carried from the source, if known.
- property reduced_coords: httk.core.FracVector[source]¶
The Nx3 reduced site coordinates as an exact
FracVector(one site per row).
- property precision: fractions.Fraction | None[source]¶
How precisely these coordinates were stated, in fractional units, or
None.Fractional and therefore dimensionless: reduced coordinates are fractions of a cell edge, and a
Sitescarries no cell to convert with. Usecartesian_precision()for the corresponding length, which is the number an interatomic tolerance or an spglibsymprecactually wants.It is the coarsest precision among the coordinates, since a structure is only as precisely stated as its least precisely stated number.
Nonemeans unknown.- Returns:
The fractional precision, or
Nonewhen unknown.- Return type:
fractions.Fraction | None
- numeric()[source]¶
Return a plain-numpy presentation of these sites.
- Returns:
The numpy-backed presentation.
- Raises:
ImportError – If numpy is unavailable.
- Return type: