Geometry Optimization —
- Psi4 Native Gradient Methods
- Psi4 Native DFT Gradient Methods (excepting double-hybrids)
- CFOUR Interfaced Gradient Methods
For further discussion of geometry optimization, see Sec. Geometry Optimization.
optimize() is the only command most users will ever
need to access directly to perform geometry optimizations. Behind
optimize() is a wrapper that repeatedly
gradient() that computes the gradient then adds a
call to the geometry optimization module.
optimize(name[, molecule, return_wfn, func, mode, dertype, hessian_with])¶
Function to perform a geometry optimization.
Aliases: opt() Returns: float – Total electronic energy of optimized structure in Hartrees. Returns: (float,
Wavefunction) – energy and wavefunction when return_wfn specified.
Raises: psi4.ConvergenceError if GEOM_MAXITER exceeded without reaching geometry convergence. PSI variables: Parameters:
- name (string) –
First argument, usually unlabeled. Indicates the computational method to be applied to the database. May be any valid argument to
- molecule (molecule) –
The target molecule, if not the last molecule defined.
- return_wfn (boolean) –
Indicate to additionally return the
Wavefunctioncalculation result as the second element (after float energy) of a tuple.
- func (function) –
Indicates the type of calculation to be performed on the molecule. The default dertype accesses
'cbs'performs a multistage finite difference calculation. If a nested series of python functions is intended (see Function Intercalls), use keyword
- mode (string) –
For a finite difference of energies optimization, indicates whether the calculations required to complete the optimization are to be run in one file (
'continuous') or are to be farmed out in an embarrassingly parallel fashion (
'reap'). For the latter, run an initial job with
'sow'and follow instructions in its output file. For maximum flexibility,
return_wfnis always on in
- dertype (dertype) –
Indicates whether analytic (if available) or finite difference optimization is to be performed.
- hessian_with (string) –
Indicates the computational method with which to perform a hessian analysis to guide the geometry optimization.
Optimizations where the molecule is specified in Z-matrix format with dummy atoms will result in the geometry being converted to a Cartesian representation.
Analytic gradients area available for all methods in the table below. Optimizations with other methods in the energy table proceed by finite differences.
name calls method efp efp-only optimizations scf Hartree–Fock (HF) or density functional theory (DFT) [manual] hf HF self consistent field (SCF) [manual] dcft density cumulant functional theory [manual] mp2 2nd-order Møller–Plesset perturbation theory (MP2) [manual] [details] mp3 3rd-order Møller–Plesset perturbation theory (MP3) [manual] [details] mp2.5 average of MP2 and MP3 [manual] [details] omp2 orbital-optimized second-order MP perturbation theory [manual] omp3 orbital-optimized third-order MP perturbation theory [manual] omp2.5 orbital-optimized MP2.5 [manual] lccd Linear CCD [manual] [details] olccd orbital optimized LCCD [manual] ccd coupled cluster doubles (CCD) [manual] ccsd coupled cluster singles and doubles (CCSD) [manual] [details] ccsd(t) CCSD with perturbative triples (CCSD(T)) [manual] [details] eom-ccsd equation of motion (EOM) CCSD [manual] Examples:
>>> #  Analytic hf optimization >>> optimize('hf')
1 2 3 4
>>> #  Finite difference mp5 optimization with gradient >>> # printed to output file >>> e, wfn = opt('mp5', return_wfn='yes') >>> wfn.gradient().print_out()
1 2 3
>>> #  Forced finite difference hf optimization run in >>> # embarrassingly parallel fashion >>> optimize('hf', dertype='energy', mode='sow')
>>> #  Can automatically perform complete basis set extrapolations >>> optimize('MP2/cc-pV([D,T]+d)Z')
- name (string) –
gradient(name[, molecule, return_wfn, func, dertype])¶
Function complementary to :py:func:~driver.optimize(). Carries out one gradient pass, deciding analytic or finite difference.
Matrix– Total electronic gradient in Hartrees/Bohr.
Wavefunction) – gradient and wavefunction when return_wfn specified.
1 2 3 4 5 6
>>> #  Single-point dft gradient getting the gradient >>> # in file, core.Matrix, and np.array forms >>> set gradient_write on >>> G, wfn = gradient('b3lyp-d', return_wfn=True) >>> wfn.gradient().print_out() >>> np.array(G)