matcalc._relaxation module

Relaxation properties.

class RelaxCalc(calculator: Calculator | str, *, optimizer: Optimizer | str = 'FIRE', max_steps: int = 500, traj_file: str | None = None, interval: int = 1, fmax: float = 0.1, relax_atoms: bool = True, relax_cell: bool = True, cell_filter: Filter = <class 'ase.filters.FrechetCellFilter'>, cell_filter_kwargs: dict | None = None, perturb_distance: float | None = None, fix_symmetry: bool = False, fix_atoms: bool | list[int] = False, symprec: float = 0.001)[source]

Bases: PropCalc

A class to perform structural relaxation calculations using ASE (Atomic Simulation Environment).

This class facilitates structural relaxation by integrating with ASE tools for optimized geometry and/or cell parameters. It enables convergence on forces, stress, and total energy, offering customization for relaxation parameters and further enabling properties to be extracted from the relaxed structure.

calculator[source]

ASE calculator or universal model name.

optimizer[source]

ASE optimizer name or class.

max_steps[source]

Maximum optimization steps.

traj_file[source]

Optional ASE trajectory path.

interval[source]

Trajectory write interval (steps).

fmax[source]

Force convergence threshold (eV/Å).

relax_atoms[source]

Relax atomic positions.

relax_cell[source]

Relax unit cell (via cell_filter).

cell_filter[source]

Cell filter class when relax_cell is True.

cell_filter_kwargs[source]

Kwargs for cell_filter.

perturb_distance[source]

Random displacement before relax, or None.

fix_symmetry[source]

Apply FixSymmetry when True.

fix_atoms[source]

Fix all atoms, or list of indices to fix.

symprec[source]

Symmetry tolerance for FixSymmetry.

Parameters:
  • calculator – ASE calculator or universal model name string.

  • optimizer – ASE optimizer name or class.

  • max_steps – Maximum relaxation steps.

  • traj_file – Optional trajectory output path.

  • interval – Steps between trajectory writes.

  • fmax – Force convergence criterion (eV/Å).

  • relax_atoms – Relax atomic positions.

  • relax_cell – Relax cell with cell_filter.

  • cell_filter – Cell filter class (default FrechetCellFilter).

  • cell_filter_kwargs – Kwargs for the cell filter.

  • perturb_distance – Random displacement (Å) before relax, or None.

  • fix_symmetry – Constrain symmetry when True.

  • fix_atoms – Fix all atoms if True, or indices to fix.

  • symprec – Symmetry precision for FixSymmetry.

_abc_impl = <_abc._abc_data object>[source]
calc(structure: Structure | Atoms | dict[str, Any]) dict[source]
Parameters:

structure – Pymatgen structure, ASE atoms, or dict with structure keys.

Returns:

Dict with final_structure, energy, forces, stress, and lattice parameters a, b, c, angles, and volume.