-
class
MOPACEnergy
(mopac_path)¶ Bases:
stk.calculators.energy.energy_calculators.EnergyCalculator
Uses MOPAC to calculate energy.
Methods
add_to_cache
(self, mol[, value])Add a molecule to the cache.
energy
(self, mol[, conformer])Calculates the energy using MOPAC.
get_cached_value
(self, mol)Return the value stored in the cache for mol.
get_energy
(self, mol)Calculate the energy of mol.
is_caching
(self)True
if the calculator has caching turned on.is_in_cache
(self, mol)Return
True
if mol is cached.set_cache_use
(self, use_cache)Set cache use on or off.
-
__init__
(self, mopac_path)¶ Initialize self. See help(type(self)) for accurate signature.
-
add_to_cache
(self, mol, value=None)¶ Add a molecule to the cache.
- Parameters
mol (
Molecule
) – The molecule to be added to the cache.value (class:object, optional) – The cached value associated with the molecule.
- Returns
The calculator.
- Return type
- Raises
NotImplementedError – This is a virtual method and needs to be implemented in a subclass.
-
energy
(self, mol, conformer=-1)¶ Calculates the energy using MOPAC.
Note that this requires MOPAC to be installed and have a valid license.
- Parameters
settings (
dict
, optional) –A dictionary which maps the names of the optimization parameters to their values. Valid values are:
- ’hamiltonian’
str
(default ='PM7'
A series of different methods can be selected: PM7, PM6, AM1, CIS (CISD, CISDT), MNDO, RM1, etc..
PM7 is the latest version of the reparametrization of NDDO theory, where all the atomic and diatomic parameters were re-optimized / updated from PM6 1.
- ’eps’
float
(default =80.1
) Sets the dielectric constant for the solvent. Presence of this keyword will cause the COSMO (Conductor-like Screening Model) method to be used to approximate the effect of a solvent model surrounding the molecule. Solvents with a low dielectric constant are not likely to work well with this model.
0
means that the dielectric constant is not included in the calculation.80.1
can be used to model a water environment at room temperature.- ’charge’
float
(default =0
) The charge of the system.
- ’timeout’
float
(default =172800
) The amount in seconds the calculation is allowed to run before being terminated. The default value is
2
days or172,800
seconds.
- ’hamiltonian’
mopac_path (
str
) – The full path to the MOPAC installation.
- Returns
The calculated energy.
- Return type
float
References
-
get_cached_value
(self, mol)¶ Return the value stored in the cache for mol.
- Parameters
mol (
Molecule
) – The molecule whose cached value is to be returned.- Returns
The cached value.
- Return type
object
- Raises
NotImplementedError – This is a virtual method and needs to be implemented in a subclass.
-
get_energy
(self, mol)¶ Calculate the energy of mol.
-
is_caching
(self)¶ True
if the calculator has caching turned on.- Returns
True
if the calculator has caching turned on.- Return type
bool
- Raises
NotImplementedError – This is a virtual method and needs to be implemented in a subclass.
-
is_in_cache
(self, mol)¶ Return
True
if mol is cached.- Parameters
mol (
Molecule
) – The molecule being checked.- Returns
True
if mol is cached.- Return type
bool
- Raises
NotImplementedError – This is a virtual method and needs to be implemented in a subclass.
-
set_cache_use
(self, use_cache)¶ Set cache use on or off.
- Parameters
use_cache (
bool
) –True
if the cache is to be used.- Returns
The calculator.
- Return type
- Raises
NotImplementedError – This is a virtual method and needs to be implemented in a subclass.
-