4. Energy models API

4.1. Classes

4.1.1. B3LYP class

class moldesign.models.B3LYP(*args, **kwargs)[source]

Bases: moldesign.models.pyscf.PySCFPotential

4.1.2. CASSCF class

class moldesign.models.CASSCF(*args, **kwargs)[source]

Bases: moldesign.models.pyscf.PySCFPotential

4.1.3. DFT class

class moldesign.models.DFT(*args, **kwargs)[source]

Bases: moldesign.models.pyscf.PySCFPotential

4.1.4. ForceField class

class moldesign.models.ForceField(**kwargs)[source]

Bases: moldesign.models.openmm.OpenMMPotential

4.1.5. GAFF class

class moldesign.models.GAFF(**kwargs)[source]

Bases: moldesign.models.models.ForceField

Model the energy using the GAFF forcefield

This is implemented as a special case of the ForceField energy model; it automates small parameterization process

PARAMETERS = [<Parameter "partial_charges", type: str>, <Parameter "gaff_version", type: str>, <Parameter "cutoff", type: float, units: nanometer>, <Parameter "nonbonded", type: str>, <Parameter "implicit_solvent", type: str>, <Parameter "solute_dielectric", type: float>, <Parameter "solvent_dielectric", type: float>, <Parameter "ewald_error", type: float>, <<class 'moldesign.parameters.Parameter'> at 10e26e790 - exc in __repr__>]
prep(force=False)[source]

4.1.6. HarmonicOscillator class

class moldesign.models.HarmonicOscillator(**params)[source]

Bases: moldesign.models.base.EnergyModelBase

Applies a harmonic potential (centered at 0) to the x-component of every atom

PARAMETERS = [<Parameter "k", type: float, units: eV / ang ** 2>]
calculate(requests)[source]

4.1.7. MP2 class

class moldesign.models.MP2(*args, **kwargs)[source]

Bases: moldesign.models.pyscf.PySCFPotential

4.1.8. OpenMMPotential class

class moldesign.models.OpenMMPotential(**kwargs)[source]

Bases: moldesign.models.base.MMBase, moldesign.interfaces.openmm.OpenMMPickleMixin

Creates an OpenMM “context” to drive energy calculations. Note that, while a dummy integrator is assigned, a different context will be created for any MD calculations.

Variables:sim – openmm simulation object
DEFAULT_PROPERTIES = ['potential_energy', 'forces']
calculate(self, requests=None, wait=True)[source]

Drive a calculation and, when finished, update the parent molecule with the results. TODO: this update is SYNCHRONOUS, unlike other calculate methods that run remotely. TODO: Probably need to update DummyJob (call it localjob, syncjob?) to handle this :param requests: list of quantities to calculate :return: PythonJob-like object

get_forcefield(self, wait=True)[source]

Get the force field parameters for this molecule.

Note

The returned object is for introspection only; it can’t be used (yet) to modify the energy model, and
it doesn’t include the entire force field (most notably missing are periodic replicate forces, 1-4 nonbonded attenuation, and implicit solvent effects)
Returns:moldesign.forcefield.ForceField
get_openmm_simulation()[source]
minimize(**kwargs)[source]
prep(force=False)[source]

Drive the construction of the openmm simulation This will rebuild this OpenMM simulation if: A) it’s not built yet, or B) there’s a new integrator

reset_constraints()[source]

4.1.9. PySCFPotential class

class moldesign.models.PySCFPotential(**kwargs)[source]

Bases: moldesign.models.base.QMBase

ALL_PROPERTIES = ['potential_energy', 'wfn', 'mulliken', 'eri_tensor', 'forces', 'nuclear_forces', 'electronic_forces']
DEFAULT_PROPERTIES = ['potential_energy', 'wfn', 'mulliken']
FORCE_UNITS = <Unit('hartree / bohr')>
PARAM_SUPPORT = {'theory': ['rhf', 'rks', 'mp2'], 'functional': ['b3lyp', 'blyp', 'pbe0', 'x3lyp', 'MPW3LYP5']}
calculate(self, requests=None, wait=True)[source]
prep(force=False)[source]
theoryname

4.1.10. RHF class

class moldesign.models.RHF(*args, **kwargs)[source]

Bases: moldesign.models.pyscf.PySCFPotential

4.1.11. Spring class

class moldesign.models.Spring(**params)[source]

Bases: moldesign.models.base.EnergyModelBase

Two atoms attached by a spring

ALL_PROPERTIES = ['potential_energy', 'force']
DEFAULT_PROPERTIES = ['potential_energy', 'force']
PARAMETERS = [<Parameter "k", type: float, units: eV / ang ** 2>, <Parameter "d0", type: float, units: ang>]
calculate(requests)[source]
prep()[source]