httk.atomistic.structure ======================== .. py:module:: httk.atomistic.structure .. autoapi-nested-parse:: The Simple structure representation for httk-atomistic. Classes ------- .. autoapisummary:: httk.atomistic.structure.Structure Module Contents --------------- .. py:class:: 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]) A crystal structure in the Simple representation. A Structure holds a ``cell`` (a ``Cell`` of 3x3 cell vectors), ``sites`` (a ``Sites`` of Nx3 reduced coordinates), a list of ``species`` (each a ``Species``), and a length-N ``species_at_sites`` giving 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 ``*Like`` unions, and every ``species_at_sites`` name 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 ``sites`` as a :class:`~httk.core.FracVector`. The Cartesian frame — where radicals such as the hexagonal ``sqrt(3)`` appear — is exact in the squarefree-radical field: ``cell.basis`` is a :class:`~httk.core.SurdVector` and :meth:`cartesian_sites` returns the exact Cartesian positions. Pure magnitudes (bond-length comparisons) stay rational-exact via ``cell.metric()``. Floats appear only at the presentation and JSON boundaries. .. py:property:: cell :type: httk.atomistic.cell.Cell The cell (3x3 cell vectors) as a ``Cell``. .. py:property:: sites :type: httk.atomistic.sites.Sites The site coordinates (Nx3 reduced coordinates) as a ``Sites``. .. py:property:: species :type: tuple[httk.atomistic.species.Species, Ellipsis] The distinct species of this structure. .. py:property:: species_at_sites :type: tuple[str, Ellipsis] The species name occupying each site, in site order. .. py:method:: cartesian_sites() -> httk.core.SurdVector The exact Cartesian site positions as an ``(N, 3)`` :class:`~httk.core.SurdVector`. Under the row-vector convention this is ``reduced_coords * cell.basis`` (each Cartesian position is the sum over lattice vectors ``sum_k reduced[k] * basis[k]``). The reduced coordinates are rational (a ``FracVector``), the cell basis carries the radicals (a ``SurdVector``), so the product is exact in the surd field — the hexagonal ``sqrt(3)`` survives into the Cartesian positions. .. py:method:: numeric() -> httk.atomistic.numeric_structure.NumericStructure A plain-numpy presentation of this structure (requires the ``httk-atomistic[numpy]`` extra).