qmlearn.api package
Submodules
qmlearn.api.api4ase module
- class qmlearn.api.api4ase.QMLCalculator(qmmodel=None, second_learn={}, method='gamma', label='QMLearn', atoms=None, directory='.', refqmmol=None, properties='energy', **kwargs)[source]
Methods
calculate
([atoms, properties, system_changes])Do the calculation.
calc_with_engine
calc_with_gamma
- 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.
qmlearn.api.constraints module
- class qmlearn.api.constraints.FixBondLComb(pairs=None, coefs=None, dt=None, tol=1e-06, target=None, maxiter=1000, scale=2.0)[source]
This is similar to ASE FixBondLengths, but with linear combination of bond lengths. sum_i(bond_length_i * coefs_i) = constant
- Attributes
- dt
Methods
adjust_forces
adjust_momenta
adjust_positions
copy
get_jacobian
get_prims
get_prims_vel
get_removed_dof
output