matcalc._stability module
Calculator for stability related properties.
- class EnergeticsCalc(calculator: Calculator | str, *, elemental_refs: Literal['MatPES-PBE', 'MatPES-r2SCAN'] | dict = 'MatPES-PBE', use_dft_gs_reference: bool = False, relax_structure: bool = True, relax_calc_kwargs: dict | None = None)[source]
Bases:
PropCalc
Handles the computation of energetic properties such as formation energy per atom, cohesive energy per atom, and relaxed structures for input compositions. This class enables a streamlined setup for performing computational property calculations based on different reference data and relaxation configurations.
- Variables:
calculator – The computational calculator used for numerical simulations and property evaluations.
elemental_refs – Reference data dictionary or identifier for elemental properties. If a string (“MatPES-PBE” or “MatPES-r2SCAN”), loads default references; if a dictionary, uses custom provided data.
use_dft_gs_reference – Whether to use DFT ground state data for energy computations when referencing elemental properties.
relax_structure – Specifies whether to relax the input structures before property calculations. If True, relaxation is applied.
relax_calc_kwargs – Optional keyword arguments for fine-tuning relaxation calculation settings or parameters.
Initializes the class with the given calculator and optional configurations for elemental references, density functional theory (DFT) ground state reference, and options for structural relaxation.
This constructor allows initializing essential components of the object, tailored for specific computational settings. The parameters include configurations for elemental references, an optional DFT ground state reference, and structural relaxation preferences.
- 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.
elemental_refs (Literal["MatPES-PBE", "MatPES-r2SCAN"] | dict) – Specifies the elemental references to be used. It can either be a predefined string identifier (“MatPES-PBE”, “MatPES-r2SCAN”) or a dictionary mapping elements to their energy references.
use_dft_gs_reference (bool) – Determines whether to use DFT ground state energy as a reference. Defaults to False.
relax_structure (bool) – Specifies if the structure should be relaxed before proceeding with calculations. Defaults to True.
relax_calc_kwargs (dict | None) – Additional keyword arguments for the relaxation calculation. Can be a dictionary of settings or None. Defaults to None.
- calc(structure: Structure | dict[str, Any]) dict[str, Any] [source]
Calculates the formation energy per atom, cohesive energy per atom, and final relaxed structure for a given input structure using a relaxation calculation and reference elemental data. This function also optionally utilizes DFT ground-state references for formation energy calculations. The cohesive energy is always referenced to the DFT atomic energies.
- Parameters:
structure (Structure) – The input structure to be relaxed and analyzed.
- Returns:
A dictionary containing the formation energy per atom, cohesive energy per atom, and the final relaxed structure.
- Return type:
dict[str, Any]