matcalc._neb module
NEB calculations.
- class MEP(structures: list[Structure], energies: list[float])[source]
Bases:
objectMinimum Energy Path dataclass for NEB calculations.
Stores MEP results in a data-efficient format where labels are stored once, and only fractional coordinates and lattices vary between images.
Initialize MEP from structures and energies.
- Parameters:
structures – List of pymatgen Structures.
energies – List of energies for each image.
- as_dict() dict[str, Any][source]
Convert MEP to a data-efficient dictionary representation.
- Returns:
“labels”: List of species strings (stored once)
”lattice”: Lattice matrix as a 3x3 array (only if same for all images)
- ”images”: List of dictionaries, each containing:
”lattice”: Lattice matrix as a 3x3 array (only if different per image)
”frac_coords”: Fractional coordinates for the image
”energy”: Energy for the image
- Return type:
Dictionary with
- classmethod from_dict(d: dict[str, Any]) MEP[source]
Reconstruct MEP from a dictionary representation.
- Parameters:
d – Dictionary with keys “labels” and “images” as returned by as_dict(). May also contain “lattice” at top level if same for all images.
- Returns:
MEP instance reconstructed from the dictionary.
- get_lattices_list() list[ndarray][source]
Get lattices as a list, expanding a single lattice if needed.
- class NEBCalc(calculator: Calculator | str, *, optimizer: str | Optimizer = 'BFGS', traj_folder: str | None = None, interval: int = 1, climb: bool = True, fmax: float = 0.1, method: str = 'improvedtangent', max_steps: int = 1000, **kwargs: Any)[source]
Bases:
PropCalcNEB calculator.
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.
optimizer (str | Optimizer, optional) – The optimization algorithm to use. Defaults to “BFGS”.
traj_folder (str | None, optional) – The folder to save trajectory information. Defaults to None.
interval (int, optional) – The interval for recording trajectory information. Defaults to 1.
climb (bool, optional) – Whether to perform climbing image nudged elastic band (CI-NEB). Defaults to True.
fmax (float, optional) – The maximum force tolerance for convergence. Defaults to 0.1.
max_steps (int, optional) – The maximum number of optimization steps. Defaults to 1000.
**kwargs (Any) – Additional keyword arguments.
- Returns:
None
- calc(structure: Structure | Atoms | dict[str, Any]) dict[str, Any][source]
Calculate the energy barrier using the nudged elastic band method.
- Parameters:
structure (-) – A dictionary containing the images with keys ‘image0’, ‘image1’, etc. Must be of type dict.
- Returns:
“barrier” (float): The energy barrier of the reaction pathway.
”force” (float): The force exerted on the atoms during the NEB calculation.
”mep” (MEP): An MEP dataclass containing the images and their respective energies.
- Return type:
dict
- calc_images(start_struct: Structure, end_struct: Structure, *, n_images: int = 7, interpolate_lattices: bool = False, autosort_tol: float = 0.5) dict[str, Any][source]
Calculate NEB images between given start and end structures.
- Parameters:
start_struct (Structure) – Initial structure.
end_struct (Structure) – Final structure.
n_images (int) – Number of images to calculate (default is 7).
interpolate_lattices (bool) – Whether to interpolate lattices between start and end structures (default is False).
autosort_tol (float) – Tolerance for autosorting the images (default is 0.5).
- Returns:
NEB calculation object containing the interpolated images.
- Return type: