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]

Mean QML calculator

Attributes
qmmodelQMMol object

Reference QMMol object

methodstr

Options

‘gamma’ : Use QMLearn learning proccess to predict the desire property.
‘engine’ : Use PySCF engine to predict the desire property.
propertieslist:str

Options

‘energy’ : Energy
‘forces’ : Forces
‘dipole’ : Dipole
‘stress’ : Stress
‘gamma’ : 1-RDM

Methods

calc_with_engine(qmmol[, properties])

Function to calculate the desire properties using PySCF engine.

calc_with_gamma(qmmol[, properties])

Function to calculate the desire properties using QMLearn learning process.

calculate([atoms, properties, system_changes])

Function to calculate the desire properties.

calc_with_engine(qmmol, properties='energy')[source]

Function to calculate the desire properties using PySCF engine.

Parameters
propertieslist:str

Options

Energy : ‘energy’
Forces : ‘forces’
Dipole : ‘dipole’
Stress : ‘stress’
1-RDM : ‘gamma’
calc_with_gamma(qmmol, properties=['energy'])[source]

Function to calculate the desire properties using QMLearn learning process.

Parameters
propertieslist:str

Options

Energy : ‘energy’
Forces : ‘forces’
Dipole : ‘dipole’
Stress : ‘stress’
1-RDM : ‘gamma’
calculate(atoms=None, properties='energy', system_changes=['positions', 'numbers', 'cell', 'pbc', 'initial_charges', 'initial_magmoms'])[source]

Function to calculate the desire properties.

Parameters
propertieslist:str

Options

Energy : ‘energy’
Forces : ‘forces’
Dipole : ‘dipole’
Stress : ‘stress’
1-RDM : ‘gamma’

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

Parameters
pairsarray

Array of pairs of atoms index

coefsarray

Array of pair bond length weights

dtfloat

time steps in ASE Velocity Verlet integration

tolfloat

If difference between weighted sum of bondlengths and fixed bond length is less than tol calculation is stoped.

target: float

Fixed Bondlength value

maxiterint

maximum number of iteration

Attributes
dt

time steps in ASE Velocity Verlet integration

Methods

adjust_momenta(atoms, p)

Update momentum of atoms using velocity verlet algorithm

adjust_positions(atoms, new)

Keep adjusting atomic positions while keeping

get_jacobian(atoms, pos[, jacobian])

Calculate the Jacobian of positions of the paired atoms.

get_prims(atoms, pos)

Calculate weighted bond length of paired atoms

adjust_forces

copy

get_prims_vel

get_removed_dof

output

adjust_momenta(atoms, p)[source]

Update momentum of atoms using velocity verlet algorithm

adjust_positions(atoms, new)[source]
Keep adjusting atomic positions while keeping

weighted sum of fix bond length constant

Parameters
atomsASE atom object
newarray

positions of atoms which will change until converged

Raises
RuntimeError

If calculation is not converged within max number of iteration a RuntimeError will raised

property dt

time steps in ASE Velocity Verlet integration

get_jacobian(atoms, pos, jacobian=None)[source]

Calculate the Jacobian of positions of the paired atoms.

Returns
array

Jacobian of postion of paired atoms

get_prims(atoms, pos)[source]

Calculate weighted bond length of paired atoms

Parameters
atomsASE atoms object
posarray

positions of atoms

Returns
float

weighted sum of paired bond length

Module contents