This protocol implements geometry optimization. There is a lot of options provided but the default setup was tuned to provide good results in almost any system.

The default setup is applicable to wide range of systems - the only adjustment needed might be setting the convergence thersholds using the opt_quality keyword. The default value of 1.0 is reasonable for common optimization of rigid molecules, for flexible systems or non-covalent interactions, tighter convergence criteria are needed for obtaining accurate geometroies. It is recommended to set the opt_quality to 0.1.

The protocol implements optimization in Cartesian (default), redundant internal and z-matrix coordinates. Only the optimization in Cartesian coordinates should be considered stable and robust, the internal coordinates are under development and often fail in some cases.

Cuby can now build z-matrix automatically from cartesian coordinates but it is not guaranteed that the generated z-matrix will work well for optimization. The use of z-matrices is thus recommended only for cases where user-supplied z-matrix is used. The advantage of z-matrices is that it is easily possible to optimize only specified internal coordinates.

Cuby implements the P-LBFGS algorithm[1] that can accelerate the convergence of the optimization by calculating multiple points in parallel in each step. For details, refer to teh example below an to the original paper.[1] To use the optimizer, it is necessary to complile the linear algebra extension with a support of the UMFPACK library, the details are described on the page on installation.

- coordinates
- hessian_estimate
- history_file
- history_freq
- history_selection
- init_hessian_lookup_file
- lbfgs_n
- linesearch
- maxcycles
- opt_auto_restart
- opt_convlimit_e
- opt_convlimit_max_g
- opt_convlimit_rms_g
- opt_diagonal_h0
- opt_freeze_cartesian
- opt_qn_update_formula
- opt_quality
- opt_refuse_steps
- opt_tr_mode
- opt_tr_update
- opt_tr_update
- optimize_print
- optimize_region
- optimize_ts
- optimizer
- plbfgs_colors
- plbfgs_init_d
- redcoord_all_torsions
- redcoord_extra_contacts
- redcoord_freeze_class
- remove_rotation
- remove_translation
- restart_file
- restart_file_append
- trust_radius
- trust_radius_max
- trust_radius_min

The following examples, along with all other files needed to run them, can be found in the directory cuby4/protocols/optimize/examples

```
#===============================================================================
# Optimize protocol example 1 - basic input
#===============================================================================
# Simple geometry optimization of benzene dimer from the S66 data set
# The calculation produces these additional files:
# 1) optimized.xyz - the optimized geometry
# 2) history_optimize_example_01.xyz - record of all the steps
job: optimize
# This keyword scales all the three convergence thresholds. The default value,
# 1.0, might not yield accurate enough geometry because the potential of
# the intermolecular interaction in benzene dimer is rather weak and flat.
opt_quality: 0.1
# Geometry from the database
geometry: S66:benzene_dimer_stack
# Calculation
interface: dftb
method: scc-dftb
dftb_dispersion: yes
```

```
#===============================================================================
# Optimize protocol example 2 - Partial optimization
#===============================================================================
# Only a part of the system can be optimized, in this case we optimize just
# some residues in a peptide chain.
job: optimize
geometry: PDB:1AQG # PDB from Cuby's internal database of small peptides
# Optimize only residues no. 5 and 6
optimize_region: ":5,6"
# Any selection can be used, use the following to optimize only hydrogens in
# the peptide:
#optimize_region: "@H"
# Calculation - MM in Amber, default setup
interface: amber
# Save the optimized geometry in PDB format
restart_file: optimized.pdb
```

```
#===============================================================================
# Optimize protocol example 3 - parallel optimizer P-LBFGS
#===============================================================================
# This example demonstrates the use of the parallel optimizer P-LBFGS
job: optimize
opt_quality: 0.1
geometry: ace-ala-nme.pdb # ACE-ALA-NME peptide
# Parallel optimizer setup
optimizer: plbfgs
linesearch: cubic # The optimizer was designed to be used with a linesearch
plbfgs_colors: 1 # One 'color' per step, results into 4 calculations / step
cuby_threads: 4 # Run those 4 calculations in parallel
# Calculation - MM in Amber, default setup
interface: amber
```

```
#===============================================================================
# Optimize protocol example 4 - transition state optimization
#===============================================================================
# Simple optimization of a transition state.
# Bond rotation in propane calculated at PM6 level in MOPAC.
job: optimize
# Only the trim_hessian optimizer can be used
optimizer: trim_hessian
# This switches on the TS optimization
optimize_ts: lowest_eigenvector
# Because we use a method for which analytical Hessian is not available,
# the calculation is wrapped in the numerical_hessian interface
interface: numerical_hessian
calculation:
interface: mopac
mopac_precise: yes
method: pm6
# Propane with one methyl rotated out of equilibrum
geometry: |
C 1.185982 0.229141 0.070276
C -0.060586 -0.617450 -0.182669
C -1.347745 0.182277 0.010546
H 2.100284 -0.357414 -0.070830
H 1.234407 1.086263 -0.611544
H 1.202201 0.625393 1.092275
H -0.028969 -1.030374 -1.210857
H -0.060467 -1.493919 0.495992
H -1.164166 1.260751 -0.054713
H -2.092020 -0.071474 -0.752003
H -1.799149 -0.014287 0.989612
```