Refine an MLIP TS with DFT¶
Once MLIP has found a reasonable pathway, pdb2reaction can take its TS straight into a DFT TS optimization. It runs the TS optimization → IRC → endpoint optimization → frequency workflow with GPU-accelerated DFT through GPU4PySCF.
The MLIP pathway search is the main tool; DFT is an add-on that checks the TS candidate you found with MLIP.
What it is for¶
Refine the TS at the DFT level: run TS optimization → IRC → endpoint optimization → frequencies with DFT (
-b dft).Add DFT energies to an MLIP run: run DFT single points on the MLIP R, TS, and P (
--dft).
Workflow¶
Explore with MLIP: generate pathways, try variants, and pick the most promising TS candidate.
Refine with DFT: run TS-only mode on that TS with
-b dft. The command is example 2 in Examples.Check: as in an MLIP run, a successful TS optimization gives one imaginary mode along the reaction coordinate.
Scientific status: successunder====== Pipeline summary ======shows that every requested stage converged. Then check the mode and the IRC endpoints as in Checking the result.
Examples¶
1. Search on a small model with MLIP¶
Run the MLIP search on a model small enough for DFT. The TS it writes, result_mlip/segments/seg_01/ts.pdb, is the input of example 2. seg_01 is the first reaction segment; if there are several, pick the one for the step you want to refine.
pdb2reaction all -i 1.R.pdb 3.P.pdb -c 'SAM,GPP,MG' -l 'SAM:1,GPP:-3' \
-r 0 --selected-resn '44,63,186' --tsopt -o ./result_mlip
Make the model smaller explains how -r 0 --selected-resn builds this model.
2. Refine the TS with DFT¶
Pass the TS from example 1 as the only input, which selects TS-only mode; this needs the DFT extra.
pdb2reaction all -i result_mlip/segments/seg_01/ts.pdb -l 'SAM:1,GPP:-3' \
--tsopt --thermo -b dft -o ./result_dft
Keep the model under about 300 atoms¶
DFT optimization is practical up to roughly 300 atoms. Compare 300 with the atom count including the cap hydrogens, N + M from the console lines in Check the model. If you build a model of that size before the MLIP search, the TS it gives can go to DFT as is.
For ways to trim the model, see Make the model smaller; to fix the boundary atoms of a model you trimmed by hand, see Freeze atoms and restrain distances.
-b dft and --dft¶
Option |
What DFT computes |
When to use it |
|---|---|---|
|
Every calculation in the run (MEP search, TS optimization, IRC, endpoint optimization, frequencies) |
Refine and check a TS candidate at the DFT level |
|
Single points on the R, TS, and P from the MLIP run ( |
Get DFT energies on MLIP geometries |
-b dft works in 11 commands: all, opt, tsopt, irc, freq, scan, scan2d, scan3d, path-opt, path-search, and sp.
Output files¶
With -b dft, the output has the same layout as an MLIP run in the same mode; for TS-only mode, see Expected output. --dft adds these files:
File |
Content |
|---|---|
|
DFT single-point result for each state |
|
DFT energy diagram on the MLIP geometries |
|
DFT energy plus the MLIP thermal correction (with |
|
The same diagrams over all segments, at the top of the output directory |
Main options¶
Option |
Description |
Default |
|---|---|---|
|
Use DFT as the calculator (GPU4PySCF; CPU PySCF with |
|
|
Functional and basis as |
|
|
Implicit solvent for |
|
|
Add DFT single points on R, TS, and P ( |
|
|
Implicit solvent for the |
|
The other DFT options are listed in the all reference.
Note: In YAML, the
-b dftsettings go undercalc.dft, and the--dftsingle points read the top-leveldftsection, as thedftcommand does. In either block,pyscfpasses attributes to PySCF objects by name, for examplemf: {level_shift: 0.2}for a hard-to-converge SCF (calc.dft.pyscfordft.pyscf). See YAML Reference and the dft section.
Notes¶
DFT extra: install it with
pip install "pdb2reaction[dft]"for thecu130orcu132PyTorch wheel, or withpip install "pdb2reaction[dft-cuda12]"forcu126. Without a GPU, add--dft-engine cpu.Charge: removing residues changes the total charge. Check
Total active site model chargein the console output of example 1 before the DFT run.Cap hydrogens:
ts.pdbkeeps the cap hydrogens (LKH/HL) of the model, so their parent atoms stay frozen in the DFT run as in the MLIP run.Combinations:
-b dftand--dftcannot be used together, and the run stops with an error at startup. To add DFT single points after a-b dftrun, runpdb2reaction sp -b dftorpdb2reaction dftas a separate job.--dftand--thermorequire--tsopt.File and key names: with
-b dft, the diagrams keep the file namesenergy_diagram_MLIP.pngandenergy_diagram_G_MLIP.png(with--thermo), and thesummary.jsonblocks keep the namesmlipandgibbs_mlip. Both hold the DFT values, and the plot title shows DFT.Memory and threads:
-b dftand--dftuse the same low-memory mode,--dft-nprocs, and--dft-memoryaspdb2reaction dft. If GPU memory runs out, trim the model; if--dftruns out of memory, drop--dftand runpdb2reaction dftseparately.SCF not converged: an SCF that does not converge even from a fresh guess stops the run with
PySCF SCF did not converge with either the reused density or a fresh guess.. Density fitting (--no-dft-low-memory), when memory allows, or a YAML level shift can help it converge.Stepwise grid:
--scf-stepwise-grid(on by default) first converges the first SCF of a run on grid level 1 with a tolerance of 1e-6, then on the requested grid and tolerance from that density; later SCFs start from the previous density as usual. The gain depends on the system; small systems can get slightly slower, and--no-scf-stepwise-gridturns it off. It is skipped when the requested grid level is 1 or lower, or whenpyscf.grids.atom_gridsets the grid directly. If the coarse stage does not converge, the normal SCF runs.SCF checkpoints: they are off by default because the files can be very large.
--save-scf-checkpointsaves them, and--scf-checkpoint PATHchooses the file. Without a path, commands other thanallwrite<out-dir>/_work/dft_scf/state.chk, andallsaves one file per state. A checkpoint is used only when its method, atom order, and coordinates match the current structure.
See also¶
dft: DFT single point with population analysissp: single-point energy and forces with any backendQuickstart: TS-only mode: check a TS candidate with
all --tsoptBuilding the cluster model: build, trim, and extend the active-site model
Installation: step 7 installs the DFT extra
MLIP Backends: choosing a backend
Troubleshooting: what to do when a run fails