pymatgen.core.interface module
This module provides classes to store, generate, and manipulate material interfaces.
- class Interface(lattice, species, coords, site_properties, validate_proximity=False, to_unit_cell=False, coords_are_cartesian=False, in_plane_offset: tuple[float, float] = (0, 0), gap: float = 0, vacuum_over_film: float = 0.0, interface_properties: dict | None = None)[source]
Bases:
Structure
This class stores data for defining an interface between two structures. It is a subclass of pymatgen.core.structure.Structure.
Makes an interface structure, a structure object with additional information and methods pertaining to interfaces.
- Parameters:
lattice (Lattice/3x3 array) – The lattice, either as a
pymatgen.core.lattice.Lattice
or simply as any 2D array. Each row should correspond to a lattice vector. E.g., [[10,0,0], [20,10,0], [0,0,30]] specifies a lattice with lattice vectors [10,0,0], [20,10,0] and [0,0,30].species ([Species]) –
Sequence of species on each site. Can take in flexible input, including:
A sequence of element / species specified either as string symbols, e.g. [“Li”, “Fe2+”, “P”, …] or atomic numbers, e.g., (3, 56, …) or actual Element or Species objects.
List of dict of elements/species and occupancies, e.g., [{“Fe” : 0.5, “Mn”:0.5}, …]. This allows the setup of disordered structures.
coords (Nx3 array) – list of fractional/cartesian coordinates of each species.
validate_proximity (bool) – Whether to check if there are sites that are less than 0.01 Ang apart. Defaults to False.
coords_are_cartesian (bool) – Set to True if you are providing coordinates in Cartesian coordinates. Defaults to False.
site_properties (dict) – Properties associated with the sites as a dict of sequences, e.g., {“magmom”:[5,5,5,5]}. The sequences have to be the same length as the atomic species and fractional_coords. Defaults to None for no properties.
in_plane_offset – fractional shift in plane for the film with respect to the substrate
gap – gap between substrate and film in Angstroms; zero corresponds to the original distance between substrate and film sites
vacuum_over_film – vacuum space above the film in Angstroms
- property film_sites: list[pymatgen.core.sites.Site][source]
Return the film sites of the interface.
- classmethod from_slabs(substrate_slab: Slab, film_slab: Slab, in_plane_offset: tuple[float, float] = (0, 0), gap: float = 1.6, vacuum_over_film: float = 0.0, interface_properties: dict | None = None, center_slab: bool = True) Interface [source]
Makes an interface structure by merging a substrate and film slabs The film a- and b-vectors will be forced to be the substrate slab’s a- and b-vectors.
For now, it’s suggested to use a factory method that will ensure the appropriate interface structure is already met.
- Parameters:
sub_slab – slab for the substrate
film_slab – slab for the film
in_plane_offset – fractional shift in plane for the film with respect to the substrate
gap – gap between substrate and film in Angstroms
vacuum_over_film – vacuum space above the film in Angstroms
structure_properties – dictionary of misc properties for this structure
center_slab – center the slab
- get_shifts_based_on_adsorbate_sites(tolerance: float = 0.1) list[tuple[float, float]] [source]
Computes possible in-plane shifts based on an adsorbate site algorithm
- Parameters:
tolerance – tolerance for “uniqueness” for shifts in Cartesian unit This is usually Angstroms.
- get_sorted_structure(key=None, reverse=False) Structure [source]
Get a sorted structure for the interface. The parameters have the same meaning as in list.sort. By default, sites are sorted by the electronegativity of the species.
- Parameters:
key – Specifies a function of one argument that is used to extract a comparison key from each list element: key=str.lower. The default value is None (compare the elements directly).
reverse (bool) – If set to True, then the list elements are sorted as if each comparison were reversed.
- property in_plane_offset: ndarray[source]
The shift between the film and substrate in fractional coordinates
- property substrate_layers: int[source]
Number of layers of the minimum element in the substrate composition
- property substrate_sites: list[pymatgen.core.sites.Site][source]
The site objects in the substrate