terco input files
terco takes its settings either as command-line flags or from a TOML file:
terco water.xyz -b def2-svp -f wb97x-v --grad # flags
terco water.toml # the same run from a file
terco water.toml --grad # file, plus a flag on top
The file is the same run written down: every key below is one command-line option, parsed and checked by the same code. Flags given after the file override its keys. A key that is not in this list, or a value of the wrong type, is an error that names the key; nothing is silently ignored.
Example
[molecule]
geometry = "water.xyz" # relative to this file
charge = 0
unpaired = 0 # unpaired electrons, not the multiplicity
[basis]
main = "def2-svp"
[scf]
functional = "wb97x-v"
density_fitted = true
[solvation]
model = "cpcm"
epsilon = 78.3553
[driver]
gradient = true
[output]
json = "water.json"
Rules
Sections and names. Keys are
snake_caseand grouped by what they configure. Each maps to exactly one flag (tables below).Defaults. A key left out takes the flag’s default, including the defaults that depend on the system (a
.CHRG/.UHFfile, thesadqguess for an ion, the--opt-zero-modesrule). An empty section is allowed and changes nothing.Paths (
geometry, the[basis]keys when they are files,output.json,output.save_scf,scf.restart,opt.neb.product,opt.neb.via) are relative to the TOML file’s directory, not the current directory, so a file and its inputs can move together. A basis name (def2-svp) is looked up exactly as on the command line.Flags override the file.
terco run.toml --grid 4runs with grid 4 whatever[dft] gridsays. A switch set totruein the file cannot be turned off from the command line (there is no--no-grad); leave it out of the file instead.incrementalis on by default and has both forms:falseis--no-incremental, and the file’sfalsewith a command line--incremental(or the reverse) is refused as a contradiction.The driver is explicit.
[driver]holds the switches that choose what runs after the SCF; there is no “section present means on”.The resolved input is recorded. The JSON summary (
[output] jsonor--json) has an"input"object in these sections, with every key as the run used it: from the file, from a flag that overrode it, or the flag’s declared default. Keys whose default is decided from the system (the charge, the guess, …) appear only when given. Written back as TOML it reruns the same calculation.--versionand--helpstay command-line only.
Keys
[molecule]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
string |
(positional) |
|
|
integer |
|
molecular charge |
|
integer |
|
number of unpaired electrons |
[basis]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
string |
|
orbital basis: BSE JSON file or a basis name |
|
string |
|
effective core potential: BSE JSON file or a basis name, overriding auto-attach from |
|
string |
|
auxiliary basis of RI-MP2, RI-CCSD and RI-CCSD(T) (cc-pvdz-rifit whatever the orbital basis: give the RI fitting set that matches it) |
|
string |
|
J/K fitting basis for |
|
bool |
|
Cartesian AOs even for a spherical basis |
|
float |
|
drop eigenvectors of the unit-diagonal overlap below this (1e-8; 0 drops none) |
[scf]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
string |
|
|
|
string |
|
|
|
integer |
|
maximum SCF iterations (100) |
|
float |
|
energy convergence, Eh (1e-10) |
|
float |
|
norm of the orthogonalised commutator |FDS − SDF| (1e-5) |
|
float |
|
integral screening threshold (1e-12) |
|
bool |
|
incremental Fock build (true, the default; false is a full build every iteration) |
|
bool |
|
density-fitted J and K (basis: |
|
string |
|
read the SCF result from a |
|
string |
|
|
|
float |
|
geometry tolerance for the symmetry detection, Bohr (1e-5) |
|
boolean |
|
in a symmetric run, force the Fock matrix and the four-centre gradient to be built from the orbit representatives of the integral quartets and symmetrized ( |
|
string |
|
electrons per irrep, e.g. |
The SCF is converged when the energy change is below energy_tol and the
commutator norm is below commutator_tol. The energy error goes as the square
of the orbital error, a gradient’s error linearly, so a tight optimisation
([opt] gradient_tol 1e-5) wants commutator_tol near 1e-7. A Hessian
tightens both itself for its displaced SCFs.
Symmetry with on
Symmetry is opt-in: without a symmetry key a run is off, as it always was. With symmetry = "on" the SCF runs in the point group it finds, and everything reported stays in your input orientation: the geometry (the input symmetrised in it, with the largest atom displacement printed; it is below symmetry_tol), the gradient, and through the C ABI the orbitals, the density, multipoles and the borrowed basis. Energies, orbital energies, irrep labels, occupations and atomic charges are the same in either frame. One settings line says what the request was, and a symmetric run adds one line, results are in your INPUT frame. A molecule with no symmetry (C1) prints its one settings line and nothing else new; symmetric and spherical tops and linear molecules run in their largest Abelian subgroup, as in the table above. Paths the symmetric SCF does not support run in C1 with exactly the numbers and output they always had, plus one line naming the reason (symmetry : on (auto), but --opt is not supported with symmetry yet: running in C1). symmetry = "off" restores the old path bit for bit.
What changes with on: an SCF is faster on a molecule with symmetry, and HF, UHF and DFT energies agree with off on any orientation (1e-13 measured for HF; 3e-12 to 8e-10 for B3LYP, TPSS and wB97X-V on rotated water-sized inputs, 1.3e-8 Eh for wB97X on a rotated B2H6/6-31G*). An on run builds its DFT and VV10 grids on your axes, then symmetrises the Fock matrix, so the energy differs from off only at second order in the grid error. The gradient is first order in it: it equals the off gradient to 1e-7..1e-6 on water and 3.6e-6 on B2H6 at the default grid level 3, and to 2e-9 at level 5 (identical for axis-aligned inputs). A named group keeps the group-symmetric grid in the standard frame, whose DFT energy on a rotated input moves with the grid orientation (B3LYP/cc-pVDZ water in a general orientation: 7e-7 Eh at level 3, 5e-9 Eh at level 5) and whose gradient is exactly symmetric.
[scf.convergence]
How the SCF gets there; the defaults suit most systems.
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
integer |
|
Fock/error pairs kept (10) |
|
bool |
|
ADIIS before CDIIS, for SCFs stuck near 1e-2 |
|
float |
|
virtual level shift during the damped start, Eh (1.0) |
|
float |
|
weight of the new density while damping (0.3) |
|
integer |
|
damped steps before DIIS (0 closed shell, 4 open shell) |
|
float |
|
commutator norm below which DIIS may start |
|
bool |
|
second-order SCF after DIIS (RHF only) |
|
float |
|
commutator norm at which SOSCF takes over (1e-2) |
|
bool |
|
maximum overlap occupation (small-gap open shells). Starts at the first iteration with DIIS on and either a starting density you handed in (the library’s given density, a restart or a projected warm start) or a commutator norm below 0.1, and stays on; aufbau before that, so a poor guess is not locked in. The guesses terco builds ( |
|
float |
|
keep the level shift on through DIIS until the commutator is below this (0: off). Dropped for the rest of the run, with one message, if the commutator does not improve by a factor 2 over 10 such iterations (a threshold below where the shifted run parks would otherwise never converge) |
|
bool |
|
geometric direct minimisation (Van Voorhis and Head-Gordon, Mol. Phys. 100, 1713 (2002)): an L-BFGS minimisation over occupied-virtual orbital rotations that takes over from DIIS once the commutator is below |
|
float |
|
commutator norm at which DIIS hands over to GDM (0.1) |
|
float |
|
largest element of the orbital rotation (kappa) of one GDM step (0.2); an overshooting step is rejected and halved |
[dft]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
integer |
|
integration grid level (3) |
|
integer |
|
VV10 grid level (1) |
|
bool |
|
the Kohn-Sham ground-state gradient ( |
[solvation]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
string |
|
|
|
float |
|
dielectric constant (78.3553 for water) |
[correlation]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
string |
|
|
|
integer |
|
frozen core orbitals; −1 (the default) counts by element (1 per Li-Ne atom, 5 per Na-Ar, …; H and He none); 0 correlates all electrons |
|
integer |
|
auxiliary functions per three-index block |
frozen_core, aux_block and [basis] auxiliary are shared by the three
methods. auxiliary defaults to cc-pvdz-rifit whatever the orbital basis, so
give the RI fitting set that matches it.
[riccsd]
The RI-CCSD solver, used with method = "ri-ccsd" or "ri-ccsd(t)"; any of
these keys with another method is refused.
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
float |
|
stop when the change of the correlation energy is below this, Eh (1e-8) |
|
float |
|
and the largest change of any amplitude is below this (1e-6) |
|
integer |
|
maximum iterations (100) |
|
integer |
|
DIIS history length (8, at most 50); 1 switches DIIS off |
|
string |
|
|
|
string |
|
the (T) routine: |
|
float |
|
memory for the working tile of the (T) routine of |
Both tolerances must be met. An RI-CCSD that does not converge is reported as
NOT CONVERGED in the summary, "ri-ccsd converged": false in the JSON
(without total energies), skips (T), and ends the run with exit status 2. A (T)
that fails after a converged RI-CCSD keeps the RI-CCSD energies in the summary
and the JSON and ends the run with exit status 1.
RI-CCSD is closed-shell Hartree-Fock only (over several ranks the ladder of every iteration and the (T) are shared), with no effective core
potential. It is refused with [scf] functional, [molecule] unpaired, [driver] hessian or optimize, and with method = "rimp2" (it reports the RI-MP2 correlation energy itself). [driver] gradient = true with method = "ri-ccsd" is the analytic gradient of E_RHF +
E_RI-CCSD (--grad; one rank, no solvation.model, scf.density_fitted or
scf.restart, and not with "ri-ccsd(t)"); amplitude_tol, max_iterations
and diis_size also drive its Lambda equations. A basis in which
[basis] linear_dependence dropped functions is refused after the SCF, because
the method needs every orbital: lower the threshold (0 drops none). See
docs/sphinx/cli.md for the memory it needs and what has been measured.
The method and its limits are described in docs/sphinx/theory.md.
The "input" echo of the JSON output gives "method": "ri-ccsd(t)" and a
"riccsd" object with the same keys.
[molecule]
geometry = "water.xyz"
[basis]
main = "cc-pvdz"
[correlation]
method = "ri-ccsd(t)" # frozen core counted by element, cc-pvdz-rifit
[tddft]
Singlet excitation energies of a closed-shell RHF or RKS reference, and with
[driver] gradient or optimize the gradient or the geometry optimisation of
one excited state.
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
bool |
|
run the excitation energies after the SCF; any other key of the table needs it |
|
integer |
|
lowest singlet roots wanted (3) |
|
integer |
|
the root |
|
string |
|
|
|
string |
|
|
|
float |
|
the Davidson residual norm of the excitation energies (1e-8) |
|
integer |
|
most Davidson iterations (50) |
|
integer |
|
iterations after the probe in which candidate Ritz pairs beyond the buffer are still iterated, the guard against a missed root (0, the default: none is iterated, fewer matvecs, and the candidates are reported open by the window warning, which names this option; 24 was the previous default, is what |
|
float |
|
residual norm of the Z-vector of the gradient (1e-9) |
|
integer |
|
roots sharing one pass over the integral derivatives; a tuning knob that changes no number |
|
bool |
|
Screen the excited-state matvec’s integrals by the trial densities (true, the default): per launch of a few trial densities, a quartet is dropped when its Schwarz bound times the largest density block is below the integral threshold, the SCF Fock build’s criterion. The trial vectors are orthonormal, so the bound does not tighten as the solve converges. |
|
bool |
|
Kohn-Sham gradient with the grid response (true, the default): the exact derivative of terco’s own energy, whose grid moves with the nuclei. |
|
float |
|
|
|
bool |
|
|
The report gives every root’s excitation energy in Eh and eV, its oscillator
strength, ||Y||^2 (zero for the TDA) and its dominant orbital pair, from the
HOMO and the LUMO, with its share of X^2 - Y^2. The JSON summary has a "tddft"
object with the same quantities as arrays, in ascending energy
("excitation energies", "excitation energies ev", "oscillator strengths",
"y norms", "transition dipoles", "dominant hole", "dominant particle",
"dominant weight") and "target root total energy", E_SCF plus the target root’s
excitation energy. "candidates open" is the number of candidate Ritz pairs the
missed-root check left open (0 when none; open candidates do not by themselves
mean a root is missing, see missed_root_iterations). --grad is then the gradient of that energy
("gradient of" says so) and --opt optimises it.
When a root may be missing. A Davidson solve follows the lowest roots it can reach from its starting guesses, the lowest orbital-energy differences. A state of a symmetry none of those guesses has can sit below the highest root returned and never be found, with every returned root converged. It shows up in small, symmetric molecules with diffuse functions.
terco checks for this once the roots have converged and, when the check leaves
candidates unresolved, says so: a warning in the log, "candidates open" in the
JSON summary and trc_tddft_window_open in the C interface. An open candidate
is not a missing root: of the 52 cases of the basis-set tests, about ten leave
candidates open at the default and one of them has a wrong root.
If the warning appears and the result matters (a spectrum to compare with
experiment, a state to optimise), rerun with missed_root_iterations = 24
(--tddft-missed-root-iterations 24): the solver then iterates the candidates
until they are resolved or the count runs out. It costs extra matvecs, about
twice the wall time where it was measured (40 waters, PBE0, def2-SVP, one V100:
233 s against 108 s, the same five roots). Asking for one or two more roots
than needed is a cheaper first check, but it is not a guarantee.
The case in the tests is formaldehyde, 6-31+G, Hartree-Fock, three roots. A dense diagonalisation gives 0.157313, 0.328352 and 0.348172 Eh for the TDA. At the default terco returns 0.353367 for the third with the warning; with 24 it returns 0.348172. For comparison, the Davidson solver of PySCF 2.14.0 returns 0.353367 there and reports it converged, and GPU4PySCF 1.8.1 returns 0.348172 for the TDA but misses the third RPA root (0.338715).
A closed-shell reference only: refused, before the SCF and with the reason,
are triplets, [molecule] unpaired, meta-GGA, range-separated and double-hybrid
functionals and VV10, an f basis, [scf] density_fitted with a gradient or an
optimisation (the excitation energies over a fit are implemented, the excited-state
gradient is not yet), [solvation], [correlation], [driver] hessian and more than one rank. An --opt also needs a Hessian-free
algorithm, or --opt-init-hessian dlfind: terco’s own finite-difference
Hessian has no excited-state gradient to difference.
[molecule]
geometry = "formaldehyde.xyz"
[basis]
main = "6-31g"
[scf]
functional = "pbe"
[tddft]
enabled = true
roots = 4
target_root = 1
approximation = "tda"
[driver]
optimize = true # the first singlet excited state
[driver]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
bool |
|
analytic nuclear gradient |
|
bool |
|
static dipole polarizability (CPHF; CPKS with a restricted functional), written to |
|
bool |
|
FD Hessian, frequencies, thermochemistry |
|
bool |
|
geometry optimisation (needs DL-FIND) |
optimize and hessian together are --opt-freq: optimise, then the Hessian
at the optimised geometry. With RI-MP2 ([correlation] method) or a double
hybrid, every optimisation step and every Hessian displacement reruns the
RI-MP2, so both act on the correlated total energy (a double hybrid’s
E_KS + c_os E_os + c_ss E_ss), which is also the energy the thermochemistry
starts from. What the correlated gradient refuses (an unrestricted
reference, PCM) is refused: by optimize before the first SCF, by a
hessian without optimize after the reference SCF, before any
displacement runs.
[analysis]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
string |
|
atomic charges: |
|
string |
|
condensed Fukui indices from |
[hessian]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
float |
|
displacement, Bohr (0.005) |
[thermo]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
float |
|
K (298.15) |
|
float |
|
atm (1.0) |
|
integer |
|
rotational symmetry number (1) |
|
string |
|
|
[opt]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
string |
|
|
|
integer |
|
maximum steps (100) |
|
float |
|
max gradient component, Eh/Bohr (4.5e-4) |
|
float |
|
energy change, Eh |
|
string |
|
warm start between steps: |
|
string |
|
|
|
string |
|
|
|
string |
|
|
|
bool |
|
minimise both ways from the saddle |
|
string |
|
|
|
string |
|
|
|
integer |
|
updates before a recompute |
|
integer |
|
zero-frequency modes |
|
float |
|
soft-mode threshold, Eh/Bohr² |
|
float |
|
trust-radius ceiling, Bohr |
|
string |
|
|
|
float |
|
step scale for |
|
integer |
|
L-BFGS history length |
|
integer |
|
DL-FIND verbosity: 0, 2, 4, 6 |
|
integer array |
|
1-based atoms to freeze, e.g. |
|
string array |
|
e.g. |
|
integer |
|
seed for stochastic/genetic/dimer |
[opt.neb]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
string |
|
product geometry ( |
|
integer |
|
number of images |
|
float |
|
spring constant, Eh/Bohr² |
|
bool |
|
climbing image |
|
string |
|
|
|
string |
|
intermediate geometries (multi-frame |
[opt.global]
Key |
Type |
Flag |
|---|---|---|
|
integer |
|
|
integer |
|
|
integer |
|
|
integer |
|
|
integer |
|
|
integer |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
|
float |
|
Meanings and defaults as in terco --help.
[output]
Key |
Type |
Flag |
Meaning |
|---|---|---|---|
|
string |
|
JSON summary file. On the command line the value must follow ( |
|
string |
|
write the SCF result for a later restart |
|
bool |
|
summary only |
|
string |
|
|