moyopy.interface#
Classes#
Functions#
|
|
Module Contents#
- class moyopy.interface.MoyoAdapter[source]#
- static get_structure(cell: moyopy.Cell, *, unique_species_mapping: dict[int, pymatgen.core.Composition] | None = None) pymatgen.core.Structure[source]#
Convert a Moyo Cell to a pymatgen Structure.
If the Cell was created from a disordered Structure, the unique_species_mapping should be provided to reconstruct the original species.
- Parameters:
cell (moyopy.Cell) – The Moyo Cell to convert.
unique_species_mapping (dict[int, Composition] | None) – A mapping from integer indices used in the Moyo Cell to the original pymatgen SpeciesLike objects. If None, assumes the Cell was created from an ordered Structure.
- Returns:
structure – The converted pymatgen Structure object.
- Return type:
Structure
- static get_atoms(cell: moyopy.Cell) ase.Atoms[source]#
- static from_structure(structure: pymatgen.core.Structure) moyopy.Cell[source]#
Convert a pymatgen Structure to a Moyo Cell.
- static from_disordered_structure(structure: pymatgen.core.Structure) tuple[moyopy.Cell, dict[int, pymatgen.core.Composition]][source]#
Convert a disordered pymatgen Structure to a Moyo Cell.
- Parameters:
structure (Structure) – A pymatgen Structure object, which may contain disordered sites.
- Returns:
cell (moyopy.Cell) – The converted Moyo Cell object.
unique_species_mapping (dict[int, Composition]) – A mapping from integer indices used in the Moyo Cell to the original pymatgen SpeciesLike objects.
- static from_atoms(atoms: ase.Atoms) moyopy.Cell[source]#
- static from_py_obj(struct: pymatgen.core.Structure | ase.Atoms | pymatgen.io.ase.MSONAtoms) moyopy.Cell[source]#
Convert a Python atomic structure object to a Moyo Cell.
- Parameters:
struct – Currently supports pymatgen Structure, ASE Atoms, and MSONAtoms
- Returns:
The converted Moyo cell
- Return type:
- class moyopy.interface.MoyoNonCollinearMagneticAdapter[source]#
- static get_structure(magnetic_cell: moyopy.NonCollinearMagneticCell, *, unique_species_mapping: dict[int, pymatgen.core.Composition] | None = None) pymatgen.core.Structure[source]#
Convert a Moyo NonCollinearMagneticCell to a pymatgen Structure.
If the NonCollinearMagneticCell was created from a disordered Structure, the unique_species_mapping should be provided to reconstruct the original species.
- Parameters:
magnetic_cell (moyopy.NonCollinearMagneticCell) – The Moyo NonCollinearMagneticCell to convert.
unique_species_mapping (dict[int, Composition] | None) – A mapping from integer indices used in the Moyo NonCollinearMagneticCell to the original pymatgen SpeciesLike objects. If None, assumes the NonCollinearMagneticCell was created from an ordered Structure.
- Returns:
structure – The converted pymatgen Structure object with magnetic moments in site_properties[‘magmom’].
- Return type:
Structure
- static from_structure(structure: pymatgen.core.Structure) moyopy.NonCollinearMagneticCell[source]#
Convert a pymatgen Structure with non-collinear magnetic moments to a Moyo NonCollinearMagneticCell.
- static from_disordered_structure(structure: pymatgen.core.Structure) tuple[moyopy.NonCollinearMagneticCell, dict[int, pymatgen.core.Composition]][source]#
Convert a disordered pymatgen Structure with non-collinear magnetic moments to a Moyo NonCollinearMagneticCell.
- Parameters:
structure (Structure) – A pymatgen Structure object, which may contain disordered sites. Must have non-collinear magnetic moments in site_properties[‘magmom’].
- Returns:
magnetic_cell (moyopy.NonCollinearMagneticCell) – The converted Moyo NonCollinearMagneticCell object.
unique_species_mapping (dict[int, Composition]) – A mapping from integer indices used in the Moyo NonCollinearMagneticCell to the original pymatgen SpeciesLike objects.