# PySCF jobs

> What HiveBoard shows for a PySCF job on a Slurm cluster: SCF energies, optimisation cycles and gradient norms, Python errors and the 3-D geometry.

Source: https://hiveboard.dev/docs/codes/pyscf · Section: Simulation codes · HiveBoard 0.1.7 · Updated 2026-10-19

## In short

- HiveBoard recognises a PySCF job by a Python script that imports pyscf, and reads whatever the script printed.
- How much there is to read depends on mol.verbose; PySCF prints no end-of-run line, so whether the job finished comes from the scheduler.
- The PySCF spec was written from the source code of PySCF, geomeTRIC and PyBerny, not from real output, so it may need a correction when it meets a real job.

A PySCF calculation is a Python script, and its output is whatever the script prints (`python job.py > job.out`, or `mol.output`). HiveBoard reads the script for what it asks for and the output for converged SCF energies, optimisation cycles, correlated energies and excited states. Following the job installs nothing on the cluster and changes nothing in the folder. In the job list, your own job carries the code tag **PySCF** and its kind of run.

How much the output holds depends on `mol.verbose`: at the default, 3, only results; from 4 up also the script itself, the `[INPUT]` geometry table and every SCF cycle.

## What HiveBoard shows

### Progress and time left

A geometry optimisation or TS search that has not converged counts optimisation cycles against `maxsteps` (100 when the script does not set it). Anything else shows the share of the wall-time limit used. The time left is the time per cycle so far times the cycles left ("~…s per optimisation cycle × up to … left (often finishes sooner)"), never longer than the time before the wall-time limit.

PySCF prints no end-of-run line, so HiveBoard learns that the job has ended from the scheduler, and its sentences say what the script left: "The script ended; last SCF energy … Eh." For an optimisation the converged line is in the output only when the job merged its two output streams (`2>&1`) or ran PyBerny at `verbose` 4 or more; without it the sentence reads "The script ended after … optimisation cycles; PySCF itself does not say whether it converged." While it runs: "Optimising — … cycles done, of up to ….", "Running — … SCF calculations converged so far."

### Figures and charts

The [Overview](/docs/job/overview-tab) shows the figures that apply: **SCF energy** (the latest converged one, in Eh), **Correlated energy**, **(T) correction**, **Optimisation cycles**, **Gradient norm**, **SCF cycle** and **CC iteration** (while running), **Excited states**, **Lowest excitation**, **Atoms**, **Electrons**, **Basis functions** and **Version**.

The charts:

- an optimisation — **Energy relative to the latest cycle** (eV) and **Gradient norm**;
- a scan or MD — **SCF energies**, each relative to the first;
- while an SCF is iterating — **SCF convergence (recent cycles)**, log₁₀|ΔE| against `conv_tol`.

A chart appears once it has two points.

### Errors and warnings

When the script stops with a Python traceback, the warning quotes the error it ended on: "The script stopped with a Python error — …". Warnings say when an SCF did not converge (its energy is not reliable), when an optimisation used all its steps, when coupled-cluster amplitudes did not converge, and when some excited states did not. "No output update for N min — job may be stalled." appears when the output has not changed for more than 15 minutes while the job runs.

### Setup

The [Setup](/docs/job/setup-tab) tab's **Calculation setup** shows Method (the SCF class the script builds), Functional, Basis, Charge, Spin (2S), Density fitting, Solvent model, Excited states asked, Max optimisation cycles, SCF tolerance, Memory and Threads — from the output where PySCF reports them, from the script otherwise.

HiveBoard does not restart PySCF runs: **Continue** is offered for VASP only. Restarting PySCF means editing the script — an SCF guess from the `.chk` file and the last geometry.

## Kinds of run it tells apart

HiveBoard reads the kind from what the script calls and takes the first that fits:

