optimise¶
-
chemopt.zmat_optimisation.
optimise
(zmolecule, hamiltonian, basis, symbols=None, md_out=None, el_calc_dir=None, molden_out=None, etol=1e-06, gtol=0.0006, max_iter=100, backend='molcas', charge=0, title='', multiplicity=1, num_procs=None, mem_per_proc=None, start_orb=None, coord_fmt='.4f', **kwargs)[source]¶ Optimize a molecule.
Parameters: - zmolecule (chemcoord.Zmat) –
- hamiltonian (str) – The hamiltonian to use for calculating the electronic energy. The allowed values are {‘RASSCF’, ‘B3LYP’, ‘CCSD(T)’, ‘CCSD’, ‘CASPT2’, ‘MP2’, ‘SCF’}.
- basis (str) – The basis set to use for calculating the electronic energy.
- symbols (list) – A list of tuples. Each tuple consists of a
sympy symbolic expression and a starting value.
An example is:
[(r, 1.1), (alpha, 120)]
. Has exactly the same format as the multi-parameter substitution in sympy. - el_calc_dir (str) – Specify the input filename for electronic
calculations. If it is None, the filename of the calling
python script is used (With the suffix
.inp
instead of.py
) and the files for the electronic calculations will reside in their own directory. - md_out (str) – Specify the output filename for chemopt output files. If it is None, the filename of the calling python script is used (With the suffix
.md
instead of.py
). The output will beos.path.splitext(inputfile)[0] + '.md'
. - molden_out (str) – Specify the output filename for the molden file from a geometry optimisation. If it is None, the filename of the calling python script is used (With the suffix
.molden
instead of.py
). The output will beos.path.splitext(inputfile)[0] + '.molden'
. - backend (str) – Specify which QM program suite shoud be used. Allowed values are {‘molcas’, ‘molpro’}, the default is ‘molcas’.
- charge (int) – The overall charge of the molecule. The default is 0.
- title (str) – The title to be printed in input and output.
- multiplicity (int) – The spin multiplicity. The default is 1.
- etol (float) – Convergence criterium for the energy.
- gtol (float) – Convergence criterium for the gradient.
- max_iter (int) – Maximum number of iterations. The default is ‘100’.
- num_procs (int) – The number of processes to spawn.
- mem_per_proc (str) – Memory per process. This is a string with a number and a unit like ‘800 MB’. SI and binary prefixes are supported. Uses the datasize library for parsing.
- start_orb (str) – Path to an orbital file, if starting orbitals should be used.
- coord_fmt (str) – A string as float formatter for the coordinates in the output file of chemopt. The default is ‘.4f’
Returns: A list of dictionaries. The last one is the optimised structure. The keys of each dictionary depend on the used optimisation. In any case each dictionary has at least two keys:
- ’energy’: The energy in Hartree.
- ’structure’: The Zmatrix.
If
symbols
wasNone
a generic optimisation was performed and the following keys are available:- ’grad_energy’: The energy gradient (‘grad_energy’)
in internal coordinates. The units are Hartree / Angstrom for bonds and Hartree / radians for angles and dihedrals.
If
symbols
was notNone
an optimisation with reduced degrees of freedom was performed and the following keys are available:- ’symbols’: A list of tuples containing the symbol and its value.
Return type: