Skip to content

Examples geometry optimization

Juvenal Yosa edited this page Nov 20, 2026 · 4 revisions

On the GPU each optimization cycle starts from the orbitals of the previous one, already in device memory: a cycle of crambin (642 atoms) takes about 0.27 s on an A100, one of adenylate kinase (6 689 atoms) about 1.7 s.

Figures: calculations with the CPU build of v1.2.1-gpu, laptop (Intel Core i7-8850H), one core unless a caption says otherwise, or published numbers where the caption says so. Scripts: scripts/wiki_figures.

20. Optimization with the trust-region optimizer: TRUST

New keyword. The line searches of the default L-BFGS-B fail on the small noise of the MOZYME SCF. TRUST is a trust-region L-BFGS: the step radius is halved when a step went past the minimum along its direction, doubled when a limited step was still downhill, and no step is ever undone, so the localized orbitals of the last SCF stay valid for the next one. At the cycle limit it leaves a restart file (example 23). Full description: TRUST.

Copy next to the input: tests/data/mozyme_gpu_reference/1UAO_opt.pdb

PM7 MOZYME TRUST CYCLES=200 GEO_DAT="1UAO_opt.pdb" PDBOUT
Chignolin, optimization

Checked: runs with the CPU build of release v1.2-gpu (commit 323b6076, 2026-11-20), shortened to CYCLES=3.

TRUST and the default optimizer, 150 cycles each, from chignolin with hydrogens added again to its heavy atoms (gradient norm 246 at the start).

TRUST and the default optimizer, 150 cycles each, from chignolin with hydrogens added again to its heavy atoms (gradient norm 246 at the start).

21. Stop at a gradient norm

GNORM=n (standard MOPAC) ends the optimization when the gradient norm falls below n kcal/mol/Å.

Copy next to the input: tests/data/mozyme_gpu_reference/1UAO_opt.pdb

PM7 MOZYME TRUST GNORM=5 CYCLES=500 GEO_DAT="1UAO_opt.pdb" PDBOUT
Chignolin, optimization to GNORM 5

Checked: runs with the CPU build of release v1.2-gpu (commit 323b6076, 2026-11-20), shortened to CYCLES=3.

Gradient norm of the TRUST run of example 20, with the GNORM values 5 and 1.

Gradient norm of the TRUST run of example 20, with the GNORM values 5 and 1.

22. Smooth hydrogen bonds: HB-SMOOTH

New keyword. The PM6-DH+ / PM7 hydrogen-bond correction has kinks in its angular terms; an optimizer or a dynamics run can get stuck on them. HB-SMOOTH replaces them by smooth functions (the QM/MM driver always uses it).

Copy next to the input: tests/data/mozyme_gpu_reference/1UAO_opt.pdb

PM7 MOZYME TRUST HB-SMOOTH CYCLES=200 GEO_DAT="1UAO_opt.pdb" PDBOUT
Chignolin, optimization with smooth H-bond terms

Checked: runs with the CPU build of release v1.2-gpu (commit 323b6076, 2026-11-20), shortened to CYCLES=3.

Water dimer: the hydrogen-bond correction and the heat against the O···O distance

Water dimer: the hydrogen-bond correction and the heat against the O···O distance. The PM7 correction drops to zero at 7.0 Å; with HB-SMOOTH it is switched off over the last ångström.

23. Continue an optimization that hit the cycle limit

MOPAC leaves a restart file <input>.res when an optimization stops at the cycle limit (with TRUST since commit b46602aa). Run the same input with RESTART; CYCLES then counts the further cycles. The default optimizer takes the geometry and its Hessian information from the file; TRUST takes the geometry and starts with an empty memory. In both cases the GPU starts a fresh SCF.

Copy next to the input: tests/data/mozyme_gpu_reference/1UAO_opt.pdb

PM7 MOZYME TRUST CYCLES=200 RESTART GEO_DAT="1UAO_opt.pdb" PDBOUT
Chignolin, optimization continued

At the cycle limit MOPAC writes no ARC and no PDBOUT file; the output then ends with the last geometry as a complete MOPAC data set, after CURRENT VALUE OF HEAT OF FORMATION, which can also be copied into a new input.

Checked: with a CPU build that includes commit b46602aa: TRUST stopped at CYCLES=3 and wrote the restart file; TRUST with RESTART ran cycles 4–6; then the default optimizer with RESTART ran cycles 7–8.

An optimization in two jobs: TRUST CYCLES=25, then RESTART with 25 more cycles (start as in example 20).

An optimization in two jobs: TRUST CYCLES=25, then RESTART with 25 more cycles (start as in example 20).

24. Write the final geometry as a PDB file

After an optimization that stopped at the cycle limit, a 1SCF RESTART job reads the last geometry from the restart file and writes it with PDBOUT.

Copy next to the input: tests/data/mozyme_gpu_reference/1UAO_opt.pdb

PM7 MOZYME 1SCF RESTART PDBOUT GEO_DAT="1UAO_opt.pdb"
Final geometry of the optimization

Checked: with a CPU build that includes commit b46602aa, after the runs of example 23; it wrote <input>.pdb and <input>.arc.

Start (grey) and final.pdb of the runs of example 23, and the rms displacement of each residue.

Start (grey) and final.pdb of the runs of example 23, and the rms displacement of each residue.

25. Optimize part of a protein

OPT("label"=d) (standard MOPAC) optimizes only the atoms within d Å of the atoms whose PDB label contains the text; the rest stays fixed. Here: within 4 Å of residue 46 of crambin.

Copy next to the input: tests/data/mozyme_gpu_reference/1CRN_opt.pdb

PM7 MOZYME TRUST CYCLES=100 OPT("A46"=4) GEO_DAT="1CRN_opt.pdb" PDBOUT
Crambin, around residue 46

Checked: runs with the CPU build of release v1.2-gpu (commit 323b6076, 2026-11-20), shortened to CYCLES=1.

The atoms that OPT(A46=4) lets move (orange carbons) and the heat over the cycles

The atoms that OPT("A46"=4) lets move (orange carbons) and the heat over the cycles; TRUST converged after 10 cycles.

Clone this wiki locally