17.1.1.2. pysisyphus.calculators package
17.1.1.2.1. Submodules
17.1.1.2.2. pysisyphus.calculators.AFIR module
- class pysisyphus.calculators.AFIR.AFIR(calculator, fragment_indices, gamma, rho=1, p=6, ignore_hydrogen=False, zero_hydrogen=True, complete_fragments=True, dump=True, h5_fn='afir.h5', h5_group_name='afir', **kwargs)[source]
Bases:
Calculator
- __init__(calculator, fragment_indices, gamma, rho=1, p=6, ignore_hydrogen=False, zero_hydrogen=True, complete_fragments=True, dump=True, h5_fn='afir.h5', h5_group_name='afir', **kwargs)[source]
Artifical Force Induced Reaction calculator.
Currently, there are no automated drivers to run large-scale AFIR calculations with many different initial orientations and/or increasing collision energy parameter γ. Nontheless, selected AFIR calculations can be carried out by hand. After convergence, artificial potential & forces, as well as real energies and forces can be plotted with 'pysisplot --afir'. The highest energy point along the AFIR path can then be selected for a subsequent TS-optimization, e.g. via 'pysistrj --get [index] optimzation.trj'.
Future versions of pysisyphus may provide drivers for more automatted AFIR calculations.
- Parameters:
calculator (
Calculator
) -- Actual QC calculator that provides energies and its derivatives, that are modified by the AFIR calculator, e.g., ORCA or Psi4.fragment_indices (
List
[List
[int
]]) -- List of lists of integers, specifying the separate fragments. If the indices in theses lists don't comprise all atoms in the molecule, the reamining indices will be added as a separate fragment. If a AFIR calculation is carried out with 2 fragments and 'complete_fragments' is True (see below) it is enough to specify only the indices of one fragment, e.g., for a system of 10 atoms 'fragment_indices=[[0,1,2,3]]' is enough. The second system will be set up automatically with indices [4,5,6,7,8,9].gamma (
Union
[_SupportsArray
[dtype
[Any
]],_NestedSequence
[_SupportsArray
[dtype
[Any
]]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]]]) -- Collision energy parameter γ in au. For 2 fragments it can be a single integer, while for > 2 fragments a list of gammas must be given, specifying the pair-wise collision energy parameters. For 3 fragments 3 gammas must be given [γ_01, γ_02, γ_12], for 4 fragments 6 gammas would be required [γ_01, γ_02, γ_03, γ_12, γ_13, γ_23] and so on.rho (
Union
[_SupportsArray
[dtype
[Any
]],_NestedSequence
[_SupportsArray
[dtype
[Any
]]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]]], default:1
) -- Direction of the artificial force, either 1 or -1. The same comments as for gamma apply. For 2 fragments a single integer is enough, for > 2 fragments a list of rhos must be given (see above). For rho=1 fragments are pushed together, for rho=-1 fragments are pulled apart.p (
int
, default:6
) -- Exponent p used in the calculation of the weight function ω. Defaults to 6 and probably does not have to be changed.ignore_hydrogen (
bool
, default:False
) -- Whether hydrogens are ignored in the calculation of the artificial force. All weights between atom pairs containing hydrogen will be set to 0.zero_hydrogen (
bool
, default:True
) -- Whether to use 0.0 as covalent radius for hydrogen in the weight function. Compared to 'ignore_hydrogen', which results in zero weights for all atom pairs involving hydrogen, 'zero_hydrogen' may be non-zero, depending on the covalent radius of the second atom in the pair.complete_fragments (
bool
, default:True
) -- Whether an incomplete specification in 'fragment_indices' is automatically completed.dump (
bool
, default:True
) -- Whether an HDF5 file is created.h5_fn (
str
, default:'afir.h5'
) -- Filename of the HDF5 file used for dumping.h5_group_name (
str
, default:'afir'
) -- HDF5 group name used for dumping.**kwargs -- Keyword arguments passed to the Calculator baseclass.
- property charge
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- property mult
- set_atoms_and_funcs(atoms, coords)[source]
Initially atoms was also an argument to the constructor of AFIR. I removed it so creation becomes easier. The first time a calculation is requested with a proper atom set everything is set up (cov. radii, afir function and corresponding gradient). Afterwards there is only a check if atoms != None and it is expected that all functions are properly set.
fragment_indices can also be incomplete w.r.t. to the number of atoms. If the sum of the specified fragment atoms is less than the number of atoms present then all remaining unspecified atoms will be gathered in one fragment.
17.1.1.2.3. pysisyphus.calculators.AnaPot module
- class pysisyphus.calculators.AnaPot.AnaPot(**kwargs)[source]
Bases:
AnaPotBase
17.1.1.2.4. pysisyphus.calculators.AnaPot2 module
- class pysisyphus.calculators.AnaPot2.AnaPot2[source]
Bases:
AnaPotBase
We can't use sympify as it replaces 1/tan by cot and this isn't supported by numpy when we call lambdify.
- class pysisyphus.calculators.AnaPot2.AnaPot2_[source]
Bases:
Calculator
17.1.1.2.5. pysisyphus.calculators.AnaPot3 module
- class pysisyphus.calculators.AnaPot3.AnaPot3[source]
Bases:
AnaPotBase
17.1.1.2.6. pysisyphus.calculators.AnaPot4 module
- class pysisyphus.calculators.AnaPot4.AnaPot4[source]
Bases:
AnaPotBase
17.1.1.2.7. pysisyphus.calculators.AnaPotBase module
- class pysisyphus.calculators.AnaPotBase.AnaPotBase(V_str, scale=1.0, xlim=(-1, 1), ylim=(-1, 1), levels=None, use_sympify=True, minima=None, saddles=None)[source]
Bases:
Calculator
- get_hessian(atoms, coords)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
17.1.1.2.8. pysisyphus.calculators.AnaPotCBM module
- class pysisyphus.calculators.AnaPotCBM.AnaPotCBM[source]
Bases:
AnaPotBase
17.1.1.2.9. pysisyphus.calculators.AtomAtomTransTorque module
17.1.1.2.10. pysisyphus.calculators.Calculator module
- class pysisyphus.calculators.Calculator.Calculator(calc_number=0, charge=0, mult=1, base_name='calculator', pal=1, mem=1000, keep_kind='all', check_mem=True, retry_calc=0, last_calc_cycle=None, clean_after=True, out_dir='qm_calcs', force_num_hess=False, num_hess_kwargs=None)[source]
Bases:
object
- __init__(calc_number=0, charge=0, mult=1, base_name='calculator', pal=1, mem=1000, keep_kind='all', check_mem=True, retry_calc=0, last_calc_cycle=None, clean_after=True, out_dir='qm_calcs', force_num_hess=False, num_hess_kwargs=None)[source]
Base-class of all calculators.
Meant to be extended.
- Parameters:
calc_number (int, default=0) -- Identifier of the Calculator. Used in distinguishing it from other Calculators, e.g. in ChainOfStates calculations. Also used in the creation of filenames.
charge (int, default=0) -- Molecular charge.
mult (int, default=1) -- Molecular multiplicity (1 = singlet, 2 = doublet, ...)
base_name (str, default=calculator) -- Generated filenames will start with this string.
pal (int, default=1) -- Positive integer that gives the number of physical cores to use on 1 node.
mem (int, default=1000) -- Mememory per core in MB. The total amount of memory is given as mem*pal.
check_mem (bool, default=True) -- Whether to adjust the requested memory if too much is requested.
retry_calc (int, default=0) -- Number of additional retries when calculation failed.
last_calc_cycle (int) -- Internal variable used in restarts.
clean_after (bool) -- Delete temporary directory were calculations were executed after a calculation.
out_dir (str) -- Path that is prepended to generated filenames.
force_hess_kwargs (bool, default False) -- Force numerical Hessians.
num_hess_kwargs (dict) -- Keyword arguments for finite difference Hessian calculation.
- clean(path)[source]
Delete the temporary directory.
- Parameters:
path (Path) -- Directory to delete.
- conf_key = None
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- get_restart_info()[source]
Return a dict containing chkfiles.
- Returns:
restart_info -- Dictionary holding the calculator state. Used for restoring calculaters in restarted calculations.
- Return type:
dict
- keep(path)[source]
Backup calculation results.
- Parameters:
path (Path) -- Temporary directory of the calculation.
- Returns:
kept_fns -- Dictonary holding the filenames that were backed up. The keys correspond to the type of file.
- Return type:
dict
- log(message='')[source]
Write a log message.
Wraps the logger variable.
- Parameters:
message (str) -- Message to be logged.
- make_fn(name, counter=None, return_str=False)[source]
Make a full filename.
Return a full filename including the calculator name and the current counter given a suffix.
- Parameters:
name (str) -- Suffix of the filename.
counter (int, optional) -- If not given use the current calc_counter.
return_str (int, optional) -- Return a string instead of a Path when True.
- Returns:
fn -- Filename.
- Return type:
str
- property name
- prepare(inp)[source]
Prepare a temporary directory and write input.
Similar to prepare_path, but the input is also written into the prepared directory.
17.1.1.2. Paramters
- inpstr
Input to be written into the file
self.inp_fn
in the prepared directory.
- returns:
- path: Path
Prepared directory.
- prepare_coords(atoms, coords)[source]
Get 3d coords in Angstrom.
Reshape internal 1d coords to 3d and convert to Angstrom.
- Parameters:
atoms (iterable) -- Atom descriptors (element symbols).
coords (np.array, 1d) -- 1D-array holding coordinates in Bohr.
- Returns:
coords -- 3D-array holding coordinates in Angstrom.
- Return type:
np.array, 3d
- prepare_path(use_in_run=False)[source]
Get a temporary directory handle.
Create a temporary directory that can later be used in a calculation.
- Parameters:
use_in_run (bool, option) -- Sets the internal variable
self.path_already_prepared
that is later read byself.run()
. No new temporary directory will be created inself.run()
.- Returns:
- path: Path
Prepared directory.
- prepare_pattern(raw_pat)[source]
Prepare globs.
Transforms an entry of
self.to_keep
into a glob and a key suitable for the use inself.keep()
.- Parameters:
raw_pat (str) -- Entry of
self.to_keep
- Returns:
pattern (str) -- Glob that can be used in Path.glob()
multi (bool) -- Flag if glob may match multiple files.
key (str) -- A key to be used in the
kept_fns
dict.
- prepare_turbo_coords(atoms, coords)[source]
Get a Turbomole coords string.
- Parameters:
atoms (iterable) -- Atom descriptors (element symbols).
coords (np.array, 1d) -- 1D-array holding coordinates in Bohr.
- Returns:
coords -- String holding coordinates in Turbomole coords format.
- Return type:
str
- prepare_xyz_string(atoms, coords)[source]
Returns a xyz string in Angstrom.
- Parameters:
atoms (iterable) -- Atom descriptors (element symbols).
coords (np.array, 1d) -- 1D-array holding coordinates in Bohr.
- Returns:
xyz_str -- Coordinates in .xyz format.
- Return type:
string
- print_out_fn(path)[source]
Print calculation output.
Prints the output of a calculator after a calculation.
- Parameters:
path (Path) -- Temporary directory of the calculation.
- restore_org_hessian()[source]
Restore original 'get_hessian' method, which may also fallback to numerical Hessians, if not implemented.
- run(inp, calc, add_args=None, env=None, shell=False, hold=False, keep=True, cmd=None, inc_counter=True, run_after=True, parser_kwargs=None, symlink=True)[source]
Run a calculation.
The bread-and-butter method to actually run an external quantum chemistry code.
- Parameters:
inp (str) -- Input for the external program that is written to the temp-dir.
calc (str, hashable) -- Key (and more or less type of calculation) to select the right parsing function from
self.parser_funcs
.add_args (iterable, optional) -- Additional arguments that will be appended to the program call.
env (Environment, optional) -- A potentially modified environment for the subprocess call.
shell (bool, optional) -- Use a shell to execute the program call. Need for Turbomole were we chain program calls like dscf; escf.
hold (bool, optional) -- Wether to remove the temporary directory after the calculation.
keep (bool, optional) -- Wether to backup files as specified in
self.to_keep()
. Usually you want this.cmd (str or iterable, optional) -- Overwrites
self.base_cmd
.inc_counter (bool, optional) -- Wether to increment the counter after a calculation.
- Returns:
results -- Dictionary holding all applicable results of the calculations like the energy, a forces vector and/or excited state energies from TDDFT.
- Return type:
dict
- run_after(path)[source]
Meant to be extended.
This method is called after a calculation was done, but before entering
self.keep()
andself.clean()
. Can be used to call tools like formchk or ricctools.
- set_restart_info(restart_info)[source]
Sets restart information (chkfiles etc.) on the calculator.
- Parameters:
restart_info (dict) -- Dictionary holding the calculator state. Used for restoring calculaters in restarted calculations.
- verify_chkfiles(chkfiles)[source]
Checks if given chkfiles exist and return them as Paths
- Parameters:
chkfiles (dict) -- Dictionary holding the chkfiles. The keys correspond to the attribute names, the values are strs holding the (potentially full) filename (path).
- Returns:
paths -- Dictionary of Paths.
- Return type:
dict
- class pysisyphus.calculators.Calculator.HessKind(value)
Bases:
Enum
An enumeration.
- NUMERICAL = 2
- ORG = 1
17.1.1.2.11. pysisyphus.calculators.CerjanMiller module
- class pysisyphus.calculators.CerjanMiller.CerjanMiller(a=1, b=1, c=1)[source]
Bases:
AnaPotBase
17.1.1.2.12. pysisyphus.calculators.Composite module
- class pysisyphus.calculators.Composite.Composite(final, keys_calcs=None, calcs=None, remove_translation=False, **kwargs)[source]
Bases:
Calculator
17.1.1.2.13. pysisyphus.calculators.ConicalIntersection module
- class pysisyphus.calculators.ConicalIntersection.CIQuantities(energy1, gradient1, energy2, gradient2, energy_diff, gradient_diff, gradient_mean, P, x, y, energy, forces)[source]
Bases:
object
-
P:
ndarray
-
energy:
float
-
energy1:
float
-
energy2:
float
-
energy_diff:
float
-
forces:
ndarray
-
gradient1:
ndarray
-
gradient2:
ndarray
-
gradient_diff:
ndarray
-
gradient_mean:
ndarray
-
x:
ndarray
-
y:
ndarray
-
P:
- class pysisyphus.calculators.ConicalIntersection.ConicalIntersection(calculator1, calculator2, **kwargs)[source]
Bases:
Calculator
Calculator for conical intersection optimization.
Based on [1].
17.1.1.2.14. pysisyphus.calculators.DFTBp module
- class pysisyphus.calculators.DFTBp.DFTBp(parameter, *args, slakos=None, root=None, **kwargs)[source]
Bases:
OverlapCalculator
- conf_key = 'dftbp'
- hubbard_derivs = {'3ob': {'Br': -0.0573, 'C': -0.1492, 'Ca': -0.034, 'Cl': -0.0697, 'F': -0.1623, 'H': -0.1857, 'I': -0.0433, 'K': -0.0339, 'Mg': -0.02, 'N': -0.1535, 'Na': -0.0454, 'O': -0.1575, 'P': -0.14, 'S': -0.11, 'Zn': -0.03}}
- max_ang_moms = {'3ob': {'Br': 'd', 'C': 'p', 'Ca': 'p', 'Cl': 'd', 'F': 'p', 'H': 's', 'I': 'd', 'K': 'p', 'Mg': 'p', 'N': 'p', 'Na': 'p', 'O': 'p', 'P': 'd', 'S': 'd', 'Zn': 'd'}, 'mio-ext': {'C': 'p', 'H': 's', 'N': 'p', 'O': 'p'}}
17.1.1.2.15. pysisyphus.calculators.Dalton module
- class pysisyphus.calculators.Dalton.Dalton(basis, method='hf', **kwargs)[source]
Bases:
Calculator
- conf_key = 'dalton'
17.1.1.2.16. pysisyphus.calculators.Dimer module
- class pysisyphus.calculators.Dimer.Dimer(calculator, *args, N_raw=None, length=0.0189, rotation_max_cycles=15, rotation_method='fourier', rotation_thresh=0.0001, rotation_tol=1, rotation_max_element=0.001, rotation_interpolate=True, rotation_disable=False, rotation_disable_pos_curv=True, rotation_remove_trans=True, trans_force_f_perp=True, bonds=None, N_hessian=None, bias_rotation=False, bias_translation=False, bias_gaussian_dot=0.1, seed=None, write_orientations=True, forward_hessian=True, **kwargs)[source]
Bases:
Calculator
- property C
Shortcut for the curvature.
- property N
- property can_bias_f0
- property can_bias_f1
- property coords0
- property coords1
- property energy0
- property f0
- property f1
- property f1_bias
- property f2
Never calculated explicitly, but estimated from f0 and f1.
- get_hessian(atoms, coords)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- property rot_force
- property should_bias_f0
May lead to calculation of f0 and/or f1 if present!
- property should_bias_f1
May lead to calculation of f0 and/or f1 if present!
17.1.1.2.17. pysisyphus.calculators.Dummy module
- class pysisyphus.calculators.Dummy.Dummy(calc_number=0, charge=0, mult=1, base_name='calculator', pal=1, mem=1000, keep_kind='all', check_mem=True, retry_calc=0, last_calc_cycle=None, clean_after=True, out_dir='qm_calcs', force_num_hess=False, num_hess_kwargs=None)[source]
Bases:
Calculator
17.1.1.2.18. pysisyphus.calculators.EGO module
- class pysisyphus.calculators.EGO.EGO(calculator, ref_geom, max_force=0.175, **kwargs)[source]
Bases:
Calculator
- property ref_hessian
- property s
17.1.1.2.19. pysisyphus.calculators.EnergyMin module
- class pysisyphus.calculators.EnergyMin.EnergyMin(calculator1, calculator2, mix=False, alpha=0.02, sigma=3.5, min_energy_diff=0.0, check_after=0, **kwargs)[source]
Bases:
Calculator
- __init__(calculator1, calculator2, mix=False, alpha=0.02, sigma=3.5, min_energy_diff=0.0, check_after=0, **kwargs)[source]
Use energy and derivatives of the calculator with lower energy.
This calculators carries out two calculations with different settings and returns the results of the lower energy one. This can be used to consider flips between a singlet and a triplet PES etc.
- Parameters:
calculator1 (
Calculator
) -- Wrapped QC calculator that provides energies and its derivatives.calculator2 (
Calculator
) -- Wrapped QC calculator that provides energies and its derivatives.mix (
bool
, default:False
) -- Enable mixing of both forces, according to the approach outlined in [2]. Can be used to optimize guesses for MECPs. Passalpha (
float
, default:0.02
) -- Smoothing parameter in Hartree. See [2] for a discussion.sigma (
float
, default:3.5
) -- Unitless gap size parameter. The final gap becomes smaller for bigga sigmas. Has to be adapted for each case. See [2] for a discussion (p. 407 right column and p. 408 left column.)min_energy_diff (
float
, default:0.0
) -- Energy difference in Hartree. When set to a value != 0 and the energy difference between both calculators drops below this value, execution of both calculations is diabled for 'check_after' cycles. In these cycles the calculator choice remains fixed. After 'check_after' cycles, both energies will be calculated and it is checked, if the previous calculator choice remains valid. In conjunction with 'check_after' both arguments can be used to save computational ressources.check_after (
int
, default:0
) -- Amount of cycles in which the calculator choice remains fixed.**kwargs -- Keyword arguments passed to the Calculator baseclass.
17.1.1.2.20. pysisyphus.calculators.ExternalPotential module
- class pysisyphus.calculators.ExternalPotential.ExternalPotential(calculator=None, potentials=None, geom=None, **kwargs)[source]
Bases:
Calculator
- available_potentials = {'d3': <class 'pysisyphus.calculators.DFTD3.DFTD3'>, 'harmonic_sphere': <class 'pysisyphus.calculators.ExternalPotential.HarmonicSphere'>, 'logfermi': <class 'pysisyphus.calculators.ExternalPotential.LogFermi'>, 'restraint': <class 'pysisyphus.calculators.ExternalPotential.Restraint'>, 'rmsd': <class 'pysisyphus.calculators.ExternalPotential.RMSD'>}
- class pysisyphus.calculators.ExternalPotential.HarmonicSphere(k, radius, origin=(0.0, 0.0, 0.0), geom=None)[source]
Bases:
object
- property surface_area
In Bohr**2
- class pysisyphus.calculators.ExternalPotential.LogFermi(beta, radius, T=300, origin=(0.0, 0.0, 0.0), geom=None)[source]
Bases:
object
- __init__(beta, radius, T=300, origin=(0.0, 0.0, 0.0), geom=None)[source]
As described in the XTB docs.
https://xtb-docs.readthedocs.io/en/latest/xcontrol.html#confining-in-a-cavity
- class pysisyphus.calculators.ExternalPotential.RMSD(geom, k, beta=0.5, atom_indices=None)[source]
Bases:
object
- __init__(geom, k, beta=0.5, atom_indices=None)[source]
Restrain based on RMSD with a reference geometry.
As described in https://doi.org/10.1021/acs.jctc.0c01306, Eq. (5).
- Parameters:
geom (
Geometry
) -- Reference geometry for RMSD calculation.k (
float
) -- Gaussian height in units of energy. Should be a negative number if the system under study should stay close to the reference geometry (pulling k). A positive Gaussian height k results in forces that push the system under study away from the reference geometry (pushing k).b -- Gaussian width in inverse units of lengths.
atom_indices (
Union
[_SupportsArray
[dtype
[Any
]],_NestedSequence
[_SupportsArray
[dtype
[Any
]]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]],None
], default:None
) -- Optional, numpy array or iterable of integer atom indices. Restricts the RMSD calculation to these atoms. If omitted, all atoms are used.
17.1.1.2.21. pysisyphus.calculators.FakeASE module
17.1.1.2.22. pysisyphus.calculators.FourWellAnaPot module
- class pysisyphus.calculators.FourWellAnaPot.FourWellAnaPot[source]
Bases:
AnaPotBase
17.1.1.2.23. pysisyphus.calculators.FreeEndNEBPot module
- class pysisyphus.calculators.FreeEndNEBPot.FreeEndNEBPot[source]
Bases:
AnaPotBase
17.1.1.2.24. pysisyphus.calculators.Gaussian09 module
- class pysisyphus.calculators.Gaussian09.Gaussian09(*args, **kwargs)[source]
Bases:
Gaussian16
- conf_key = 'gaussian09'
17.1.1.2.25. pysisyphus.calculators.Gaussian16 module
- class pysisyphus.calculators.Gaussian16.Gaussian16(route, gbs='', gen='', keep_chk=False, stable='', fchk=None, **kwargs)[source]
Bases:
OverlapCalculator
- conf_key = 'gaussian16'
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- parse_log(*args, **kwargs)
- prepare_input(atoms, coords, calc_type, did_stable=False, point_charges=None)[source]
Meant to be extended.
- prepare_overlap_data(path)[source]
This method has to implement the calculator specific parsing of MO-coefficients, CI-coefficients and energies. Should return a filename pointing to TURBOMOLE like mos, a MO coefficient array and a CI coefficient array.
17.1.1.2.26. pysisyphus.calculators.HardSphere module
- class pysisyphus.calculators.HardSphere.HardSphere(geom, frags, kappa=1.0, permutations=False, frag_radii=None, radii_offset=0.9452)[source]
Bases:
object
- class pysisyphus.calculators.HardSphere.PWHardSphere(geom, frags, sub_frags, kappa=1.0)[source]
Bases:
object
17.1.1.2.27. pysisyphus.calculators.IDPPCalculator module
- class pysisyphus.calculators.IDPPCalculator.IDPPCalculator(target)[source]
Bases:
Calculator
17.1.1.2.28. pysisyphus.calculators.IPIClient module
17.1.1.2.29. pysisyphus.calculators.IPIServer module
- class pysisyphus.calculators.IPIServer.IPIServer(*args, address=None, host=None, port=None, unlink=True, hdrlen=12, max_retries=0, verbose=False, **kwargs)[source]
Bases:
Calculator
- get_hessian(atoms, coords)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- listen_kinds = ('coords', 'energy', 'forces', 'hessian')
17.1.1.2.30. pysisyphus.calculators.LEPSBase module
- class pysisyphus.calculators.LEPSBase.LEPSBase(pot_type='leps')[source]
Bases:
AnaPotBase
17.1.1.2.31. pysisyphus.calculators.LEPSExpr module
- class pysisyphus.calculators.LEPSExpr.LEPSExpr[source]
Bases:
object
- V_LEPS(x=None, y=None, abc=None)[source]
Equation (A.1) in [1]. Mimics reaction involving three atoms confined to motion along a line.
- V_dimer()[source]
III. Results Section A in [3]. Two additional saddle points from two added gaussians.
17.1.1.2.32. pysisyphus.calculators.LennardJones module
17.1.1.2.33. pysisyphus.calculators.MOPAC module
- class pysisyphus.calculators.MOPAC.MOPAC(method='PM7', **kwargs)[source]
Bases:
Calculator
- CALC_TYPES = {'energy': '1SCF', 'gradient': '1SCF GRADIENTS', 'hessian': 'DFORCE FORCE LET'}
- METHODS = ['am1', 'pm3', 'pm6', 'pm6-dh2', 'pm6-d3', 'pm6-dh+', 'pm6-dh2', 'pm6-dh2x', 'pm6-d3h4', 'pm6-d3h4x', 'pm7', 'pm7-ts']
- MULT_STRS = {1: 'SINGLET', 2: 'DOUBLET', 3: 'TRIPLET', 4: 'QUARTET', 5: 'QUINTET', 6: 'SEXTET', 7: 'SEPTET', 8: 'OCTET'}
- base_cmd
Do only SCF AUX: Creates a checkpoint file NOREO: Dont reorient geometry
- Type:
1SCF
- conf_key = 'mopac'
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- static parse_energy_from_aux(inp, *args, **kwargs)
- static parse_hessian_from_aux(inp, *args, **kwargs)
- prepare_coords(atoms, coords, opt=False)[source]
Get 3d coords in Angstrom.
Reshape internal 1d coords to 3d and convert to Angstrom.
- Parameters:
atoms (iterable) -- Atom descriptors (element symbols).
coords (np.array, 1d) -- 1D-array holding coordinates in Bohr.
- Returns:
coords -- 3D-array holding coordinates in Angstrom.
- Return type:
np.array, 3d
17.1.1.2.34. pysisyphus.calculators.MullerBrownSympyPot module
- class pysisyphus.calculators.MullerBrownSympyPot.MullerBrownPot[source]
Bases:
AnaPotBase
17.1.1.2.35. pysisyphus.calculators.MultiCalc module
- class pysisyphus.calculators.MultiCalc.MultiCalc(calcs, **kwargs)[source]
Bases:
Calculator
17.1.1.2.36. pysisyphus.calculators.OBabel module
- class pysisyphus.calculators.OBabel.OBabel(ff='gaff', mol=None, **kwargs)[source]
Bases:
Calculator
- conv_dict = {'kcal/mol': 627.5094740630558, 'kj/mol': 2625.4996394798254}
17.1.1.2.37. pysisyphus.calculators.ONIOMv2 module
- class pysisyphus.calculators.ONIOMv2.LayerCalc(models, total_size, parent_layer_calc=None)[source]
Bases:
object
- property charge
- property mult
- class pysisyphus.calculators.ONIOMv2.Link(ind, parent_ind, atom, g)
Bases:
tuple
- atom
Alias for field number 2
- g
Alias for field number 3
- ind
Alias for field number 0
- parent_ind
Alias for field number 1
- class pysisyphus.calculators.ONIOMv2.Model(name, calc_level, calc, parent_name, parent_calc_level, parent_calc, atom_inds, parent_atom_inds, use_link_atoms=True)[source]
Bases:
object
- class pysisyphus.calculators.ONIOMv2.ONIOM(calcs, models, geom, layers=None, embedding='', real_key='real', use_link_atoms=True, *args, **kwargs)[source]
Bases:
Calculator
- __init__(calcs, models, geom, layers=None, embedding='', real_key='real', use_link_atoms=True, *args, **kwargs)[source]
- layer: list of models
len(layer) == 1: normal ONIOM, len(layer) >= 1: multicenter ONIOM.
- model:
(sub)set of all atoms that resides in a certain layer and has a certain calculator.
- atom_inds_in_layer(index, exclude_inner=False)[source]
Returns list of atom indices in layer at index.
Atoms that also appear in inner layer can be excluded on request.
- Parameters:
index (int) -- pasd
exclude_inner (bool, default=False, optional) -- Whether to exclude atom indices that also appear in inner layers.
- Returns:
atom_indices -- List containing the atom indices in the selected layer.
- Return type:
list
- property charge
- embeddings = {'': '', 'electronic': 'Electronic embedding', 'electronic_rc': 'Electronic embedding with redistributed charges', 'electronic_rcd': 'Electronic embedding with redistributed charges and dipoles'}
- get_hessian(atoms, coords)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- property model_iter
- property mult
- pysisyphus.calculators.ONIOMv2.cap_fragment(atoms, coords, fragment, link_atom='H', g=None)[source]
17.1.1.2.38. pysisyphus.calculators.ORCA module
- class pysisyphus.calculators.ORCA.ORCA(keywords, blocks='', gbw=None, do_stable=False, numfreq=False, json_dump=True, **kwargs)[source]
Bases:
OverlapCalculator
- __init__(keywords, blocks='', gbw=None, do_stable=False, numfreq=False, json_dump=True, **kwargs)[source]
ORCA calculator.
Wrapper for creating ORCA input files for energy, gradient and Hessian calculations. The PAL and memory inputs must not be given in the keywords and/or blocks, as they are handled by the 'pal' and 'memory' arguments.
- Parameters:
keywords (str) -- Keyword line, as normally given in ORCA, excluding the leading "!".
blocks (str, optional) -- ORCA block input(s), e.g. for TD-DFT calculations (%tddft ... end). As the blocks start with a leading "%", wrapping the input in quotes ("") is required, otherwise the parsing will fail.
gbw (str, optional) -- Path to an input gbw file, which will be used as initial guess for the first calculation. Will be overriden later, with the path to the gbw file of a previous calculation.
do_stable (bool, optional) -- Run stability analysis until a stable wavefunction is obtained, before every calculation.
numfreq (bool, optional) -- Use numerical frequencies instead of analytical ones.
json_dump (bool, optional) -- Whether to dump the wavefunction to JSON via orca_2json. The JSON can become very large in calculations comprising many basis functions.
- check_termination(*args, **kwargs)
- conf_key = 'orca'
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- static parse_atoms_coords(inp, *args, **kwargs)
- static parse_cis(cis)[source]
Simple wrapper of external function.
Currently, only returns Xα and Yα.
- static parse_engrad_info(inp, *args, **kwargs)
- static parse_hess_file(inp, *args, **kwargs)
- prepare_input(atoms, coords, calc_type, point_charges=None, do_stable=False)[source]
Meant to be extended.
- prepare_overlap_data(path)[source]
This method has to implement the calculator specific parsing of MO-coefficients, CI-coefficients and energies. Should return a filename pointing to TURBOMOLE like mos, a MO coefficient array and a CI coefficient array.
- run_after(path)[source]
Meant to be extended.
This method is called after a calculation was done, but before entering
self.keep()
andself.clean()
. Can be used to call tools like formchk or ricctools.
- pysisyphus.calculators.ORCA.get_name(text)[source]
Return string that comes before first character & offset.
- pysisyphus.calculators.ORCA.parse_orca_cis(cis_fn)[source]
- Read binary CI vector file from ORCA.
Loosly based on TheoDORE 1.7.1, Authors: S. Mai, F. Plasser https://sourceforge.net/p/theodore-qc
- pysisyphus.calculators.ORCA.parse_orca_gbw(gbw_fn)[source]
Adapted from https://orcaforum.kofo.mpg.de/viewtopic.php?f=8&t=3299
The first 5 long int values represent pointers into the file:
Pointer @+0: Internal ORCA data structures Pointer @+8: Geometry Pointer @+16: BasisSet Pointer @+24: Orbitals Pointer @+32: ECP data
17.1.1.2.39. pysisyphus.calculators.ORCA5 module
17.1.1.2.40. pysisyphus.calculators.OpenMM module
- class pysisyphus.calculators.OpenMM.OpenMM(topology, params, **kwargs)[source]
Bases:
Calculator
17.1.1.2.41. pysisyphus.calculators.OpenMolcas module
- class pysisyphus.calculators.OpenMolcas.OpenMolcas(basis, inporb, rasscf=None, gateway=None, mcpdft=None, track=True, **kwargs)[source]
Bases:
Calculator
- conf_key = 'openmolcas'
- prepare_coords(atoms, coords)[source]
Get 3d coords in Angstrom.
Reshape internal 1d coords to 3d and convert to Angstrom.
- Parameters:
atoms (iterable) -- Atom descriptors (element symbols).
coords (np.array, 1d) -- 1D-array holding coordinates in Bohr.
- Returns:
coords -- 3D-array holding coordinates in Angstrom.
- Return type:
np.array, 3d
17.1.1.2.42. pysisyphus.calculators.OverlapCalculator module
- class pysisyphus.calculators.OverlapCalculator.NTOs(ntos, lambdas)
Bases:
tuple
- lambdas
Alias for field number 1
- ntos
Alias for field number 0
- class pysisyphus.calculators.OverlapCalculator.OverlapCalculator(*args, track=False, ovlp_type='tden', double_mol=False, ovlp_with='previous', adapt_args=(0.5, 0.3, 0.6), cdds=None, orient='', dump_fn='overlap_data.h5', h5_dump=False, conf_thresh=0.001, mos_ref='cur', mos_renorm=True, **kwargs)[source]
Bases:
Calculator
- H5_MAP = {'Ca': 'Ca_list', 'Cb': 'Cb_list', 'Xa': 'Xa_list', 'Xb': 'Xb_list', 'Ya': 'Ya_list', 'Yb': 'Yb_list', 'all_energies': 'all_energies_list', 'coords': 'coords_list', 'ref_roots': 'reference_roots', 'roots': 'roots_list'}
- OVLP_TYPE_VERBOSE = {'nto': 'natural transition orbital overlap', 'nto_org': 'original natural transition orbital overlap', 'tden': 'transition density matrix overlap', 'top': 'transition orbital pair overlap', 'wf': 'wavefunction overlap'}
- VALID_CDDS = (None, 'calc', 'render')
- VALID_KEYS = ['wf', 'tden', 'nto', 'nto_org', 'top']
- VALID_XY = ('X', 'X+Y', 'X-Y')
- conf_thresh
self.dyn_roots = int(dyn_roots) if self.dyn_roots != 0:
self.dyn_roots = 0 self.log("dyn_roots = 0 is hardcoded right now")
- property data_model
- get_indices(indices=None)[source]
A new root is determined by selecting the overlap matrix row corresponding to the reference root and checking for the root with the highest overlap (at the current geometry).
The overlap matrix is usually formed by a double loop like:
overlap_matrix = np.empty((ref_states, cur_states)) for i, ref_state in enumerate(ref_states):
- for j, cur_state in enumerate(cur_states):
overlap_matrix[i, j] = make_overlap(ref_state, cur_state)
So the reference states run along the rows. Thats why the ref_state index comes first in the 'indices' tuple.
- get_orbital_matrices(indices=None, S_AO=None)[source]
Return MO coefficents and AO overlaps for the given indices.
If not provided, a AO overlap matrix is constructed from one of the MO coefficient matrices (controlled by self.mos_ref). Also, if requested one of the two MO coefficient matrices is re-normalized.
- static get_sao_from_mo_coeffs(C)[source]
Recover AO overlaps from given MO coefficients.
For MOs in the columns of mo_coeffs:
S_AO = C⁻¹^T C⁻¹ S_AO C = C⁻¹^T (S_AO C)^T = C⁻¹ C^T S_AO^T = C⁻¹ C^T S_AO C = I
- prepare_overlap_data(path)[source]
This method has to implement the calculator specific parsing of MO-coefficients, CI-coefficients and energies. Should return a filename pointing to TURBOMOLE like mos, a MO coefficient array and a CI coefficient array.
- property stored_calculations
17.1.1.2.43. pysisyphus.calculators.Psi4 module
- class pysisyphus.calculators.Psi4.Psi4(method, basis, to_set=None, to_import=None, pcm='iefpcm', solvent=None, write_fchk=False, **kwargs)[source]
Bases:
Calculator
- conf_key = 'psi4'
17.1.1.2.44. pysisyphus.calculators.PyPsi4 module
- class pysisyphus.calculators.PyPsi4.PyPsi4(method, basis, **kwargs)[source]
Bases:
Calculator
17.1.1.2.45. pysisyphus.calculators.PySCF module
17.1.1.2.46. pysisyphus.calculators.PyXTB module
- class pysisyphus.calculators.PyXTB.PyXTB(*args, gfn=2, acc=None, verbosity=0, keep_calculator=False, **kwargs)[source]
Bases:
Calculator
17.1.1.2.47. pysisyphus.calculators.QCEngine module
17.1.1.2.48. pysisyphus.calculators.Rastrigin module
- class pysisyphus.calculators.Rastrigin.Rastrigin[source]
Bases:
AnaPotBase
17.1.1.2.49. pysisyphus.calculators.Remote module
- class pysisyphus.calculators.Remote.Remote(remote_calc, host, prefix='', **kwargs)[source]
Bases:
Calculator
17.1.1.2.50. pysisyphus.calculators.Rosenbrock module
- class pysisyphus.calculators.Rosenbrock.Rosenbrock[source]
Bases:
AnaPotBase
17.1.1.2.51. pysisyphus.calculators.SocketCalc module
- class pysisyphus.calculators.SocketCalc.SocketCalc(*args, host='localhost', port=8080, **kwargs)[source]
Bases:
Calculator
- get_hessian(atoms, coords)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- valid_requests = ('energy', 'forces', 'hessian')
17.1.1.2.52. pysisyphus.calculators.TIP3P module
- class pysisyphus.calculators.TIP3P.TIP3P(rc=9.44863062728914)[source]
Bases:
Calculator
Transferable Intermolecular Potential 3 Point
- aHOH = 104.52
- charges
- coulomb_energy = (multiple of elem. charge * multiple of elem. charge)
/ (distance in bohr) * 1 / (4 * pi * vacuum permittivity)
coulomb_prefactor converts everything to atomic units and it is ... drum roll ... 1. from scipy.constants import value as pcval self.coulomb_prefactor = (1 / (4 * np.pi) * pcval("elementary charge")**2
/ pcval("Hartree energy") / pcval("Bohr radius") / pcval("vacuum electric permittivity")
)
- epsilon = 0.0002423919586315716
- qH = 0.417
- qO = -0.834
- rOH = 1.8088458464917874
- sigma = 5.953790025507198
17.1.1.2.53. pysisyphus.calculators.TransTorque module
- class pysisyphus.calculators.TransTorque.TransTorque(frags, iter_frags, a_mats, b_mats, weight_func=None, skip=True, kappa=1.0, b_coords3d=None, do_trans=True)[source]
Bases:
object
17.1.1.2.54. pysisyphus.calculators.Turbomole module
- class pysisyphus.calculators.Turbomole.Turbomole(control_path=None, simple_input=None, root=None, double_mol_path=None, cosmo_kwargs=None, **kwargs)[source]
Bases:
OverlapCalculator
- conf_key = 'turbomole'
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- parse_double_mol(path)[source]
Parse a double molecule overlap matrix from Turbomole output to be used with WFOWrapper.
- parse_gs_energy()[source]
Several places are possible: $subenergy from control file total energy from turbomole.out Final MP2 energy from turbomole.out with ADC(2) Final CC2 energy from turbomole.out with CC(2)
- parse_td_vectors(text)[source]
For TDA calculations only the X vector is present in the ciss_a/etc. file. In TDDFT calculations there are twise as much items compared with TDA. The first half corresponds to (X+Y) and the second half to (X-Y). X can be calculated as X = ((X+Y)+(X-Y))/2. Y is then given as Y = (X+Y)-X. The normalization can then by checked as
np.concatenate((X, Y)).dot(np.concatenate((X, -Y)))
and should be 1.
- static parse_tddft_tden(inp, *args, **kwargs)
- prepare_input(atoms, coords, calc_type, point_charges=None)[source]
To rectify this we have to construct the basecmd dynamically and construct it ad hoc. We could set a RI flag in the beginning and select the correct scf binary here from it. Then we select the following binary on demand, e.g. aoforce or rdgrad or egrad etc.
- prepare_overlap_data(path)[source]
This method has to implement the calculator specific parsing of MO-coefficients, CI-coefficients and energies. Should return a filename pointing to TURBOMOLE like mos, a MO coefficient array and a CI coefficient array.
- pysisyphus.calculators.Turbomole.control_from_simple_input(simple_inp, charge, mult, cosmo_kwargs=None)[source]
Create control file from 'simple input'.
See examples/opt/26_turbomole_simple_input/ for an example.
17.1.1.2.55. pysisyphus.calculators.WFOWrapper module
- class pysisyphus.calculators.WFOWrapper.WFOWrapper(occ_mo_num, virt_mo_num, conf_thresh=0.001, calc_number=0, out_dir='./', wfow_mem=8000, ncore=0, debug=False)[source]
Bases:
object
- property conf_thresh
- fake_turbo_mos(mo_coeffs)[source]
Create a mos file suitable for TURBOMOLE input. All MO eigenvalues are set to 0.0. There is also a little deviation in the formatting (see turbo_fmt()) but it works ...
- generate_all_dets(occ_set1, virt_set1, occ_set2, virt_set2)[source]
Generate all possible single excitation determinant strings from union(occ_mos) to union(virt_mos).
- logger = <Logger wfoverlap (DEBUG)>
- matrix_types = {'ortho': 'Orthonormalized overlap matrix', 'ovlp': 'Overlap matrix', 'renorm': 'Renormalized overlap matrix'}
17.1.1.2.56. pysisyphus.calculators.WFOWrapper2 module
- class pysisyphus.calculators.WFOWrapper2.WFOWrapper2(overlap_data, calc_number=0, conf_thresh=0.0001, out_dir='./')[source]
Bases:
object
- static fake_turbo_mos(mo_coeffs)[source]
Create a mos file suitable for TURBOMOLE input. All MO eigenvalues are set to 0.0. There is also a little deviation in the formatting (see turbo_fmt()) but it works ...
- generate_all_dets(occ_set1, virt_set1, occ_set2, virt_set2)[source]
Generate all possible single excitation determinant strings from union(occ_mos) to union(virt_mos).
- property last_two_coords
- logger = <Logger wfoverlap (DEBUG)>
- matrix_types = {'ortho': 'Orthonormalized overlap matrix', 'ovlp': 'Overlap matrix', 'renorm': 'Renormalized overlap matrix'}
17.1.1.2.57. pysisyphus.calculators.XTB module
- class pysisyphus.calculators.XTB.OptResult(opt_geom, opt_log)
Bases:
tuple
- opt_geom
Alias for field number 0
- opt_log
Alias for field number 1
- class pysisyphus.calculators.XTB.XTB(gbsa='', alpb='', gfn=2, acc=1.0, iterations=250, etemp=None, retry_etemp=None, restart=False, topo=None, topo_update=None, quiet=False, **kwargs)[source]
Bases:
Calculator
- __init__(gbsa='', alpb='', gfn=2, acc=1.0, iterations=250, etemp=None, retry_etemp=None, restart=False, topo=None, topo_update=None, quiet=False, **kwargs)[source]
XTB calculator.
Wrapper for running energy, gradient and Hessian calculations by XTB.
- Parameters:
gbsa (str, optional) -- Solvent for GBSA calculation, by default no solvent model is used.
alpb (str, optional) -- Solvent for ALPB calculation, by default no solvent model is used.
gfn (int or str, must be (0, 1, 2, or "ff")) -- Hamiltonian for the XTB calculation (GFN0, GFN1, GFN2, or GFNFF).
acc (float, optional) -- Accuracy control of the calculation, the lower the tighter several numerical thresholds are chosen.
iterations (int, optional) -- The number of iterations in SCC calculation.
topo (str, optional) -- Path the a GFNFF-topolgy file. As setting up the topology may take some time for sizable systems, it may be desired to reuse the file.
topo_update (int) -- Integer controlling the update interval of the GFNFF topology update. If supplied, the topolgy will be recreated every N-th calculation.
mem (int) -- Mememory per core in MB.
quiet (bool, optional) -- Suppress creation of log files.
- static check_termination(inp, *args, **kwargs)
- conf_key = 'xtb'
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- prepare_coords(atoms, coords)[source]
Get 3d coords in Angstrom.
Reshape internal 1d coords to 3d and convert to Angstrom.
- Parameters:
atoms (iterable) -- Atom descriptors (element symbols).
coords (np.array, 1d) -- 1D-array holding coordinates in Bohr.
- Returns:
coords -- 3D-array holding coordinates in Angstrom.
- Return type:
np.array, 3d
17.1.1.2.58. pysisyphus.calculators.parser module
17.1.1.2.59. Module contents
- class pysisyphus.calculators.AFIR(calculator, fragment_indices, gamma, rho=1, p=6, ignore_hydrogen=False, zero_hydrogen=True, complete_fragments=True, dump=True, h5_fn='afir.h5', h5_group_name='afir', **kwargs)[source]
Bases:
Calculator
- __init__(calculator, fragment_indices, gamma, rho=1, p=6, ignore_hydrogen=False, zero_hydrogen=True, complete_fragments=True, dump=True, h5_fn='afir.h5', h5_group_name='afir', **kwargs)[source]
Artifical Force Induced Reaction calculator.
Currently, there are no automated drivers to run large-scale AFIR calculations with many different initial orientations and/or increasing collision energy parameter γ. Nontheless, selected AFIR calculations can be carried out by hand. After convergence, artificial potential & forces, as well as real energies and forces can be plotted with 'pysisplot --afir'. The highest energy point along the AFIR path can then be selected for a subsequent TS-optimization, e.g. via 'pysistrj --get [index] optimzation.trj'.
Future versions of pysisyphus may provide drivers for more automatted AFIR calculations.
- Parameters:
calculator (
Calculator
) -- Actual QC calculator that provides energies and its derivatives, that are modified by the AFIR calculator, e.g., ORCA or Psi4.fragment_indices (
List
[List
[int
]]) -- List of lists of integers, specifying the separate fragments. If the indices in theses lists don't comprise all atoms in the molecule, the reamining indices will be added as a separate fragment. If a AFIR calculation is carried out with 2 fragments and 'complete_fragments' is True (see below) it is enough to specify only the indices of one fragment, e.g., for a system of 10 atoms 'fragment_indices=[[0,1,2,3]]' is enough. The second system will be set up automatically with indices [4,5,6,7,8,9].gamma (
Union
[_SupportsArray
[dtype
[Any
]],_NestedSequence
[_SupportsArray
[dtype
[Any
]]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]]]) -- Collision energy parameter γ in au. For 2 fragments it can be a single integer, while for > 2 fragments a list of gammas must be given, specifying the pair-wise collision energy parameters. For 3 fragments 3 gammas must be given [γ_01, γ_02, γ_12], for 4 fragments 6 gammas would be required [γ_01, γ_02, γ_03, γ_12, γ_13, γ_23] and so on.rho (
Union
[_SupportsArray
[dtype
[Any
]],_NestedSequence
[_SupportsArray
[dtype
[Any
]]],bool
,int
,float
,complex
,str
,bytes
,_NestedSequence
[Union
[bool
,int
,float
,complex
,str
,bytes
]]], default:1
) -- Direction of the artificial force, either 1 or -1. The same comments as for gamma apply. For 2 fragments a single integer is enough, for > 2 fragments a list of rhos must be given (see above). For rho=1 fragments are pushed together, for rho=-1 fragments are pulled apart.p (
int
, default:6
) -- Exponent p used in the calculation of the weight function ω. Defaults to 6 and probably does not have to be changed.ignore_hydrogen (
bool
, default:False
) -- Whether hydrogens are ignored in the calculation of the artificial force. All weights between atom pairs containing hydrogen will be set to 0.zero_hydrogen (
bool
, default:True
) -- Whether to use 0.0 as covalent radius for hydrogen in the weight function. Compared to 'ignore_hydrogen', which results in zero weights for all atom pairs involving hydrogen, 'zero_hydrogen' may be non-zero, depending on the covalent radius of the second atom in the pair.complete_fragments (
bool
, default:True
) -- Whether an incomplete specification in 'fragment_indices' is automatically completed.dump (
bool
, default:True
) -- Whether an HDF5 file is created.h5_fn (
str
, default:'afir.h5'
) -- Filename of the HDF5 file used for dumping.h5_group_name (
str
, default:'afir'
) -- HDF5 group name used for dumping.**kwargs -- Keyword arguments passed to the Calculator baseclass.
- property charge
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- property mult
- set_atoms_and_funcs(atoms, coords)[source]
Initially atoms was also an argument to the constructor of AFIR. I removed it so creation becomes easier. The first time a calculation is requested with a proper atom set everything is set up (cov. radii, afir function and corresponding gradient). Afterwards there is only a check if atoms != None and it is expected that all functions are properly set.
fragment_indices can also be incomplete w.r.t. to the number of atoms. If the sum of the specified fragment atoms is less than the number of atoms present then all remaining unspecified atoms will be gathered in one fragment.
- class pysisyphus.calculators.AtomAtomTransTorque(geom, frags, A_mats, kappa=2.0)[source]
Bases:
object
- class pysisyphus.calculators.CFOUR(cfour_input, wavefunction_dump=True, initden_file=None, **kwargs)[source]
Bases:
Calculator
- __init__(cfour_input, wavefunction_dump=True, initden_file=None, **kwargs)[source]
CFOUR calculator.
Wrapper handling CFOUR ground state energy and gradient calculations.
- Parameters:
cfour_input (dict) -- CFOUR keywords and values. Note: "on" must be encapsulated in quotes to avoid being translated to True by YAML.
wavefunction_dump (bool, optional) -- Whether or not to keep ground state SCF orbitals for each geometry step.
initden_file (str, optional) -- Path to an input initden file for use as a guess SCF density.
- conf_key = 'cfour'
- keep(path)[source]
Backup calculation results.
- Parameters:
path (Path) -- Temporary directory of the calculation.
- Returns:
kept_fns -- Dictonary holding the filenames that were backed up. The keys correspond to the type of file.
- Return type:
dict
- prepare(inp)[source]
Prepare a temporary directory and write input.
Similar to prepare_path, but the input is also written into the prepared directory.
17.1.1.2. Paramters
- inpstr
Input to be written into the file
self.inp_fn
in the prepared directory.
- returns:
- path: Path
Prepared directory.
- prepare_coords(atoms, coords)[source]
Get 3d coords in Bohr
Reshape internal 1d coords to 3d.
- Parameters:
atoms (iterable) -- Atom descriptors (element symbols).
coords (np.array, 1d) -- 1D-array holding coordinates in Bohr.
- Returns:
coords -- 3D-array holding coordinates in Bohr.
- Return type:
np.array, 3d
- class pysisyphus.calculators.Composite(final, keys_calcs=None, calcs=None, remove_translation=False, **kwargs)[source]
Bases:
Calculator
- class pysisyphus.calculators.ConicalIntersection(calculator1, calculator2, **kwargs)[source]
Bases:
Calculator
Calculator for conical intersection optimization.
Based on [1].
- class pysisyphus.calculators.DFTBp(parameter, *args, slakos=None, root=None, **kwargs)[source]
Bases:
OverlapCalculator
- conf_key = 'dftbp'
- hubbard_derivs = {'3ob': {'Br': -0.0573, 'C': -0.1492, 'Ca': -0.034, 'Cl': -0.0697, 'F': -0.1623, 'H': -0.1857, 'I': -0.0433, 'K': -0.0339, 'Mg': -0.02, 'N': -0.1535, 'Na': -0.0454, 'O': -0.1575, 'P': -0.14, 'S': -0.11, 'Zn': -0.03}}
- max_ang_moms = {'3ob': {'Br': 'd', 'C': 'p', 'Ca': 'p', 'Cl': 'd', 'F': 'p', 'H': 's', 'I': 'd', 'K': 'p', 'Mg': 'p', 'N': 'p', 'Na': 'p', 'O': 'p', 'P': 'd', 'S': 'd', 'Zn': 'd'}, 'mio-ext': {'C': 'p', 'H': 's', 'N': 'p', 'O': 'p'}}
- class pysisyphus.calculators.DFTD4(method=None, damp_params=None, model_params=None, **kwargs)[source]
Bases:
Calculator
- class pysisyphus.calculators.Dimer(calculator, *args, N_raw=None, length=0.0189, rotation_max_cycles=15, rotation_method='fourier', rotation_thresh=0.0001, rotation_tol=1, rotation_max_element=0.001, rotation_interpolate=True, rotation_disable=False, rotation_disable_pos_curv=True, rotation_remove_trans=True, trans_force_f_perp=True, bonds=None, N_hessian=None, bias_rotation=False, bias_translation=False, bias_gaussian_dot=0.1, seed=None, write_orientations=True, forward_hessian=True, **kwargs)[source]
Bases:
Calculator
- property C
Shortcut for the curvature.
- property N
- property can_bias_f0
- property can_bias_f1
- property coords0
- property coords1
- property energy0
- property f0
- property f1
- property f1_bias
- property f2
Never calculated explicitly, but estimated from f0 and f1.
- get_hessian(atoms, coords)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- property rot_force
- property should_bias_f0
May lead to calculation of f0 and/or f1 if present!
- property should_bias_f1
May lead to calculation of f0 and/or f1 if present!
- class pysisyphus.calculators.Dummy(calc_number=0, charge=0, mult=1, base_name='calculator', pal=1, mem=1000, keep_kind='all', check_mem=True, retry_calc=0, last_calc_cycle=None, clean_after=True, out_dir='qm_calcs', force_num_hess=False, num_hess_kwargs=None)[source]
Bases:
Calculator
- class pysisyphus.calculators.EGO(calculator, ref_geom, max_force=0.175, **kwargs)[source]
Bases:
Calculator
- property ref_hessian
- property s
- class pysisyphus.calculators.EnergyMin(calculator1, calculator2, mix=False, alpha=0.02, sigma=3.5, min_energy_diff=0.0, check_after=0, **kwargs)[source]
Bases:
Calculator
- __init__(calculator1, calculator2, mix=False, alpha=0.02, sigma=3.5, min_energy_diff=0.0, check_after=0, **kwargs)[source]
Use energy and derivatives of the calculator with lower energy.
This calculators carries out two calculations with different settings and returns the results of the lower energy one. This can be used to consider flips between a singlet and a triplet PES etc.
- Parameters:
calculator1 (
Calculator
) -- Wrapped QC calculator that provides energies and its derivatives.calculator2 (
Calculator
) -- Wrapped QC calculator that provides energies and its derivatives.mix (
bool
, default:False
) -- Enable mixing of both forces, according to the approach outlined in [2]. Can be used to optimize guesses for MECPs. Passalpha (
float
, default:0.02
) -- Smoothing parameter in Hartree. See [2] for a discussion.sigma (
float
, default:3.5
) -- Unitless gap size parameter. The final gap becomes smaller for bigga sigmas. Has to be adapted for each case. See [2] for a discussion (p. 407 right column and p. 408 left column.)min_energy_diff (
float
, default:0.0
) -- Energy difference in Hartree. When set to a value != 0 and the energy difference between both calculators drops below this value, execution of both calculations is diabled for 'check_after' cycles. In these cycles the calculator choice remains fixed. After 'check_after' cycles, both energies will be calculated and it is checked, if the previous calculator choice remains valid. In conjunction with 'check_after' both arguments can be used to save computational ressources.check_after (
int
, default:0
) -- Amount of cycles in which the calculator choice remains fixed.**kwargs -- Keyword arguments passed to the Calculator baseclass.
- class pysisyphus.calculators.ExternalPotential(calculator=None, potentials=None, geom=None, **kwargs)[source]
Bases:
Calculator
- available_potentials = {'d3': <class 'pysisyphus.calculators.DFTD3.DFTD3'>, 'harmonic_sphere': <class 'pysisyphus.calculators.ExternalPotential.HarmonicSphere'>, 'logfermi': <class 'pysisyphus.calculators.ExternalPotential.LogFermi'>, 'restraint': <class 'pysisyphus.calculators.ExternalPotential.Restraint'>, 'rmsd': <class 'pysisyphus.calculators.ExternalPotential.RMSD'>}
- class pysisyphus.calculators.Gaussian09(*args, **kwargs)[source]
Bases:
Gaussian16
- conf_key = 'gaussian09'
- class pysisyphus.calculators.Gaussian16(route, gbs='', gen='', keep_chk=False, stable='', fchk=None, **kwargs)[source]
Bases:
OverlapCalculator
- conf_key = 'gaussian16'
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- parse_log(*args, **kwargs)
- prepare_input(atoms, coords, calc_type, did_stable=False, point_charges=None)[source]
Meant to be extended.
- prepare_overlap_data(path)[source]
This method has to implement the calculator specific parsing of MO-coefficients, CI-coefficients and energies. Should return a filename pointing to TURBOMOLE like mos, a MO coefficient array and a CI coefficient array.
- class pysisyphus.calculators.HardSphere(geom, frags, kappa=1.0, permutations=False, frag_radii=None, radii_offset=0.9452)[source]
Bases:
object
- class pysisyphus.calculators.IPIServer(*args, address=None, host=None, port=None, unlink=True, hdrlen=12, max_retries=0, verbose=False, **kwargs)[source]
Bases:
Calculator
- get_hessian(atoms, coords)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- listen_kinds = ('coords', 'energy', 'forces', 'hessian')
- class pysisyphus.calculators.LennardJones(sigma=1.8897261251, epsilon=1, rc=None)[source]
Bases:
Calculator
- class pysisyphus.calculators.MOPAC(method='PM7', **kwargs)[source]
Bases:
Calculator
- CALC_TYPES = {'energy': '1SCF', 'gradient': '1SCF GRADIENTS', 'hessian': 'DFORCE FORCE LET'}
- METHODS = ['am1', 'pm3', 'pm6', 'pm6-dh2', 'pm6-d3', 'pm6-dh+', 'pm6-dh2', 'pm6-dh2x', 'pm6-d3h4', 'pm6-d3h4x', 'pm7', 'pm7-ts']
- MULT_STRS = {1: 'SINGLET', 2: 'DOUBLET', 3: 'TRIPLET', 4: 'QUARTET', 5: 'QUINTET', 6: 'SEXTET', 7: 'SEPTET', 8: 'OCTET'}
- base_cmd
Do only SCF AUX: Creates a checkpoint file NOREO: Dont reorient geometry
- Type:
1SCF
- conf_key = 'mopac'
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- static parse_energy_from_aux(inp, *args, **kwargs)
- static parse_hessian_from_aux(inp, *args, **kwargs)
- prepare_coords(atoms, coords, opt=False)[source]
Get 3d coords in Angstrom.
Reshape internal 1d coords to 3d and convert to Angstrom.
- Parameters:
atoms (iterable) -- Atom descriptors (element symbols).
coords (np.array, 1d) -- 1D-array holding coordinates in Bohr.
- Returns:
coords -- 3D-array holding coordinates in Angstrom.
- Return type:
np.array, 3d
- class pysisyphus.calculators.MultiCalc(calcs, **kwargs)[source]
Bases:
Calculator
- class pysisyphus.calculators.OBabel(ff='gaff', mol=None, **kwargs)[source]
Bases:
Calculator
- conv_dict = {'kcal/mol': 627.5094740630558, 'kj/mol': 2625.4996394798254}
- class pysisyphus.calculators.ONIOM(calcs, models, geom, layers=None, embedding='', real_key='real', use_link_atoms=True, *args, **kwargs)[source]
Bases:
Calculator
- __init__(calcs, models, geom, layers=None, embedding='', real_key='real', use_link_atoms=True, *args, **kwargs)[source]
- layer: list of models
len(layer) == 1: normal ONIOM, len(layer) >= 1: multicenter ONIOM.
- model:
(sub)set of all atoms that resides in a certain layer and has a certain calculator.
- atom_inds_in_layer(index, exclude_inner=False)[source]
Returns list of atom indices in layer at index.
Atoms that also appear in inner layer can be excluded on request.
- Parameters:
index (int) -- pasd
exclude_inner (bool, default=False, optional) -- Whether to exclude atom indices that also appear in inner layers.
- Returns:
atom_indices -- List containing the atom indices in the selected layer.
- Return type:
list
- property charge
- embeddings = {'': '', 'electronic': 'Electronic embedding', 'electronic_rc': 'Electronic embedding with redistributed charges', 'electronic_rcd': 'Electronic embedding with redistributed charges and dipoles'}
- get_hessian(atoms, coords)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- property model_iter
- property mult
- class pysisyphus.calculators.ORCA(keywords, blocks='', gbw=None, do_stable=False, numfreq=False, json_dump=True, **kwargs)[source]
Bases:
OverlapCalculator
- __init__(keywords, blocks='', gbw=None, do_stable=False, numfreq=False, json_dump=True, **kwargs)[source]
ORCA calculator.
Wrapper for creating ORCA input files for energy, gradient and Hessian calculations. The PAL and memory inputs must not be given in the keywords and/or blocks, as they are handled by the 'pal' and 'memory' arguments.
- Parameters:
keywords (str) -- Keyword line, as normally given in ORCA, excluding the leading "!".
blocks (str, optional) -- ORCA block input(s), e.g. for TD-DFT calculations (%tddft ... end). As the blocks start with a leading "%", wrapping the input in quotes ("") is required, otherwise the parsing will fail.
gbw (str, optional) -- Path to an input gbw file, which will be used as initial guess for the first calculation. Will be overriden later, with the path to the gbw file of a previous calculation.
do_stable (bool, optional) -- Run stability analysis until a stable wavefunction is obtained, before every calculation.
numfreq (bool, optional) -- Use numerical frequencies instead of analytical ones.
json_dump (bool, optional) -- Whether to dump the wavefunction to JSON via orca_2json. The JSON can become very large in calculations comprising many basis functions.
- check_termination(*args, **kwargs)
- conf_key = 'orca'
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- static parse_atoms_coords(inp, *args, **kwargs)
- static parse_cis(cis)[source]
Simple wrapper of external function.
Currently, only returns Xα and Yα.
- static parse_engrad_info(inp, *args, **kwargs)
- static parse_hess_file(inp, *args, **kwargs)
- prepare_input(atoms, coords, calc_type, point_charges=None, do_stable=False)[source]
Meant to be extended.
- prepare_overlap_data(path)[source]
This method has to implement the calculator specific parsing of MO-coefficients, CI-coefficients and energies. Should return a filename pointing to TURBOMOLE like mos, a MO coefficient array and a CI coefficient array.
- run_after(path)[source]
Meant to be extended.
This method is called after a calculation was done, but before entering
self.keep()
andself.clean()
. Can be used to call tools like formchk or ricctools.
- class pysisyphus.calculators.ORCA5(keywords, blocks='', gbw=None, do_stable=False, numfreq=False, json_dump=True, **kwargs)[source]
Bases:
ORCA
- conf_key = 'orca5'
- class pysisyphus.calculators.OpenMolcas(basis, inporb, rasscf=None, gateway=None, mcpdft=None, track=True, **kwargs)[source]
Bases:
Calculator
- conf_key = 'openmolcas'
- prepare_coords(atoms, coords)[source]
Get 3d coords in Angstrom.
Reshape internal 1d coords to 3d and convert to Angstrom.
- Parameters:
atoms (iterable) -- Atom descriptors (element symbols).
coords (np.array, 1d) -- 1D-array holding coordinates in Bohr.
- Returns:
coords -- 3D-array holding coordinates in Angstrom.
- Return type:
np.array, 3d
- class pysisyphus.calculators.Psi4(method, basis, to_set=None, to_import=None, pcm='iefpcm', solvent=None, write_fchk=False, **kwargs)[source]
Bases:
Calculator
- conf_key = 'psi4'
- class pysisyphus.calculators.PyPsi4(method, basis, **kwargs)[source]
Bases:
Calculator
- class pysisyphus.calculators.PyXTB(*args, gfn=2, acc=None, verbosity=0, keep_calculator=False, **kwargs)[source]
Bases:
Calculator
- class pysisyphus.calculators.Remote(remote_calc, host, prefix='', **kwargs)[source]
Bases:
Calculator
- class pysisyphus.calculators.TIP3P(rc=9.44863062728914)[source]
Bases:
Calculator
Transferable Intermolecular Potential 3 Point
- aHOH = 104.52
- charges
- coulomb_energy = (multiple of elem. charge * multiple of elem. charge)
/ (distance in bohr) * 1 / (4 * pi * vacuum permittivity)
coulomb_prefactor converts everything to atomic units and it is ... drum roll ... 1. from scipy.constants import value as pcval self.coulomb_prefactor = (1 / (4 * np.pi) * pcval("elementary charge")**2
/ pcval("Hartree energy") / pcval("Bohr radius") / pcval("vacuum electric permittivity")
)
- epsilon = 0.0002423919586315716
- qH = 0.417
- qO = -0.834
- rOH = 1.8088458464917874
- sigma = 5.953790025507198
- class pysisyphus.calculators.TransTorque(frags, iter_frags, a_mats, b_mats, weight_func=None, skip=True, kappa=1.0, b_coords3d=None, do_trans=True)[source]
Bases:
object
- class pysisyphus.calculators.Turbomole(control_path=None, simple_input=None, root=None, double_mol_path=None, cosmo_kwargs=None, **kwargs)[source]
Bases:
OverlapCalculator
- conf_key = 'turbomole'
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- parse_double_mol(path)[source]
Parse a double molecule overlap matrix from Turbomole output to be used with WFOWrapper.
- parse_gs_energy()[source]
Several places are possible: $subenergy from control file total energy from turbomole.out Final MP2 energy from turbomole.out with ADC(2) Final CC2 energy from turbomole.out with CC(2)
- parse_td_vectors(text)[source]
For TDA calculations only the X vector is present in the ciss_a/etc. file. In TDDFT calculations there are twise as much items compared with TDA. The first half corresponds to (X+Y) and the second half to (X-Y). X can be calculated as X = ((X+Y)+(X-Y))/2. Y is then given as Y = (X+Y)-X. The normalization can then by checked as
np.concatenate((X, Y)).dot(np.concatenate((X, -Y)))
and should be 1.
- static parse_tddft_tden(inp, *args, **kwargs)
- prepare_input(atoms, coords, calc_type, point_charges=None)[source]
To rectify this we have to construct the basecmd dynamically and construct it ad hoc. We could set a RI flag in the beginning and select the correct scf binary here from it. Then we select the following binary on demand, e.g. aoforce or rdgrad or egrad etc.
- prepare_overlap_data(path)[source]
This method has to implement the calculator specific parsing of MO-coefficients, CI-coefficients and energies. Should return a filename pointing to TURBOMOLE like mos, a MO coefficient array and a CI coefficient array.
- class pysisyphus.calculators.XTB(gbsa='', alpb='', gfn=2, acc=1.0, iterations=250, etemp=None, retry_etemp=None, restart=False, topo=None, topo_update=None, quiet=False, **kwargs)[source]
Bases:
Calculator
- __init__(gbsa='', alpb='', gfn=2, acc=1.0, iterations=250, etemp=None, retry_etemp=None, restart=False, topo=None, topo_update=None, quiet=False, **kwargs)[source]
XTB calculator.
Wrapper for running energy, gradient and Hessian calculations by XTB.
- Parameters:
gbsa (str, optional) -- Solvent for GBSA calculation, by default no solvent model is used.
alpb (str, optional) -- Solvent for ALPB calculation, by default no solvent model is used.
gfn (int or str, must be (0, 1, 2, or "ff")) -- Hamiltonian for the XTB calculation (GFN0, GFN1, GFN2, or GFNFF).
acc (float, optional) -- Accuracy control of the calculation, the lower the tighter several numerical thresholds are chosen.
iterations (int, optional) -- The number of iterations in SCC calculation.
topo (str, optional) -- Path the a GFNFF-topolgy file. As setting up the topology may take some time for sizable systems, it may be desired to reuse the file.
topo_update (int) -- Integer controlling the update interval of the GFNFF topology update. If supplied, the topolgy will be recreated every N-th calculation.
mem (int) -- Mememory per core in MB.
quiet (bool, optional) -- Suppress creation of log files.
- static check_termination(inp, *args, **kwargs)
- conf_key = 'xtb'
- get_hessian(atoms, coords, **prepare_kwargs)[source]
Get Hessian matrix. Fall back to numerical Hessian, if not overriden.
Preferrably, this method should provide an analytical Hessian.
- prepare_coords(atoms, coords)[source]
Get 3d coords in Angstrom.
Reshape internal 1d coords to 3d and convert to Angstrom.
- Parameters:
atoms (iterable) -- Atom descriptors (element symbols).
coords (np.array, 1d) -- 1D-array holding coordinates in Bohr.
- Returns:
coords -- 3D-array holding coordinates in Angstrom.
- Return type:
np.array, 3d