httk.atomistic.structure¶
The Simple structure representation for httk-atomistic.
Classes¶
A crystal structure in the Simple representation. |
Module Contents¶
- class httk.atomistic.structure.Structure(cell: httk.atomistic.cell_like.CellLike, sites: httk.atomistic.sites_like.SitesLike, species: collections.abc.Sequence[httk.atomistic.species_like.SpeciesLike], species_at_sites: collections.abc.Sequence[str])[source]¶
A crystal structure in the Simple representation.
A Structure holds a
cell(aCellof 3x3 cell vectors),sites(aSitesof Nx3 reduced coordinates), a list ofspecies(each aSpecies), and a length-Nspecies_at_sitesgiving the species name occupying each site. Inputs are normalized on construction through the component families: the cell, sites, and each species are passed through their*Likeunions, and everyspecies_at_sitesname must match one of the (uniquely named) species.The numeric model is exact and split by purpose. The fractional frame — reduced coordinates and symmetry — is rational and lives in
sitesas aFracVector. The Cartesian frame — where radicals such as the hexagonalsqrt(3)appear — is exact in the squarefree-radical field:cell.basisis aSurdVectorandcartesian_sites()returns the exact Cartesian positions. Pure magnitudes (bond-length comparisons) stay rational-exact viacell.metric(). Floats appear only at the presentation and JSON boundaries.- property cell: httk.atomistic.cell.Cell[source]¶
The cell (3x3 cell vectors) as a
Cell.
- property sites: httk.atomistic.sites.Sites[source]¶
The site coordinates (Nx3 reduced coordinates) as a
Sites.
- property species: tuple[httk.atomistic.species.Species, Ellipsis][source]¶
The distinct species of this structure.
- property species_at_sites: tuple[str, Ellipsis][source]¶
The species name occupying each site, in site order.
- cartesian_sites() httk.core.SurdVector[source]¶
The exact Cartesian site positions as an
(N, 3)SurdVector.Under the row-vector convention this is
reduced_coords * cell.basis(each Cartesian position is the sum over lattice vectorssum_k reduced[k] * basis[k]). The reduced coordinates are rational (aFracVector), the cell basis carries the radicals (aSurdVector), so the product is exact in the surd field — the hexagonalsqrt(3)survives into the Cartesian positions.
- numeric() httk.atomistic.numeric_structure.NumericStructure[source]¶
A plain-numpy presentation of this structure (requires the
httk-atomistic[numpy]extra).