httk.atomistic.integrations.ase

Expose optional ASE structure integrations.

Submodules

Classes

ASEAtoms

Import ASE Atoms and compatible duck-typed objects.

ASEAtomsProtocol

Describe the minimal method surface needed to read ASE Atoms.

Package Contents

class httk.atomistic.integrations.ase.ASEAtoms(obj, **hints)[source]

Bases: httk.atomistic.models.structure.backend.StructureBackend

Import ASE Atoms and 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 Atoms object or compatible duck-typed object.

  • **hints (Any) – Backend-selection hints.

property cell: httk.atomistic.models.cell.cell.Cell

Return the exact cell converted from native cell rows.

property sites: httk.atomistic.models.sites.sites.Sites

Return the exact reduced coordinates converted from native positions.

property species: tuple[httk.atomistic.models.species.species.Species, Ellipsis]

Return distinct single-element species in first-appearance order.

property species_at_sites: tuple[str, Ellipsis]

Return the species name occupying each site.

property site_moments: Any

Return per-site moments, or None for absent and all-zero ASE defaults.

unwrap()[source]

Return the original Atoms-like object.

class httk.atomistic.integrations.ase.ASEAtomsProtocol[source]

Bases: Protocol

Describe 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

get_atomic_numbers()[source]

Return one atomic number per site.

Returns:

The atomic numbers.

Return type:

Any

get_pbc()[source]

Return one periodicity flag per cell row.

Returns:

The periodicity flags.

Return type:

Any