optimize¶
-
psi4.driver.
optimize
(name, **kwargs)[source]¶ 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.OptimizationConvergenceError if |optking__geom_maxiter| exceeded without reaching geometry convergence. PSI variables: Parameters: - name (string) –
'scf'
||'mp2'
||'ci5'
|| etc.First argument, usually unlabeled. Indicates the computational method to be applied to the database. May be any valid argument to
energy()
. - molecule (molecule) –
h2o
|| etc.The target molecule, if not the last molecule defined.
- return_wfn (boolean) –
'on'
|| \(\Rightarrow\)'off'
\(\Leftarrow\)Indicate to additionally return the
Wavefunction
calculation result as the second element (after float energy) of a tuple. - return_history (boolean) –
'on'
|| \(\Rightarrow\)'off'
\(\Leftarrow\)Indicate to additionally return dictionary of lists of geometries, energies, and gradients at each step in the optimization.
- func (function) –
\(\Rightarrow\)
gradient
\(\Leftarrow\) ||energy
||cbs
Indicates the type of calculation to be performed on the molecule. The default dertype accesses
'gradient'
or'energy'
, while'cbs'
performs a multistage finite difference calculation. If a nested series of python functions is intended (see Function Intercalls), use keywordopt_func
instead offunc
. - mode (string) –
\(\Rightarrow\)
'continuous'
\(\Leftarrow\) ||'sow'
||'reap'
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 ('sow'
/'reap'
). For the latter, run an initial job with'sow'
and follow instructions in its output file. For maximum flexibility,return_wfn
is always on in'reap'
mode. - dertype (dertype) –
'gradient'
||'energy'
Indicates whether analytic (if available) or finite difference optimization is to be performed.
- hessian_with (string) –
'scf'
||'mp2'
|| etc.Indicates the computational method with which to perform a hessian analysis to guide the geometry optimization.
Warning
Optimizations where the molecule is specified in Z-matrix format with dummy atoms will result in the geometry being converted to a Cartesian representation.
Note
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] name calls method DFT [manual] b1lyp B1LYP Hyb-GGA Exchange-Correlation Functional b1lyp-d3bj b1pw91 B1PW91 Hyb-GGA Exchange-Correlation Functional b1wc B1WC Hyb-GGA Exchange-Correlation Functional b3lyp B3LYP Hyb-GGA Exchange-Correlation Functional b3lyp-d3bj b3lyp-d3mbj b3lyp-nl B3LYP-nl Hyb-GGA Exchange-Correlation Functional b3lyp5 B3LYP5 Hyb-GGA Exchange-Correlation Functional b3lyps B3LYPs Hyb-GGA Exchange-Correlation Functional b3p86 B3P86 Hyb-GGA Exchange-Correlation Functional b3p86-d3bj b3pw91 B3PW91 Hyb-GGA Exchange-Correlation Functional b3pw91-d3bj b3pw91-nl B3PW91-nl Hyb-GGA Exchange-Correlation Functional b5050lyp B5050LYP Hyb-GGA Exchange-Correlation Functional b86b95 B86B95 Hyb-GGA Exchange-Correlation Functional b86bpbe B86BPBE GGA Exchange-Correlation Functional b88b95 B88B95 Hyb-GGA Exchange-Correlation Functional b88b95-d3bj b97 B97 Hyb-GGA Exchange-Correlation Functional b97-1 B97-1 Hyb-GGA Exchange-Correlation Functional b97-1-d3bj b97-1p B97-1p Hyb-GGA Exchange-Correlation Functional b97-2 B97-2 Hyb-GGA Exchange-Correlation Functional b97-2-d3bj b97-3 B97-3 Hyb-GGA Exchange-Correlation Functional b97-d b97-d3 b97-d3bj b97-d3m b97-d3mbj b97-gga1 B97-GGA1 GGA Exchange-Correlation Functional b97-k B97-K Hyb-GGA Exchange-Correlation Functional b97m-v B97M-V GGA Exchange-Correlation Functional bb1k BB1K Hyb-GGA Exchange-Correlation Functional bhandh BHandH Hyb-GGA Exchange-Correlation Functional bhandhlyp BHandHLYP Hyb-GGA Exchange-Correlation Functional blyp BLYP GGA Exchange-Correlation Functional blyp-d3bj blyp-d3mbj blyp-nl BLYP GGA Exchange-Correlation Functional bop BOP GGA Exchange-Correlation Functional bop-d3bj bp86 BP86 GGA Exchange-Correlation Functional bp86-d3bj bp86-d3mbj bp86-nl BP86 GGA Exchange-Correlation Functional cap0 CAP0 Hyb-GGA Exchange-Correlation Functional dldf Dispersionless Hybrid Meta-GGA XC Functional dldf+d09 Dispersionless Hybrid Meta-GGA XC Functional dldf+d10 Dispersionless Hybrid Meta-GGA XC Functional edf1 EDF1 GGA Exchange-Correlation Functional edf2 EDF2 Hyb-GGA Exchange-Correlation Functional ft97 FT97 GGA Exchange-Correlation Functional gam GAM GGA Minessota Exchange-Correlation Functional hcth120 HCTH120 GGA Exchange-Correlation Functional hcth120-d3bj hcth147 HCTH147 GGA Exchange-Correlation Functional hcth407 HCTH407 GGA Exchange-Correlation Functional hcth407-d3bj hcth407p HCTH407P GGA Exchange-Correlation Functional hcth93 HCTH93 GGA Exchange-Correlation Functional hcthp14 HCTHP14 GGA Exchange-Correlation Functional hcthp76 HCTHP76 GGA Exchange-Correlation Functional hf hf+d hf-d3bj hf-nl hf3c Hartree Fock based 3C composite method with minimal basis set, gCP and D3(BJ) hpbeint HPBEINT Hyb-GGA Exchange-Correlation Functional ksdt KSDT Exchange-Correlation Functional kt2 KT2 GGA Exchange-Correlation Functional m05 M05 Meta-GGA XC Functional m05-2x Heavily Parameterized Hybrid M05-2X Meta-GGA XC Functional m06 M06 Meta-GGA XC Functional m06-2x Hybrid M06-2X Meta-GGA XC Functional m06-hf Minnesota M06-HF Hybrid XC Functional m06-l M06-L Meta-GGA XC Functional m08-hx Minnesota M08-HX Hybrid XC Functional m08-so Minnesota M08-SO Hybrid XC Functional m11-l M11-L Meta-GGA XC Functional m11-l-d3bj mb3lyp-rc04 MB3LYP-RC04 Hyb-GGA Exchange-Correlation Functional mgga_ms0 MGGA_MS0 Meta-GGA XC Functional mgga_ms1 MGGA_MS1 Meta-GGA XC Functional mgga_ms2 MGGA_MS2 Meta-GGA XC Functional mgga_ms2h MGGA_MS2h Hybrid Meta-GGA XC Functional mgga_mvs MGGA_MVS Meta-GGA XC Functional mgga_mvsh MGGA_MV2h Hybrid Meta-GGA XC Functional mn12-l MN12-L Meta-GGA XC Functional mn12-l-d3bj mn15 MN15 Hybrid Meta-GGA Exchange-Correlation Functional mn15-d3bj mn15-l MN15-L Meta-GGA XC Functional mohlyp MOHLYP GGA Exchange-Correlation Functional mohlyp2 MOHLYP2 GGA Exchange-Correlation Functional mpw1b95 mPW1B95 Hyb-GGA Exchange-Correlation Functional mpw1b95-d3bj mpw1k mPW1K Hyb-GGA Exchange-Correlation Functional mpw1lyp mPW1LYP Hybrid GGA Exchange-Correlation Functional mpw1pbe mPW1PBE Hybrid GGA Exchange-Correlation Functional mpw1pw mPW1PW Hyb-GGA Exchange-Correlation Functional mpw1pw-d3bj mpw3lyp mPW3LYP Hyb-GGA Exchange-Correlation Functional mpw3pw mPW3PW Hyb-GGA Exchange-Correlation Functional mpwb1k mPWB1K Hyb-GGA Exchange-Correlation Functional mpwb1k-d3bj mpwlyp1m mPWLYP1M Hyb-GGA Exchange-Correlation Functional mpwlyp1w mPWLYP1W GGA Exchange-Correlation Functional mpwpw mPWPW GGA Exchange-Correlation Functional n12 N12 nonseparable GGA Exchange-Correlation Functional n12-d3bj o3lyp O3LYP Hyb-GGA Exchange-Correlation Functional o3lyp-d3bj oblyp-d op-pbe BP86 GGA Exchange-Correlation Functional opbe-d opwlyp-d otpss-d pbe PBE GGA Exchange-Correlation Functional pbe-d3bj pbe-d3mbj pbe-nl PBE GGA Exchange-Correlation Functional pbe0 PBE0 Hyb-GGA Exchange-Correlation Functional pbe0-13 PBE0-13 Hyb-GGA Exchange-Correlation Functional pbe0-d3bj pbe0-d3mbj pbe0-nl PBE0-nl Hyb-GGA Exchange-Correlation Functional pbe1w PBE1W GGA Exchange-Correlation Functional pbe50 PBE50 Hybrid GGA Exchange-Correlation Functional pbeh3c PBE Hybrid based 3C composite method with a small basis set, gCP and D3(BJ) pbelyp1w PBELYP1W GGA Exchange-Correlation Functional pkzb PKZB Meta-GGA XC Functional pw6b95 PW6B95 Hybrid Meta-GGA XC Functional pw6b95-d3bj pw86b95 PW86B95 Hyb-GGA Exchange-Correlation Functional pw86pbe PW86PBE GGA Exchange-Correlation Functional pw91 PW91 GGA Exchange-Correlation Functional pw91-d3bj pwb6k PWB6K Hyb-GGA Exchange-Correlation Functional pwb6k-d3bj revb3lyp revB3LYP Hyb-GGA Exchange-Correlation Functional revpbe revPBE GGA Exchange-Correlation Functional revpbe-d3bj revpbe-nl revPBE GGA Exchange-Correlation Functional revpbe0 revPBE0 Hybrid GGA Exchange-Correlation Functional revpbe0-d3bj revpbe0-nl revPBE0 Hybrid GGA Exchange-Correlation Functional revtpss revised TPSS Meta-GGA XC Functional revtpss-d3bj revtpssh revTPSSh Hyb-GGA Exchange-Correlation Functional revtpssh-d3bj rpbe RPBE GGA Exchange-Correlation Functional rpbe-d3bj sb98-1a SB98-1a Hyb-GGA Exchange-Correlation Functional sb98-1b SB98-1b Hyb-GGA Exchange-Correlation Functional sb98-1c SB98-1c Hyb-GGA Exchange-Correlation Functional sb98-2a SB98-2a Hyb-GGA Exchange-Correlation Functional sb98-2b SB98-2b Hyb-GGA Exchange-Correlation Functional sb98-2c SB98-2c Hyb-GGA Exchange-Correlation Functional sogga SOGGA Exchange + PBE Correlation Functional sogga11 SOGGA11 Exchange-Correlation Functional sogga11-x SOGGA11-X Hybrid Exchange-Correlation Functional sogga11-x-d3bj svwn SVWN3 (RPA) LSDA Functional teter93 TETER93 Exchange-Correlation Functional th-fc TH-FC GGA Exchange-Correlation Functional th-fcfo TH-FCFO GGA Exchange-Correlation Functional th-fco TH-FCO GGA Exchange-Correlation Functional th-fl TH-FL GGA Exchange-Correlation Functional th1 TH1 GGA Exchange-Correlation Functional th2 TH2 GGA Exchange-Correlation Functional th3 TH3 GGA Exchange-Correlation Functional th4 TH4 GGA Exchange-Correlation Functional tpss TPSS Meta-GGA XC Functional tpss-d3bj tpss-nl TPSS Meta-GGA XC Functional tpssh TPSSh Hyb-GGA Exchange-Correlation Functional tpssh-d3bj tpssh-nl TPSSh-nl Hyb-GGA Exchange-Correlation Functional tpsslyp1w TPSSLYP1W GGA Exchange-Correlation Functional vsxc VSXC Meta-GGA XC Functional vv10 VV10 GGA Exchange-Correlation Functional x1b95 X1B95 Hyb-GGA Exchange-Correlation Functional x3lyp X3LYP Hyb-GGA Exchange-Correlation Functional x3lyp-d3bj xb1k XB1K Hyb-GGA Exchange-Correlation Functional xlyp XLYP GGA Exchange-Correlation Functional xlyp-d3bj zlp ZLP GGA Exchange-Correlation Functional name calls method in Stanton and Gauss’s CFOUR program [manual] c4-scf Hartree–Fock (HF) c4-mp2 2nd-order Møller–Plesset perturbation theory (non-density-fitting) (MP2) c4-mp3 3rd-order Møller–Plesset perturbation theory (MP3) c4-mp4(sdq) 4th-order MP perturbation theory (MP4) less triples c4-mp4 full MP4 c4-cc2 approximate coupled cluster singles and doubles (CC2) c4-ccsd coupled cluster singles and doubles (CCSD) c4-cc3 approximate CC singles, doubles, and triples (CC3) c4-ccsd(t) CCSD with perturbative triples (CCSD(T)) c4-ccsdt coupled cluster singles, doubles, and triples (CCSDT) cfour expert full control over cfour program Examples: 1 2
>>> # [1] Analytic hf optimization >>> optimize('hf')
1 2 3 4
>>> # [2] Finite difference mp5 optimization with gradient >>> # printed to output file >>> e, wfn = opt('mp5', return_wfn='yes') >>> wfn.gradient().print_out()
1 2 3
>>> # [3] Forced finite difference hf optimization run in >>> # embarrassingly parallel fashion >>> optimize('hf', dertype='energy', mode='sow')
1 2
>>> # [4] Can automatically perform complete basis set extrapolations >>> optimize('MP2/cc-pV([D,T]+d)Z')
1 2 3 4
>>> # [5] Can automatically perform delta corrections that include extrapolations >>> # even with a user-defined extrapolation formula. See sample inputs named >>> # cbs-xtpl* for more examples of this input style >>> optimize("MP2/aug-cc-pv([d,t]+d)z + d:ccsd(t)/cc-pvdz", corl_scheme=myxtplfn_2)
1 2 3 4 5 6 7 8
>>> # [6] Get info like geometry, gradient, energy back after an >>> # optimization fails. Note that the energy and gradient >>> # correspond to the last optimization cycle, whereas the >>> # geometry (by default) is the anticipated *next* optimization step. >>> try: >>> optimize('hf/cc-pvtz') >>> except psi4.OptimizationConvergenceError as ex: >>> next_geom_coords_as_numpy_array = np.asarray(ex.wfn.molecule().geometry())
- name (string) –