httk.atomistic.structure_primitive

Backend wrapping an spglib-like (lattice, positions, numbers) triple.

Classes

StructurePrimitive

Backend for a crystal structure backed by an spglib-like triple.

Module Contents

class httk.atomistic.structure_primitive.StructurePrimitive(obj: Any, **hints: Any)[source]

Bases: httk.atomistic.structure_backend.StructureBackend

Backend for a crystal structure backed by an spglib-like triple.

The native representation is a length-3 (lattice, positions, numbers) list or tuple, where lattice is 3x3, positions is Nx3 reduced coordinates, and numbers is the length-N sequence of atomic numbers. The quartet is derived lazily and cached: cell is a Cell, sites a Sites, species one single-element Species per distinct atomic number, and unwrap returns the original triple.

property cell: httk.atomistic.cell.Cell[source]
property sites: httk.atomistic.sites.Sites[source]
property species: tuple[httk.atomistic.species.Species, Ellipsis][source]
property species_at_sites: tuple[str, Ellipsis][source]
unwrap() Any[source]

Return the most raw representation possible of this backend, i.e., if it uses a backend with an internal representaion - or if it can (possibly lossly) convert itself into a more raw representation that still would be recognized as a <Something>Like type, that representation will be returned. If this is not possible, the instance itself is returned.