Bias Functions¶
- class erbs.bias.potential.ERBS(base_calc: Calculator, dim_reduction_factory: DimReduction, energy_fn_factory: OPESExploreFactory, feature_fn: callable | None = None, model_dir: Path | list[Path] | None = None, n_basis=5, r_max=6.0, dr_threshold=0.5, interval=10000, update_iterations=inf, **kwargs)[source]¶
- calculate(atoms=None, properties=['energy'], system_changes=['positions', 'numbers', 'cell', 'pbc', 'initial_charges', 'initial_magmoms'])[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', 'stress']¶
Properties calculator can handle (energy, forces, …)
- class erbs.bias.state.BiasState(std: float, compression_threshold: float, g: jax.Array | None = None, height: jax.Array | None = None, cov: jax.Array | None = None, normalisation: jax.Array | None = None)[source]¶
- replace(**updates)¶
Returns a new object replacing the specified fields with new values.