Table of Contents

Minimization of functions

The minimization of general functions of one or more variables can be carried out using the command:

MINIMIZE, func, x$_1$[, x$_2$, x$_3$, …]

where func represents a function of up to 50 variables x$_1$, x$_2$, …. Two different optimization methods can be selected as described below which do or do not use numerical derivative information.

The optimization method, as well as finer control over func, can be chosen using the METHOD directive

METHOD, key [, key1=value, key2=value, …] [minimize:method]

where key defines the optimization method. Valid options for key are:

Options to these methods, key1, key2, …, are:

vscale=0 no scaling (not recommended)
vscale=1 optimization in the space of ln($x$)
vscale=2 optimization in space of initial value scaling, e.g., $x_1/x_{1i}$ (default)

Miscellaneous directives (separated by semicolons or linebreaks)

Examples

Geometry optimization

examples/min_optgeo.inp
***, Simple geometry optimization

basis=vdz

geometry={
O
H 1 r
H 1 r 2 theta}

r=1.8
theta=104

hf
mp2

{minimize,energy,r,theta}
---

Basis function optimizations

examples/basisopt_simple.inp
***, Optimization of 2 d functions

geometry={Ne}

dexp=[2.0,1.0]

basis={
sp,Ne,vdz;c;
d,Ne,dexp(1),dexp(2)
}

hf
mp2
eval=energy

minimize,eval,dexp(1),dexp(2)
---
examples/basisopt_proc.inp
***, Optimization of 2 d functions

geometry={Ne}

dexp=[2.0,1.0]

{minimize,eval,dexp(1),dexp(2)
method,bfgs,varscale=1,thresh=1e-5,proc=optd}


proc optd

basis={
sp,Ne,vdz;c;
d,Ne,dexp(1),dexp(2)
}

hf
mp2
eval=energy

endproc
examples/basisopt_cv.inp
***, MP2 optimization of core-valence cc-pCVDZ functions

geometry={Ne}

sexp=20.
pexp=30.

{minimize,ecv,sexp,pexp
method,bfgs,varscale=1,thresh=1e-5,proc=myopt}


proc myopt

basis={
spd,Ne,vdz;c;
s,Ne,sexp
p,Ne,pexp
}

hf
{mp2;core,1}
eval=energy

{mp2;core,0}
eall=energy

ecv=eall-eval

endproc

Intersection points

examples/min_intersect.inp
***, Try to find intersection seam of singlet-triplet CH2 as function of angle

basis=vdz

geometry={
C
H 1 r
H 1 r 2 theta}

r=1.6
angles=[70,75,80,85,90]

do i=1,#angles

 theta=angles(i)

 {minimize,ediff,r
 method,bfgs,thresh=1e-5,proc=findit}

 ropt(i)=r
 eseam(i)=etriplet
 converge(i)=ediff

enddo

table,angles,ropt,eseam,converge
digit,0,3,5,6


proc findit

 {hf;wf,8,2,2}
 etriplet=energy

 {hf;wf,8,1,0}
 esinglet=energy

 ediff=(etriplet-esinglet)**2

endproc
---