# 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: Optional[Dict] = None)

  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

  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:

      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

  as_dict()
    Returns

      MSONAble dict

  copy() → pymatgen.core.interface.Interface

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

    Returns

      A copy of the Interface.

  property film: pymatgen.core.structure.Structure

    A pymatgen Structure for just the film

  property film_indices: List[int]

    Site indices of the film sites

  property film_layers: int

    Number of layers of the minimum element in the film composition

  property film_sites: List[pymatgen.core.sites.Site]

    Return the film sites of the interface.

  property film_termination: str

    Label for the film termination chemistry

  classmethod from_dict(d)
    Parameters

      d – dict

    Returns

      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: Optional[Dict] = None, center_slab: bool = True) → pymatgen.core.interface.Interface

    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

  property gap: float

    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]]

    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) → pymatgen.core.structure.Structure

    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: numpy.ndarray

    The shift between the film and substrate in fractional coordinates

  property substrate: pymatgen.core.structure.Structure

    A pymatgen Structure for just the substrate

  property substrate_indicies: List[int]

    Site indicies for the substrate atoms

  property substrate_layers: int

    Number of layers of the minimum element in the substrate composition

  property substrate_sites: List[pymatgen.core.sites.Site]

    The site objects in the substrate

  property substrate_termination: str

    Label for the substrate termination chemistry

  property vacuum_over_film: float

    The vacuum space over the film in cartesian units

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

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

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

  Labels the slab surface termination