| Kind | What it means |
|---|---|
| TS search | Transition-state optimisation (geomeTRIC with transition = True) |
| MD | Born-Oppenheimer molecular dynamics (pyscf.md) |
| Optimisation | Geometry optimisation with geomeTRIC or PyBerny |
| Frequencies | Analytical Hessian and harmonic analysis |
| Excited states | TDDFT / TDA, EOM-CC or ADC excitation energies |
| Multireference | CASSCF / CASCI, NEVPT2 or a selected-CI solver |
| Correlated | Coupled cluster, MP2 or CISD on top of the SCF |
| Scan | The same calculation repeated over a set of geometries (as_scanner) |
| Periodic SCF | Crystal calculation with pyscf.pbc |
| Gradient | Energy and nuclear gradient at a fixed geometry |
| SCF | Hartree-Fock or Kohn-Sham energy at a fixed geometry |

## The 3-D structure

The [Structure tab](/docs/job/structure-tab) shows the first of these that yields atoms:

1. The Cartesian coordinates an optimisation prints at every cycle — an optimisation trajectory from the last 400 kB of the output, up to the last 40 cycles.
2. The `[INPUT]` geometry table every `Mole.build()` prints at `verbose` 4 or more.
3. An `.xyz` file beside the script.
4. Atom rows typed in the script itself, one element and three coordinates (in ångström) per line.

HiveBoard reads no cell from the output or the script, so a `pyscf.pbc` run is drawn without one — unless the picture comes from an `.xyz` file that states its lattice (extended XYZ). A queued job shows only the `.xyz` file or the atoms typed in the script — see [Queued jobs and reused folders](/docs/job/queued-and-reused-folders).

## Files it recognises

The **What it is** column of the [Files tab](/docs/job/files-tab) names these files:

| Role | Names | What it is |
|---|---|---|
| Script | `*.py` | The Python script that builds the molecule and calls PySCF |
| Output | `*.out`, `*.log` | What the script printed |
| Geometry | `*.xyz` | A geometry file the script may read (atom='mol.xyz') |
| Checkpoint | `*.chk` | SCF checkpoint (HDF5) — what init_guess = 'chkfile' reads |
| Saved data | `*.h5` | Saved integrals or amplitudes |
| Orbitals | `*.molden` | Orbitals in Molden format |
| Grid data | `*.cube` | Density or orbital on a grid |

A `.py` file is read as the script only if it mentions `pyscf`, and a file as the output only if it holds one of PySCF's own lines; of several, the newest is read. The `.chk`, `.h5` and `.cube` files are marked as large: the download button on the row asks before copying one to your computer.

## How HiveBoard recognises a PySCF folder

No file name belongs to PySCF alone, so HiveBoard looks inside. A `.py`, `.out` or `.log` file counts when a script imports `pyscf` (or `gpu4pyscf`), or when an output holds a line PySCF writes itself: "#INFO: **** input file is", "PySCF version", "converged SCF energy = " or the banner of a PySCF class. A `.py` file without that is not enough.

HiveBoard goes by the folder's files, not by your batch script or the `python` command it runs. More in [How codes are recognised](/docs/codes/how-codes-are-recognised).

## What it was checked against

Only the source code of PySCF, geomeTRIC and PyBerny; no real output. A spec checked only against source is the likeliest to need a correction the first time it meets a real job.

HiveBoard is an independent program: it reads the files a PySCF script writes and is not made by, or connected with, PySCF's developers.

## Known limits

- PySCF prints no end marker, so "finished" is never read from the text: an ended run is known only from the scheduler.
- In a folder that holds several calculations, the newest script and the newest output are picked separately and may belong to different runs.

## Related

- [The twenty supported codes](https://hiveboard.dev/docs/codes/supported-codes.md)
- [How codes are recognised](https://hiveboard.dev/docs/codes/how-codes-are-recognised.md)
- [Psi4 jobs](https://hiveboard.dev/docs/codes/psi4.md)
- [xtb jobs](https://hiveboard.dev/docs/codes/xtb.md)
