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, **kwargs)[source]

Returns ASE Atoms object from pymatgen structure or molecule.

Parameters
  • structure – pymatgen.core.structure.Structure or pymatgen.core.structure.Molecule

  • **kwargs – other keyword args to pass into the ASE Atoms constructor

Returns

ASE Atoms object

static get_molecule(atoms, cls=None)[source]

Returns pymatgen molecule from ASE Atoms.

Parameters
  • atoms – ASE Atoms object

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

Returns

Equivalent pymatgen.core.structure.Molecule

static get_structure(atoms, cls=None)[source]

Returns pymatgen structure from ASE Atoms.

Parameters
  • atoms – ASE Atoms object

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

Returns

Equivalent pymatgen.core.structure.Structure