pymatgen.io.ase module

This module provides conversion between the Atomic Simulation Environment Atoms object and pymatgen Structure objects.

class AseAtomsAdaptor[source]

Bases: object

Adaptor serves as a bridge between ASE Atoms and pymatgen objects.

static get_atoms(structure: pymatgen.core.structure.Structure | pymatgen.core.structure.Molecule, **kwargs) Atoms[source]

Returns ASE Atoms object from pymatgen structure or molecule.

Parameters:
  • structure (Structure | Molecule) – Input structure or molecule

  • **kwargs – passed to the ASE Atoms constructor

Returns:

ASE Atoms object

Return type:

Atoms

static get_molecule(atoms: ~ase.atoms.Atoms, cls: type[pymatgen.core.structure.Molecule] = <class 'pymatgen.core.structure.Molecule'>, **cls_kwargs) Molecule[source]

Returns pymatgen molecule from ASE Atoms.

Parameters:
  • atoms – ASE Atoms object

  • cls – The Molecule class to instantiate (defaults to pymatgen molecule)

  • **cls_kwargs – Any additional kwargs to pass to the cls

Returns:

Equivalent pymatgen.core.structure.Molecule

Return type:

Molecule

static get_structure(atoms: ~ase.atoms.Atoms, cls: type[pymatgen.core.structure.Structure] = <class 'pymatgen.core.structure.Structure'>, **cls_kwargs) Structure[source]

Returns pymatgen structure from ASE Atoms.

Parameters:
  • atoms – ASE Atoms object

  • cls – The Structure class to instantiate (defaults to pymatgen Structure)

  • **cls_kwargs – Any additional kwargs to pass to the cls

Returns:

Equivalent pymatgen.core.structure.Structure