Nickel studies
To compare Gaussian basis sets, hold the geometry, charge, spin state, and HF settings fixed while changing the basis. To test convergence thresholds or compare initial guesses, hold the scientific model fixed and vary a numerical setting. In either case, shared settings help you see which change accounts for differences across related calculations.
TOML is sufficient for an individual calculation. Nickel is an optional configuration language for generating a series of related calculations from one file. It records the shared inputs and the parameters you varied, so you can rerun the same comparison without maintaining several nearly identical files. RustiQ includes the Nickel support it needs, so there is no separate Nickel installation.
Compare two basis sets at a fixed geometry
The H₂ study below varies the basis while keeping the geometry and HF
settings shared. Each name in bases produces one calculation. The
std.array.map expression applies the same configuration to each name.
let bases = ["sto-3g", "6-31g"] in
std.array.map
(fun basis_name => {
molecule.geometry = "molecule.xyz",
basis.name = basis_name,
method.hf.diis = { enabled = true, max_history = 2 },
})
bases
To run this study with only the release binary, save the H₂ geometry below as
molecule.xyz and save the study above as study.ncl in the same working
directory. Geometry paths may be relative or absolute using the host platform syntax;
prefer relative paths with / separators for portability.
Absolute paths are used directly. The study’s
molecule.geometry = "molecule.xyz" path is relative
to that file. Both STO-3G and 6-31G must be available. Download them as shown
below, or use the offline basis files and import commands.
2
Hydrogen molecule
H 0.0 0.0 -0.37
H 0.0 0.0 0.37
rustiq basis download sto-3g
rustiq basis download 6-31g
rustiq run study.ncl
Tip
With an online-enabled build and network access,
rustiq run study.ncl --auto-downloadfetches any missing bases required by the study instead of downloading them separately.
To reproduce the checked-in study from a source checkout, run the following commands from the repository root.
rustiq basis import tests/data/sto-3g.json
rustiq basis import tests/data/reference/RustiQ/basis_sets/6-31g.json
rustiq run samples/h2/study.ncl
When both calculations succeed, selected output excerpts are:
Calculation 1/2
Calculation 2/2
2 succeeded, 0 non-converged, 0 failed
The following results were obtained with the checked-in geometry and basis fixtures using the commands above. The total HF energy includes nuclear repulsion. Values are rounded here to 12 decimal places; a reproduction should agree within 0.000000001 Hartree (1e-9), allowing for numerical differences.
| Basis | Basis functions | Effective overlap rank | SCF converged | Total HF energy (Hartree) |
|---|---|---|---|---|
| STO-3G | 2 | 2 | yes | -1.116759307506 |
| 6-31G | 4 | 4 | yes | -1.126755313457 |
From the full-precision JSON values, 6-31G is lower by 0.009996005951 Hartree. The effective overlap rank counts the retained independent basis function directions after the linear-dependence check; neither calculation lost a direction here.
The fixed geometry, charge and multiplicity keep the molecular Hamiltonian and electronic state consistent, while the fixed HF method keeps the approximation consistent. Changing the basis changes the space in which the molecular orbitals are expanded. For H₂, 6-31G provides additional radial flexibility compared with the minimal STO-3G basis, allowing a more flexible HF description and, in this calculation, a lower energy.
The HF variational principle guarantees that the global minimum energy cannot increase when the orbital space is enlarged and contains the original space, for the same Hamiltonian and HF constraints. SCF convergence alone does not establish that a global minimum was found. Arbitrary basis sets need not be nested: their exponents and contractions can differ, as in STO-3G and 6-31G. Therefore, simply counting more functions does not universally guarantee a lower HF energy. A lower HF energy also does not establish adequate accuracy for a particular property: basis-set convergence of that property and the limitations of HF, including missing electron correlation, require separate assessment. See the Hartree–Fock review by Echenique and Alonso for the variational method and basis expansions, and scientific scope for RustiQ validation limits.
For a similar study, change the list of basis names or vary a numerical
setting such as method.hf.convergence_threshold while keeping the basis
fixed. Use the TOML configuration guide for the shared
scientific settings. Geometry paths resolve relative to the top-level
.ncl file. Nickel imports resolve relative to the file that imports them.
Read each calculation outcome
A study executes sequentially. Inspect the individual outcomes and energies before comparing the bases. A valid JSON report can contain non-converged or failed entries. Read the report alongside the process exit status.
From the study working directory, generate a machine-readable report with:
rustiq run study.ncl --format json --pretty > results.json
With default automatic color handling, redirected JSON contains no terminal
color codes. The batch document’s calculations array contains outcomes in
study order. Each entry has a status; successful entries contain
result.calculation.hf.converged, result.calculation.hf.total_energy, and
result.calculation.hf.orthogonalization (including ao_basis_dimension and
effective_rank). The report does not record the basis name: associate
entries with the ordered bases list in study.ncl (STO-3G first, 6-31G
second), and retain that input alongside the report. For example, with jq:
jq '.calculations | to_entries[] | {index: .key, status: .value.status, hf: .value.result.calculation.hf}' results.json
Indices are zero-based. Check every status and convergence flag before comparing energies; failed entries may lack a result. A valid batch JSON file alone does not mean that every calculation succeeded.
RustiQ validates all study entries before it starts running them. Calculations
then run in source order. A calculation that has a recoverable runtime error
or does not converge is recorded for that entry, and later entries are still
attempted. Fatal infrastructure errors stop the batch.
The batch returns an unsuccessful process status if any entry fails or does
not converge, while retaining per-calculation results: 4 for partial success,
3 when every entry stops because HF did not converge, or 1 when no entry
succeeds and at least one has another error. Fatal infrastructure errors return
1 regardless of earlier successes. A configuration error prevents execution
of the batch and returns 1. See the CLI exit-code contract.
The integration coverage is in
tests/nickel_cli.rs
and tests/json_output_cli.rs.
For structured outcomes, see JSON output.
To save a study’s calculation entries and reusable AO ERIs in one portable
bundle, see portable calculation bundles.
See the glossary for Nickel and calculation terminology.
Generate a starting Nickel file
rustiq init molecule.xyz -o calculation.toml creates TOML;
rustiq init molecule.xyz -o calculation.ncl creates a Nickel list containing one calculation. Run either with rustiq run calculation.toml or
rustiq run calculation.ncl, respectively. The .ncl extension is matched
without regard to case. Any other extension, including an unusual extension
such as .custom, or no extension, produces TOML. Avoid .rustiq for
init output. Although init writes TOML with that extension, run
reserves it for portable archives and matches it without regard to case.
Without --output, init creates calculation.toml. Prefer .toml or .ncl
to make the format explicit. The destination parent directory must exist.