httk.atomistic.integrations.pymatgen.models¶
Pymatgen interoperability without importing the optional dependency.
Classes¶
The three native attributes that identify a pymatgen structure. |
|
Import a pymatgen-compatible structure eagerly. |
Module Contents¶
- class httk.atomistic.integrations.pymatgen.models.PymatgenStructureProtocol[source]¶
Bases:
ProtocolThe three native attributes that identify a pymatgen structure.
latticesupplies the cell and periodicity,frac_coordssupplies the reduced coordinates, andspecies_and_occusupplies one per-site composition mapping. This small surface is disjoint from ASEAtomsand httk structure objects while allowing pymatgen-compatible duck-typed inputs without importing pymatgen.
- class httk.atomistic.integrations.pymatgen.models.PymatgenStructure(obj, **hints)[source]¶
Bases:
httk.atomistic.models.structure.backend.StructureBackendImport a pymatgen-compatible structure eagerly.
Pymatgen
properties, site labels, and site properties other thanmagmomare intentionally discarded because they have no exact httk structure-family counterpart. PymatgenDummySpeciesvalues with the default zero oxidation state are imported with an unstated charge because pymatgen cannot distinguish that default from an explicitly supplied zero; nonzero dummy oxidation states remain exact charges.Partial occupancy and its exact
Fractionvalues are retained. An occupancy shortfall becomes an explicit vacancy constituent, which views omit when exporting to pymatgen. The original object remains available throughunwrap().- Parameters:
obj (PymatgenStructureProtocol) – A pymatgen
Structureobject or compatible duck-typed object.**hints (Any) – Backend-selection hints.
- property cell: httk.atomistic.models.cell.cell.Cell[source]¶
Return the converted cell and periodicity.
- property sites: httk.atomistic.models.sites.sites.Sites[source]¶
Return the converted reduced coordinates.
- property species: tuple[httk.atomistic.models.species.species.Species, Ellipsis][source]¶
Return the imported distinct species and occupancies.
- property species_at_sites: tuple[str, Ellipsis][source]¶
Return the imported species name at each site.
- property site_moments: Any[source]¶
Return imported collinear or Cartesian site moments, if present.
- property charge: fractions.Fraction | None[source]¶
Return the exact structure charge, or
Nonewhen unstated.