pymatgen.analysis.diffusion.utils.supercells module

Functions for creating supercells for NEB calculations.

get_sc_fromstruct(base_struct: Structure, min_atoms: int = 80, max_atoms: int = 240, min_length: float = 10.0) list[list[int]][source]

Generate the best supercell from a unitcell. The CubicSupercellTransformation from PMG is much faster but don’t iterate over as many supercell configurations so it’s less able to find the best configuration in a give cell size. We try the PMG’s cubic supercell transformation with a cap on the number of atoms (max_atoms). The min_length is decreased by 10% (geometrically) until a supercell can be constructed.

Parameters:
  • base_struct – structure of the unit cell

  • max_atoms – Maximum number of atoms allowed in the supercell.

  • min_atoms – Minimum number of atoms allowed in the supercell.

  • min_length – Minimum length of the smallest supercell lattice vector.

Returns:

Supercell that is as close to cubic as possible

Return type:

struc_sc

get_start_end_structures(isite: PeriodicSite, esite: PeriodicSite, base_struct: Structure, sc_mat: list[list[int | float]], vac_mode: bool, debug: bool = False, tol: float = 1e-05) tuple[Structure, Structure, Structure][source]

Obtain the starting and terminating structures in a supercell for NEB calculations.

Parameters:
  • isite – Initial site index.

  • esite – End site index.

  • hop – object presenting the migration event

  • base_struct – unit cell representation of the structure

  • sc_mat – supercell transformation to create the simulation cell for the NEB calc

  • vac_mode – Vacuum mode.

  • debug – debug mode.

  • tol – toleranace for identifying isite/esite within base_struct.

Returns:

initial structure, final structure, empty structure all in the supercell