httk.atomistic.integrations.ase.models¶
ASE interoperability for the httk.atomistic structure family.
The protocol deliberately describes only the four ASE Atoms methods needed for
conversion. ASE is optional: duck-typed objects can be converted without installing
ASE, while ASEAtomsView is available only when
ASE itself is installed.
Classes¶
Describe the minimal method surface needed to read ASE |
|
Import ASE |
Module Contents¶
- class httk.atomistic.integrations.ase.models.ASEAtomsProtocol[source]¶
Bases:
ProtocolDescribe the minimal method surface needed to read ASE
Atoms.This is a runtime-checkable, duck-typed protocol. ASE is not required: any object providing these four methods qualifies for
ASEAtoms.- get_cell()[source]¶
Return the cell vectors as rows.
- Returns:
The native cell rows.
- Return type:
Any
- get_scaled_positions()[source]¶
Return the reduced positions.
- Returns:
One reduced coordinate row per site.
- Return type:
Any
- class httk.atomistic.integrations.ase.models.ASEAtoms(obj, **hints)[source]¶
Bases:
httk.atomistic.models.structure.backend.StructureBackendImport ASE
Atomsand compatible duck-typed objects.Conversion is eager because reading the four methods and normalizing their values is real work. The original object remains available through
unwrap().Initial magnetic moments become site moments and nonzero initial charges become charged single-element species. All-zero ASE defaults remain unstated.
- Parameters:
obj (ASEAtomsProtocol) – An ASE
Atomsobject or compatible duck-typed object.**hints (Any) – Backend-selection hints.
- property cell: httk.atomistic.models.cell.cell.Cell[source]¶
Return the exact cell converted from native cell rows.
- property sites: httk.atomistic.models.sites.sites.Sites[source]¶
Return the exact reduced coordinates converted from native positions.
- property species: tuple[httk.atomistic.models.species.species.Species, Ellipsis][source]¶
Return distinct single-element species in first-appearance order.
- property species_at_sites: tuple[str, Ellipsis][source]¶
Return the species name occupying each site.