SCF convergence failures and fixes, level shift, damping, SOSCF
An SCF fails when the states are nearly degenerate, the geometry is poor or the guess is bad. Damping, level shifting, DIIS and a Newton step fix most cases.
Updated November 28, 2026
A self-consistent field calculation fails when the density it produces in one iteration does not lead back to itself in the next. The common causes are a small HOMO-LUMO gap, a geometry with atoms too close together, a charged species in a diffuse basis, or a poor initial guess. The common fixes are, in increasing order of cost, a better guess, damping, level shifting, a DIIS extrapolation with a longer history, and a second-order Newton step. A production pipeline for σ-profiles should try these in a fixed order, record which one succeeded, and refuse to write a result when none does.
What the SCF is trying to do
In DFT the Kohn-Sham orbitals define the density, and the density defines the effective potential that determines the orbitals. The calculation starts from a guess, builds the Fock matrix from the guessed density, diagonalises it, forms a new density, and repeats. Convergence means the density stops changing to within a threshold. The MFsig recipe converges the energy to 1e-6 Eh, as listed on the recipes page.
When the gap between the highest occupied and lowest unoccupied orbital is small, the iteration often does not contract. A little extra density in one region lowers an orbital there, which pulls more density in, and the next iteration overshoots. The density then oscillates between two or more states without settling.
Recognising the failure mode
The iteration history tells you which problem you have.
- The energy oscillates between two values with a fixed period. Two near-degenerate configurations are swapping. Level shifting or SOSCF is the answer.
- The energy creeps down by a tiny amount each iteration and never reaches the threshold. The gap is small and DIIS is taking cautious steps. A tighter DIIS space or a Newton step helps.
- The energy rises or jumps erratically. The guess is far from the solution, or the geometry is unphysical. Check the structure first.
- The energy is far too low and the orbital energies look wrong. Two atoms may be nearly superimposed, which can happen when a force-field embedding fails on an unusual fragment. The guide on geometry from SMILES with ETKDG and MMFF94s describes where that can go wrong.
The fixes, from cheap to expensive
A better initial guess costs nothing. Superposition of atomic densities or a minimal-basis projection puts the starting point much closer to the solution than a core Hamiltonian guess, and most codes default to one of them. For a charged or zwitterionic species, a guess from a converged calculation on the neutral form, or in a smaller basis, often removes the problem.
Damping mixes a fraction of the old density into the new one. It slows convergence and can hide a real problem by converging to the wrong state.
Level shifting adds a constant to the diagonal Fock elements of the virtual orbitals. The occupied and virtual spaces then mix less, oscillations stop, and the shift does not change the converged solution because at convergence there is no mixing to suppress. A shift of a few tenths of a hartree is typical.
DIIS, Pulay's direct inversion in the iterative subspace, keeps a history of Fock matrices and their error vectors and extrapolates to the combination that minimises the error. It is the default in nearly every package because it is fast and cheap near the solution. Its weakness is far from the solution, where the extrapolation can be wild.
SOSCF, second-order SCF, abandons the fixed-point picture and treats the energy as a function of orbital rotations. A Newton or quasi-Newton step uses the curvature of that function and converges quadratically near a minimum. It costs more per step, because the orbital Hessian or its action must be built, but it rarely fails for a closed-shell molecule with a real gap. The MFsig recipe runs DIIS first and falls back to SOSCF Newton when DIIS stalls.
What a σ-profile pipeline must do when all fixes fail
The honest action is to write nothing. A σ-profile from an unconverged density is not a slightly worse σ-profile. It is a histogram of an arbitrary intermediate state and carries no information about the molecule. MFsig writes no .mfsig file when the SCF does not converge, and the geometry block of every file that is written carries a convergence flag.
Fractional occupation smearing deserves a warning here. Smearing the occupations across the gap makes almost anything converge, and it is a legitimate tool for metals. For a molecule it produces a density that does not correspond to any integer-occupation state. Used as a stepping stone and then turned off, it is fine. Used as the final answer, it is a silent error. The same applies to loosening the convergence threshold until the run passes.
A worked example with a merocyanine dye
Consider a merocyanine dye, a push-pull molecule with an electron-donating amino end and an electron-accepting carbonyl end joined by a conjugated chain. In a water-like continuum the charge-separated resonance form is stabilised and the HOMO-LUMO gap in solvent, a quantity recorded in every .mfsig file and discussed in the guide on HOMO, LUMO and the gap in solvent, becomes small.
A plain DIIS run on such a molecule often oscillates between a more neutral and a more zwitterionic density. The fix is a Newton step from the best DIIS iterate.
from pyscf import gto, dft
mol = gto.M(atom=geometry, basis="def2-svp")
mf = dft.RKS(mol, xc="wb97m-v").density_fit(auxbasis="def2-svp-jkfit")
mf.conv_tol = 1e-6
mf.max_cycle = 50
mf.kernel()
if not mf.converged:
mf = mf.newton()
mf.kernel()The Newton solver converges in a handful of iterations because it uses the curvature of the energy surface rather than extrapolating from past densities. The resulting σ-profile shows the amino end negative and the carbonyl end positive in screening charge. Species that are formally charged behave similarly and have their own difficulties, covered in the guide on σ-profiles of ions and zwitterions.
Key points
- SCF fails when the gap is small, the geometry is poor, the species is charged in a diffuse basis, or the guess is bad.
- The energy history reveals the failure mode. Period-two oscillation means near-degeneracy. A slow creep means a small gap.
- Fixes in order of cost are a better guess, damping, level shifting, DIIS with a longer history, and a second-order Newton step.
- A pipeline should run DIIS then fall back to SOSCF, and write nothing when neither converges.
- Fractional occupation smearing and loosened thresholds hide failures rather than fixing them.
Questions people ask
- Why does an SCF calculation fail to converge?
- Most often because the HOMO-LUMO gap is small, so the occupied and virtual orbitals swap character from one iteration to the next and the density oscillates. Poor geometries with atoms too close, charged species in a diffuse basis, open-shell transition metals and large conjugated systems are the usual culprits. A bad initial guess makes all of these worse.
- What is the difference between damping, level shift and DIIS?
- Damping mixes the new density with the old one to slow the iteration. Level shifting raises the energy of virtual orbitals so they mix less with occupied ones. DIIS extrapolates from the history of previous Fock matrices to predict the converged one. DIIS is fastest near the solution and is the default in most codes, while damping and level shifting are safer far from it.
- What is SOSCF?
- Second-order SCF, a Newton or quasi-Newton minimisation of the energy with respect to orbital rotations. It uses the second derivative of the energy, so it converges quadratically near a minimum and does not oscillate. It costs more per iteration than DIIS, which is why pipelines often run DIIS first and fall back to SOSCF when DIIS stalls.
Further reading
In practice: The production recipe on mfsig.com (ωB97M-V, def2-SVP, C-PCM at ε = 80, modified Bondi radii scaled by 1.2) is published in full on the recipes page, so each choice discussed here can be checked against what actually runs.
Generate a σ-profile from your SMILES
Free converter for a profile you already have, a reference-grade DFT run with its provenance record when it has to be defensible.