# optimize

Perform geometry optimization.

optimize(
structure(molecule=water)
xtb()
)


Coordinates can be frozen to their original positions:

optimize(
structure(molecule=water)
xtb()
bond(atoms=[1,2] frozen=true)
)


or set to optimize to a target value:

optimize(
structure(molecule=water)
xtb()
bond(atoms=[1,2] value = 1.0 angstrom)
)


The gradient subcommand can also be used to allow for numerical gradients.

optimize(
structure(molecule=water)
xtb()
numerical = true
)
)

This command can appear in the global context.

### Options

coordinates

Coordinates for optimization.

energy_change

Convergence threshold on the energy (in a.u.) for geometry optimization.

• The type is real
• The default is 1e-6
• The value must be positive
gradient_max

Convergence threshold on the max element of gradient (in a.u.) for geometry optimization.

• The type is real
• The default is 3e-4
• The value must be positive
gradient_rms

Convergence threshold on the root-mean-square of gradient (in a.u.) for geometry optimization.

• The type is real
• The default is 4.5e-4
• The value must be positive
hessian_eigenvalue_min

Minimum value to clamp eigenvalues of hessian.

This option is deprecated.

• The type is real
• The default is 1e-3
• The value must be nonnegative
hessian_eigenvalue_zero

Threshold to consider eigenvalues as zero during hessian inversion.

• The type is real
• The default is 1e-9
• The value must be nonnegative
hessian_update

Overide automatic choice of hessian update scheme. For standard geometry optimization bfgs is used. For transition state optimization bofill is used.

• The type is string
• The default is bfgs
• The value must be one of:
• bfgs - Broyden-Fletcher-Goldfarb-Shanno
• psb - Powell-Symmetric-Broyden
• murtagh_sargent - Murtagh-Sargent
• bofill - Bofill
• bakken_helgaker - Bakken-Helgaker
• farkas_schlegel - Farkas-Schlegel
• none - None
linear_angle_threshold

Angles greater than this value are treated as linear angles.

• The type is quantity
• The default is 175 degree
load

Name of result set from which to load the hessian.

• The type is string
• There is no default value.
max_coordinate_system_rebuilds

Maximum number of coordintes system re-builds. During the course of an optimization, the geometry might change such that the internal coordinates change e.g. a bond-angle becomes linear or a new bond should be formed. In these cases we must rebuild the coordinate system and restart optimization. Currently, the Hessian is also reconstructed from a model hessian rather than using the updated Hessian.

• The type is int
• The default is 10
• The value must be nonnegative
max_iter

Maximum number of optimization steps.

• The type is int
• The default is 300
• The value must be positive
method

Optimization method.

• The type is string
• The default is quasi_newton
• The value must be one of:
name

Specify the name of a set of results.

This option is deprecated.

• The type is string
• There is no default value.
no_fail

If set to true, the program will continue its execution even if the geometry optimization does not converge.

• The type is bool
• The default is false
print_level

Print level.

• The type is int
• There is no default value.
• The value must be one of:
• -2 - No output
• -1 - Minimum output
• 0 - Output that doesn't scale with system size
• 1 - Output that scales linearly with system size
• 2 - (Debugging) output that scales quadratically with system size
• 3 - (Debugging) output that scales cubically with system size
save_coordinates

Specify name of the xyz file containing the coordinates from each step of the optimization.

optimize(
structure(molecule=water)
xtb()
save_coordinates = 'water_optimization.xyz'
)

• The type is string
• There is no default value.
step_max

Convergence threshold on the max element of the step (in a.u.) for geometry optimization.

• The type is real
• The default is 1.2e-3
• The value must be positive
step_rms

Convergence threshold on the root-mean-square of the step (in a.u.) for geometry optimization.

• The type is real
• The default is 1.8e-3
• The value must be positive
trust_radius

• The type is quantity
• The default is 0.2 bohr
• The value must be positive
trust_radius_max

• The type is quantity
• The default is 0.6 bohr
• The value must be positive
trust_radius_min

• The type is quantity
• The default is 1e-6 bohr
• The value must be positive
ts

Run transition state (TS) optimization.

guess := structure(
xyz = [[C, -1.7750, -0.5026, 0.0000],
[C, -0.4916,  0.1859, 0.0000],
[C,  0.6671, -0.5360, 0.0000],
[H, -0.4532,  1.2741, 0.0000],
[H,  1.6489, -0.0536, 0.0000],
[H, -2.6886,  0.1279, 0.0000],
[O,  0.7308, -1.8618, 0.0000],
[O, -1.8897, -1.7305, 0.0000],
[H, -0.5902, -2.2396, 0.0000]])

ts_xtb := optimize(
ts = true
xtb()
)


TS optimization follows the most negative eigenvector of the Hessian uphill, and the remaining eigenvectors downhill. By default, the Hessian will be computed using the supplied energy command. It is also possible to load a Hessian from a cheaper calculation. Here we use the xtb Hessian as a starting guess for a hf based TS optimization:

guess := structure(
xyz =   [[C, -1.7750, -0.5026, 0.0000],
[C, -0.4916,  0.1859, 0.0000],
[C,  0.6671, -0.5360, 0.0000],
[H, -0.4532,  1.2741, 0.0000],
[H,  1.6489, -0.0536, 0.0000],
[H, -2.6886,  0.1279, 0.0000],
[O,  0.7308, -1.8618, 0.0000],
[O, -1.8897, -1.7305, 0.0000],
[H, -0.5902, -2.2396, 0.0000]])

xtb_hess := hessian(
xtb()
)

ts_hf_xtb_hess := optimize(
ts = true
hf(ao='STO-3G')
)


Enabling this option sets the hessian_update scheme to bofill, the coordinates to irc, the trust_radius to 0.01 angstrom, and the trust_radius_max to 0.05 angstrom. The user can override these by explicitly specifying them in input.

• The type is bool
• The default is false
ts_trust_radius

The default initial trust radius for TS optimization. If ts = true and trust_radius is not specified, then ts_trust_radius is used for the initial trust radius.

• The type is quantity
• The default is 0.01 angstrom
• The value must be positive
ts_trust_radius_max

The default maximum trust radius for TS optimization. If ts = true and trust_radius_max is not specified, then ts_trust_radius_max is used for the maximum trust radius.

• The type is quantity
• The default is 0.05 angstrom
• The value must be positive
xyz_output

Name of the XYZ file containing the optimized geometry.

• The type is string
• There is no default value.