httk.atomistic.vasp_structures¶
Build an exact Structure from a neutral POSCAR mapping.
structure_from_poscar() consumes the plain, string-preserving mapping
produced by httk.io.read_poscar (format tag "vasp-poscar") and turns it
into an exact Structure. It imports nothing from
httk-io — it only understands the neutral mapping shape — keeping the parsing
capability (httk-io) and the domain model (httk-atomistic) decoupled.
load_structure() is the convenience end-to-end entry point:
httk.core.load picks the reader by file type, and a small adapter table maps
the payload’s "format" tag to the matching structure builder.
Functions¶
|
Build an exact |
|
Load a file and build a |
Module Contents¶
- httk.atomistic.vasp_structures.structure_from_poscar(data: collections.abc.Mapping[str, Any]) httk.atomistic.structure.Structure[source]¶
Build an exact
Structurefrom a neutral POSCAR mapping.datais the mapping returned byhttk.io.read_poscar(itsformatmust be"vasp-poscar"). The cell basis is taken exactly from the file’s string rows. For a positive universal scaling factor thescalestring is used directly as the cell’s exact scale; for a negative scaling factor (a target volumeV) the scale is the cube root ofV / |det(basis)|— a value outside the exact surd field, so it is a deterministic rational approximation (the basis rows themselves stay exact).Direct coordinates become reduced coordinates directly (exact strings). Cartesian coordinates are converted exactly as
cart * basis.inv()under the row-vector convention; because VASP scales both the lattice vectors and the Cartesian positions by the universal scaling factor, that factor cancels and the reduced coordinates are exact regardless of the scale/volume case.Species come from the VASP-5 species line (one single-element, unattached
Speciesof concentration 1.0 per distinct symbol); a VASP-4 file (no species symbols) raises aValueError. Selective dynamics flags, if present, are ignored.
- httk.atomistic.vasp_structures.load_structure(path: str) httk.atomistic.structure.Structure[source]¶
Load a file and build a
Structurefrom it.httk.core.load(path)selects the reader by file type (transparently decompressing.bz2/.gzfiles); the payload’s"format"tag then selects the matching structure builder. A payload without a recognized"format"tag (for example a CIF, which returns a different shape) raises a clearValueError.