matcalc._interface module
Interface structure/energy calculations.
- class InterfaceCalc(calculator: Calculator | str, *, interfacial_energy: bool = True, adhesion_energy: bool = False, relax_bulk: bool = True, relax_interface: bool = True, relax_slab: bool = True, fmax: float = 0.1, optimizer: str | Optimizer = 'BFGS', max_steps: int = 500, relax_calc_kwargs: dict | None = None)[source]
Bases:
PropCalcThis class generates all possible coherent interfaces between two bulk structures given their miller indices, relaxes them, and computes their interfacial and/or adhesion energies.
Initialize the instance of the class.
- Parameters:
calculator (Calculator | str) – An ASE calculator object used to perform energy and force calculations. If string is provided, the corresponding universal calculator is loaded.
interfacial_energy (bool, optional) – Whether to compute the interfacial energy. Defaults to True.
adhesion_energy (bool, optional) – Whether to compute the adhesion energy. Defaults to False.
relax_bulk (bool, optional) – Whether to relax the bulk structures before interface calculations. Defaults to True.
relax_interface (bool, optional) – Whether to relax the interface structures. Defaults to True.
relax_slab (bool, optional) – Whether to relax the atoms of the film and substrate slabs at fixed cell. Defaults to True. For fixed geometries, set relax_interface and relax_slab to False.
fmax (float, optional) – The maximum force tolerance for convergence. Defaults to 0.1.
optimizer (str | Optimizer, optional) – The optimization algorithm to use. Defaults to “BFGS”.
max_steps (int, optional) – The maximum number of optimization steps. Defaults to 500.
relax_calc_kwargs – Additional keyword arguments passed to the
RelaxCalcconstructor for the bulk, interface and slab relaxations. They override the settings above (e.g. relax_cell, fmax) for all of these relaxations. Default is None.
- Returns:
None
- _bulk_references(structure: dict[str, Any]) dict[str, Any][source]
Bulk energies per atom and structures of the film and substrate, precomputed or from calc_bulk.
- calc(structure: Structure | Atoms | dict[str, Any]) dict[str, Any][source]
Calculate the interfacial energy and/or the adhesion energy of the given interface structure.
The interface cell is assumed to contain one film/substrate contact, with the film and substrate slabs each exposing a free surface to the vacuum, as in the interfaces built by calc_interfaces (pymatgen CoherentInterfaceBuilder with a vacuum over the film). Let E_interface be the energy of the final interface, E_film_slab and E_substrate_slab the energies of the film and substrate slabs in the same cell, N_film and N_substrate their numbers of atoms, e_film and e_substrate the bulk energies per atom, and A = |a x b| of the input interface lattice. The interface is relaxed at fixed cell, so A is also the area of final_interface, to which all energies refer. In eV/Ų:
film_surface_energy = (E_film_slab - N_film * e_film) / (2 * A) substrate_surface_energy = (E_substrate_slab - N_substrate * e_substrate) / (2 * A) adhesion_energy = (E_film_slab + E_substrate_slab - E_interface) / A interfacial_energy = film_surface_energy + substrate_surface_energy - adhesion_energy
- = (E_interface - N_film * e_film - N_substrate * e_substrate) / A
film_surface_energy - substrate_surface_energy
The surface energies assume that both faces of each slab have the same surface energy. The adhesion energy (work of separation) is positive for a bound interface. The interfacial energy subtracts the two free surfaces of the vacuum cell; it previously was (E_interface - N_film * e_film - N_substrate * e_substrate) / (2 * A), i.e. (interfacial_energy + film_surface_energy + substrate_surface_energy) / 2 in the current notation.
The slabs are “film_slab” and “substrate_slab” if given, otherwise the film and substrate sites of the final interface in the same cell. They are computed once and shared by both energies. With relax_slab, their atoms are relaxed at fixed cell; otherwise, slabs cut from the interface give the rigid (ideal cleave) work of separation, and the surface energies are those of the unrelaxed slab faces.
- Parameters:
structure – A dictionary with the “interface” structure. For the interfacial energy, it also contains “film_energy_per_atom”, “substrate_energy_per_atom”, “final_film” and “final_substrate” (from calc_interfaces), or “film_bulk” and “substrate_bulk”. It may contain “film_slab” and “substrate_slab” with the film and substrate atoms in the interface cell; otherwise, the interface needs the “interface_label” site property of a pymatgen Interface.
- Returns:
“interface” (Structure): The initial interface structure.
”final_interface” (Structure): The relaxed interface structure.
”interface_energy_per_atom” (float): The final energy per atom of the interface (eV/atom).
”num_atoms” (int): The number of atoms in the interface structure.
”final_film_slab”, “final_substrate_slab” (Structure), “film_slab_energy” and “substrate_slab_energy” (float, eV), if interfacial_energy or adhesion_energy.
”interfacial_energy”, “film_surface_energy” and “substrate_surface_energy” (float, eV/Ų), and “film_energy_per_atom”, “substrate_energy_per_atom” (float, eV/atom), “final_film” and “final_substrate” (Structure), if interfacial_energy.
”adhesion_energy” (float, eV/Ų), if adhesion_energy.
”_units” (dict): The unit of each numeric output above.
- Return type:
dict
- calc_bulk(bulk: Structure | Atoms) dict[str, Any][source]
Relax a bulk structure if relax_bulk, and compute its energy.
- Parameters:
bulk (Structure | Atoms) – The bulk structure.
- Returns:
“bulk”, “bulk_energy” (eV), “bulk_energy_per_atom” (eV/atom) and “final_bulk”.
- Return type:
dict
- Raises:
RuntimeError – If the bulk relaxation does not converge (see
PropCalc._check_and_prelax).
- calc_interfaces(film_bulk: Structure, substrate_bulk: Structure, film_miller: tuple[int, int, int], substrate_miller: tuple[int, int, int], zslgen: ZSLGenerator | None = None, cib_kwargs: dict | None = None, **kwargs: Any) list[dict[str, Any]][source]
Calculate all possible coherent interfaces between two bulk structures.
The bulks are relaxed first (if relax_bulk), and the interfaces are built from the relaxed bulks, so that the substrate (and the film before its coherency strain) match the bulk reference energies.
- Parameters:
film_bulk (Structure) – The bulk structure of the film material.
substrate_bulk (Structure) – The bulk structure of the substrate material.
film_miller (tuple[int, int, int]) – The Miller index for the film surface, in the lattice of film_bulk.
substrate_miller (tuple[int, int, int]) – The Miller index for the substrate surface, in the lattice of substrate_bulk.
zslgen (ZSLGenerator | None, optional) – An instance of ZSLGenerator to use for generating supercells.
cib_kwargs (dict | None, optional) – Additional keyword arguments to pass to the CoherentInterfaceBuilder.
**kwargs (Any) – Additional keyword arguments passed to calc_many.
- Returns:
A list of dictionaries containing the calculated film, substrate, interface.
- Return type:
dict
- calc_slab(slab: Structure | Atoms) dict[str, Any][source]
Relax the atoms of a slab at fixed cell if relax_slab, and compute its energy.
- Parameters:
slab (Structure | Atoms) – The slab structure.
- Returns:
“slab”, “slab_energy” (eV), “slab_energy_per_atom” (eV/atom) and “final_slab”.
- Return type:
dict