tsopt (transition-state optimization)¶
tsopt optimizes a transition-state (TS) candidate on a layered ML/MM enzyme model to a first-order saddle point, then computes the Hessian at the final geometry and counts its imaginary frequencies (n_imag). A successful TS optimization gives one imaginary mode along the reaction coordinate.
What it is for¶
Refining a TS candidate: turn the highest-energy image (HEI) of
path-opt/path-search, or the top of ascan, into an optimized TS.Checking a structure you built: confirm that a hand-made candidate is a TS (n_imag = 1) and watch its reaction mode as an animation.
Rerunning the TS step of
all: optimize the TS of anallrun again on its own, with different settings.
The ML region uses UMA, Meta’s pretrained machine-learning interatomic potential (MLIP), by default; -b/--backend also selects ORB, MACE, AIMNet2, or DFT. The MM region uses the Amber parameters in --parm7.
If you do not have a candidate yet, make one first:
What you have |
Command that gives a candidate |
|---|---|
The reactant and the product |
|
Only the reactant, or a bond you want to drive |
|
Optimize the candidate with tsopt, then follow the TS with irc. The all command runs all of these steps in one go.
Examples¶
In these examples, ts_guess.pdb is the full-system candidate that matches real.parm7, and ml_region.pdb defines the ML region.
1. Default run (RS-P-RFO)¶
Give the charge and the spin multiplicity of the ML region explicitly.
mlmm tsopt -i ts_guess.pdb --parm7 real.parm7 --model-pdb ml_region.pdb \
-q 0 -m 1 --out-dir ./result_tsopt
2. Dimer method¶
Use this when computing the full Hessian again and again is too expensive, or to try a second method on a difficult candidate.
mlmm tsopt -i ts_guess.pdb --parm7 real.parm7 --model-pdb ml_region.pdb \
-q 0 -m 1 --opt-mode dimer --out-dir ./result_tsopt_dimer
3. Remove extra imaginary modes¶
Add --flatten when the candidate has more than one imaginary frequency.
mlmm tsopt -i ts_guess.pdb --parm7 real.parm7 --model-pdb ml_region.pdb \
-q 0 -m 1 --flatten --out-dir ./result_tsopt_flatten
4. Start from a saved Hessian¶
Read a Hessian saved with --dump-hess at this same geometry (for example by freq on ts_guess.pdb), instead of computing it again.
mlmm tsopt -i ts_guess.pdb --parm7 real.parm7 --model-pdb ml_region.pdb \
-q 0 -m 1 --read-hess ts_guess_hess.npy --out-dir ./result_tsopt
How it works¶
Reading the model and freezing the boundary: the ML region comes from
--model-pdband the Movable-MM and Frozen-MM layers from the B-factors of the input PDB; the charge of the ML region comes from-qor-l. The Frozen-MM layer and the atoms in--freeze-atomsstay fixed, and the final Hessian covers the atoms chosen by--active-dof-mode(PHVA: partial Hessian vibrational analysis). An.xyzcandidate needs the full-system PDB with--ref-pdbfor the atom order and the layers.Choosing the optimizer (
--opt-mode):hess(default) runs RS-P-RFO (restricted-step partitioned rational function optimization), which uses the full Hessian;rsirfoandtrimselect RS-I-RFO (restricted-step image RFO) and TRIM (trust-region image minimization).dimer(orgrad) runs the Hessian-guided Dimer method, which follows the lowest mode with gradients and refreshes its direction from an exact Hessian at intervals.Climbing along the reaction mode: the optimizer goes uphill along the reaction mode and downhill along every other direction until the convergence criteria (
--thresh, defaultbaker) are met.bakerneeds all five at once (atomic units): max force below 3 × 10⁻⁴, RMS force below 2 × 10⁻⁴, max step below 3 × 10⁻⁴, RMS step below 2 × 10⁻⁴, and an energy change below 10⁻⁶ hartree, all tighter than Gaussian’s default (gau). RS-P-RFO updates the Hessian with the Bofill formula and keeps each step within a trust radius of 0.1 bohr (rsirfo.trust_max). With microiteration (--microiter, on by default), each macro step moves the ML region and the boundary MM atoms bonded to it, and the movable MM atoms then relax with L-BFGS. With microiteration, the optimizer’s own lines start with[microiter]; Dimer and--no-microiterprint the[tsopt]form.Final check: after convergence,
tsoptcomputes the Hessian at the final geometry, counts n_imag, and writes each imaginary mode as an animation. Frozen atoms are handled as infreq.Removing extra imaginary modes (only with
--flatten): if more than one imaginary mode remains,tsoptdisplaces the structure along the extra modes and optimizes again, until one mode is left or the round limit is reached. In Dimer mode, each round also computes the exact Hessian again, refreshes the dimer direction, and runs a short Dimer + L-BFGS segment.
Reading the TS result¶
How the run ended decides what you get.
How it ended |
Console line |
What |
What |
|---|---|---|---|
Converged |
|
Final geometry, n_imag, and the imaginary modes |
Continues to IRC if n_imag ≥ 1; stops before IRC if n_imag = 0 |
Stopped on an energy plateau |
|
Final geometry and n_imag |
Stops before IRC |
Reached |
|
Final geometry; no Hessian |
Stops before IRC |
Converged with |
|
Final geometry; no Hessian |
Stops before IRC, because the reaction mode is unchecked |
The final Hessian failed |
|
Final geometry, with |
Stops before IRC |
Read n_imag as follows:
n_imag |
Meaning |
|---|---|
1 |
A first-order saddle point. Check that the mode moves the intended atoms, then run |
0 |
No imaginary mode: the structure has relaxed toward a minimum. |
2 or more |
A higher-order saddle point: extra imaginary modes remain. |
A mode counts as imaginary when ν < −5.00 cm⁻¹. Values between −5.00 and 0 cm⁻¹ are treated as numerical noise.
Wrong imaginary-mode count after optimization¶
If n_imag is not 1, or the mode does not move the atoms of the intended reaction, try the following. The remedies can be combined.
Result |
What to try |
|---|---|
n_imag = 0 |
The candidate is not near a saddle. Get a better candidate from a path search or a scan. In |
n_imag ≥ 2 |
Watch each mode. Re-optimize with |
One mode, but the wrong motion |
Check which atoms move, and start from a candidate closer to the intended reaction. |
For example, to retry in fp64 with flattening on:
mlmm tsopt -i ts_guess.pdb --parm7 real.parm7 --model-pdb ml_region.pdb -q 0 -m 1 \
--precision fp64 --flatten -o result_tsopt
For more ideas, see When the TS search fails; for other failures, see Troubleshooting.
Output files¶
When the run finishes, --out-dir (default ./result_tsopt/) contains:
result_tsopt/
├─ final_geometry.xyz # Final geometry (always written)
├─ final_geometry.pdb # Same, as PDB (B-factors mark the layers)
├─ vib/
│ ├─ imag_01_-385.20cm-1_trj.xyz # Animation of each imaginary mode
│ └─ imag_01_-385.20cm-1.pdb # Same, as PDB
├─ optimization_all_trj.xyz # Optimization trajectory (--dump)
├─ optimization_all.pdb # Same, as PDB (--dump)
├─ .dimer_mode.dat # Current Dimer direction (Dimer only)
└─ result.json # Summary (--out-json)
mmCIF input, and PDB input too large for the PDB columns, also get .cif files that keep the original identifiers.
Final geometry:
final_geometry.*is the TS to pass toirc. Infinal_geometry.pdb, the B-factor is 0 for the ML region, 10 for movable MM atoms, and 20 for frozen MM atoms.Reaction mode: open
vib/imag_*_trj.xyzin PyMOL or VMD and check that the atoms move along the bonds that form or break.Summary: with
--out-json,result.jsonrecords how the run ended (optimization_status:converged,stalled, ornot_converged),hessian_status, and n_imag.
Main options¶
The options shared by every ML/MM calculation command are explained once in ML/MM options; the table below lists only the options specific to tsopt.
Option |
Type |
Default |
Description |
|---|---|---|---|
|
path |
(required) |
One full-system structure ( |
|
integer |
|
Charge of the ML region. Required unless |
|
integer |
|
Spin multiplicity (2S+1) of the ML region |
|
text |
|
Total charge of unknown ligands or a charge per residue name (for example |
|
path |
|
Output directory |
|
text |
|
Backend for the ML region ( |
|
|
|
Optimizer: RS-P-RFO / Dimer / RS-I-RFO / TRIM ( |
|
path |
|
Reference direction for the reaction mode ( |
|
flag |
|
Alternate each macro TS step with an L-BFGS relaxation of the movable MM atoms. Not used by Dimer; with |
|
|
|
How the ML-region Hessian is computed |
|
flag |
|
Remove extra imaginary modes |
|
text |
|
Extra atoms to freeze (1-based, comma-separated, for example |
|
|
|
Atoms in the final frequency analysis: all atoms / ML region only / ML region and movable MM atoms / every atom outside the frozen layer |
|
preset |
|
Convergence criteria ( |
|
integer |
|
Maximum number of optimization cycles |
|
flag |
|
Stop when the energy stops changing (range below 1e-4 hartree over 50 cycles), then compute the Hessian |
|
flag |
|
Skip the final Hessian after convergence |
|
path |
|
Start from the Hessian in a |
|
path |
|
Save the final-geometry Hessian to a |
|
|
per backend ( |
Backend precision. |
|
|
|
Optimization coordinates: Cartesian / redundant internal / delocalized internal (DLC) / translation-rotation internal (TRIC) |
|
path |
|
YAML file applied before the command-line options |
|
flag |
|
Write the optimization trajectory |
|
flag |
|
Write a summary to |
For every option, run mlmm tsopt --help-advanced or see the generated CLI reference.
Note: in YAML, Dimer reads the
hessian_dimer:block, RS-P-RFO, RS-I-RFO, and TRIM share thersirfo:block, and microiteration readsmicroiter:. Every key is listed underrsirfo,hessian_dimer, andmicroiterin the YAML Reference.
Note: if the reaction mode switches to another Hessian eigenvector (root) during the optimization, set
rsirfo.track_mode_by_overlap: true.
Note: if convergence is slow, lower
rsirfo.hessian_recalc(default500) to 50–200 to recompute the exact Hessian more often, at the cost of more Hessian evaluations.
Notes¶
When --flatten is on¶
--flatten is off by default. One YAML key, hessian_dimer.flatten_max_iter, sets the number of flatten rounds for every optimizer, Dimer and RS-P-RFO / RS-I-RFO / TRIM alike.
Command line |
Flatten rounds |
|---|---|
Neither |
|
|
The YAML value if it is positive, otherwise |
|
|
--flatten removes extra imaginary modes. It cannot create a reaction mode that is missing; when n_imag = 0, get a better candidate instead.
Other notes¶
Uphill steps are always allowed: a saddle search has to go uphill along the reaction mode, so
tsoptkeepsreject_uphill: falseeven if YAML sets it.--reject-uphill/--no-reject-uphillbelongs tooptand to the endpoint optimization inall.Barrier from a product-side scan: if the scan that made this candidate started from the product, read its barrier as described in
scan→ Barrier sign.One root: the optimizer climbs along one root (
0is the lowest eigenvalue). Set it as a one-item list such asrsirfo.roots: [0]; Dimer useshessian_dimer.root.tsopthas no--rootflag.Other RS-P-RFO settings:
trust_norm: max_atomlimits the displacement of each atom instead of the whole step (Cartesian coordinates only), andhessian_update: ts_bfgsselects the TS-BFGS update instead of Bofill. Neither changes the trust radii.Extra searches are opt-in: after convergence,
tsoptdoes not search further on its own, even when n_imag is not 1. Use--flatten, or setrsirfo.saddle_recovery_max_cyclesabove0(default0) to let RS-P-RFO / RS-I-RFO / TRIM step uphill when the exact Hessian shows no imaginary mode.Flags that cannot be combined:
--skip-final-freqwith--dump-hess;--uma-workers(parallel MLIP workers) above 1 with--hessian-calc-mode Analytical.--skip-final-freqand--flatten: with RS-P-RFO / RS-I-RFO / TRIM,--skip-final-freqalso skips--flatten, which needs the final Hessian.--read-hesswith RS-P-RFO / RS-I-RFO / TRIM: the file replaces the first exact Hessian, so keeprsirfo.hessian_initat its defaultcalc; other values stop with an error.MM relaxation threshold in microiteration:
microiter.micro_threshsets the convergence criteria of the MM relaxation; when it is unset, the MM relaxation uses the same criteria as the macro step.Energy plateau and microiteration:
--stop-plateauwatches the macro steps; it never stops the MM relaxation.--ref-modeand frozen atoms:--ref-modeonly gives the reaction direction from the MEP; it does not change how frozen boundaries are treated.At least one atom must move: if every atom is frozen,
tsoptstops with an error.Errors: invalid input or structure, or an error that keeps the optimizer from continuing, stops the run with an error message. Only the files written up to that point remain.
See also¶
irc — follow the reaction path from the optimized TS
freq — full vibrational analysis and thermochemistry
path-opt / path-search / scan — make a TS candidate
all — model building, MEP, TS optimization, IRC, and frequencies in one run
Tips for studying reaction mechanisms — what to try when the TS search fails
Troubleshooting — when a run fails
YAML Reference — every
rsirfo,hessian_dimer, andmicroitersettingGlossary — TS, Dimer, Hessian, and other terms
Exit codes — what each exit status means