Calculators#
- class directupsampling.calculators.effqh.EffQHCalculator(reference_atoms: Atoms | list[Atoms] = None, fc_fit: ForceConstantFit = None, max_disp: float = 3.0)[source]#
Bases:
CalculatorQuasiharmonic ForceConstantCalculator.
Implemented as a wrapper around the hiphive ForceConstantCalculator. Uses a caching over volume for instantiated ForceConstantCalculators, which provides acceptable speed when the volume is constant over an MD run, which is the present typical use case. It is not suitable for e.g. NPT MD, where the volume changes at every step.
Parameters#
- ideal_atoms: atoms object whose positions represent the ideal structure
used as reference for displacements.
fc_fit: force constant-fit coefficients.
max_disp: Maximum displacement passed to hiphive ForceConstantCalculator.
- calculate(atoms=None, properties=['energy'], *args)[source]#
Do the calculation.
- properties: list of str
List of what needs to be calculated. Can be any combination of ‘energy’, ‘forces’, ‘stress’, ‘dipole’, ‘charges’, ‘magmom’ and ‘magmoms’.
- system_changes: list of str
List of what has changed since last calculation. Can be any combination of these six: ‘positions’, ‘numbers’, ‘cell’, ‘pbc’, ‘initial_charges’ and ‘initial_magmoms’.
Subclasses need to implement this, but can ignore properties and system_changes if they want. Calculated properties should be inserted into results dictionary like shown in this dummy example:
self.results = {'energy': 0.0, 'forces': np.zeros((len(atoms), 3)), 'stress': np.zeros(6), 'dipole': np.zeros(3), 'charges': np.zeros(len(atoms)), 'magmom': 0.0, 'magmoms': np.zeros(len(atoms))}
The subclass implementation should first call this implementation to set the atoms attribute and create any missing directories.
- implemented_properties: list[str] = ['energy', 'forces']#
Properties calculator can handle (energy, forces, …)