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 = {})[source]

Bases: pymatgen.core.structure.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

  • 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:

    1. 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.

    2. 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


MSONAble dict


Convenience method to get a copy of the structure, with options to add site properties.


A copy of the Interface.

property film[source]

A pymatgen Structure for just the film

property film_indices[source]

Site indices of the film sites

property film_layers[source]

Number of layers of the minimum element in the film composition

property film_sites[source]

Return the film sites of the interface.

property film_termination[source]

Label for the film termination chemistry

classmethod from_dict(d)[source]

d – dict


Creates slab from dict.

classmethod from_slabs(substrate_slab: pymatgen.core.surface.Slab, film_slab: pymatgen.core.surface.Slab, in_plane_offset: Tuple[float, float] = 0, 0, gap: float = 1.6, vacuum_over_film: float = 0.0, interface_properties: Dict = {}, center_slab: bool = True)pymatgen.core.interface.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.

  • 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

property gap[source]

The gap in cartesian units between the film and the substrate

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


tolerance – tolerance for “uniqueness” for shifts in Cartesian unit This is usually Angstroms.

get_sorted_structure(key=None, reverse=False)pymatgen.core.structure.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.

  • 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[source]

The shift between the film and substrate in fractional coordinates

property substrate[source]

A pymatgen Structure for just the substrate

property substrate_indicies[source]

Site indicies for the substrate atoms

property substrate_layers[source]

Number of layers of the minimum element in the substrate composition

property substrate_sites[source]

The site objects in the substrate

property substrate_termination[source]

Label for the substrate termination chemistry

property vacuum_over_film[source]

The vacuum space over the film in cartesian units

count_layers(struc: pymatgen.core.structure.Structure, el=None) → int[source]

Counts the number of ‘layers’ along the c-axis

label_termination(slab: pymatgen.core.structure.Structure) → str[source]

Labels the slab surface termination