Self-interaction correction with FLOSIC¶
In this tutorial
Tutorials 1 and 5 showed the self-interaction error of semilocal functionals: the HOMO of
water too high by 5 eV and Rydberg states far too low. Here you remove it orbital by orbital
with the Perdew–Zunger self-interaction correction in its Fermi–Löwdin orbital form (FLOSIC).
You run FLOSIC-LDA for water with a given set of Fermi-orbital descriptors (FODs), read the SIC
parts of the output, look at the localized orbitals, and check the method on the one case
where the answer is known exactly.
Time: about 1 s for the main run, a few seconds for the exercises (16 cores).
Files: h2o_flosic.yaml, h2o.fod,
h2o_flosic.out (reference output), h2o_lda.yaml,
exercise inputs files/h2o_flosic_jacobi.yaml, files/h_atom_{lda,flosic,hf}.yaml, run.sh.
The idea in one paragraph¶
In an approximate functional, each electron partly interacts with itself: the Hartree energy of an orbital density is not cancelled by its exchange-correlation energy. Perdew and Zunger (1981) subtract this self-interaction orbital by orbital:
The result depends on which orbitals are used, and the correction is largest for localized ones. FLOSIC builds them from one point per occupied orbital and spin, the Fermi-orbital descriptors (FODs):
Fermi orbitals: \(F_i(\mathbf r)=\rho(\mathbf a_i,\mathbf r)/\sqrt{\rho(\mathbf a_i)}\), from the density matrix at the FOD \(\mathbf a_i\).
Fermi–Löwdin orbitals (FLOs): the Fermi orbitals after Löwdin orthogonalization.
The FODs are the variables: good FODs give the lowest energy. Tutorial 8 shows how to optimize them. Here we use FODs that are already optimized.
The input file¶
system:
charge: 0
unpaired_electrons: 0
units: angstrom
functional:
exchange: slater
correlation: pw92
basis:
name: UTEP-NRLMOL
file: basis/FLOSIC-LDA_atoms_normalized.nw
scf:
conv_tol: 1.0e-8
sic:
functional: pz_sic
solver: kli
fod_file: tutorials/07_flosic/files/h2o.fod
cube:
prefix: h2o_flo
spacing: 0.2
margin: 5.0
quantities: sic_alpha:all
atoms:
- element: O
position: [0.000000, 0.000000, 0.117300]
- element: H
position: [0.000000, 0.757200, -0.469200]
- element: H
position: [0.000000, -0.757200, -0.469200]
functionalLDA: Slater exchange and PW92 correlation, the functional of most FLOSIC benchmarks. The self-interaction correction is applied to the functional you choose: LDA, GGA or meta-GGA. Hybrids are refused.
basisThe UTEP-NRLMOL basis, the standard basis of FLOSIC calculations.
sicAll SIC keys live in this section.
functional: pz_sicselects Perdew–Zunger SIC;lsicis the locally scaled version of tutorial 9.solver: klisolves the SCF with the Krieger–Li–Iafrate local potential: cheap and robust.solver: jacobiis the fully self-consistent, variational alternative (exercise 1).fod_filegives the FODs.
h2o.fodThe FOD file is plain text in bohr: the number of spin-up FODs, their coordinates, then the same for spin down. Water has 5 + 5: the O 1s core, two O–H bonds and two lone pairs, the same for both spins in a closed shell.
5 -0.0000 0.9820 -0.5260 <- O-H bond -0.0000 -0.9820 -0.5260 <- O-H bond -1.2075 -0.0000 0.8345 <- lone pair 1.2075 -0.0000 0.8345 <- lone pair 0.0000 0.0000 0.2217 <- O 1s (at the nucleus) 5 ... (the same five for spin down)
cube: sic_alpha:allCube files of the FLOs, for plotting.
Running¶
$ OMP_NUM_THREADS=16 ./run_dft tutorials/07_flosic/files/h2o_flosic.yaml > h2o_flosic.out
Run it from the repository root: the path in fod_file is relative to the directory you run in.
Reading the output¶
The setup lists the SIC choices, including a separate, coarser integration grid for the orbital-density terms:
sic_functional = pz_sic, fod_file = tutorials/07_flosic/files/h2o.fod
SIC grid: radial points x 1, lm 17-17, pruning none (29700 points)
Every SCF iteration adds the SIC energy and its parts:
scf iter 9 e_sic: coulomb = 8.26093563 exchange = -7.18778575 correlation = -0.29811133 total = 0.77503854
At the end, the Results block and the energy table of the SUMMARY show the SIC energy that
is subtracted from the DFA energy:
exchange + correlation = -8.8182966690
SIC total = 0.7750385430
SIC Coulomb = 8.2609356280
SIC exchange = -7.1877857545
SIC correlation = -0.2981113304
TOTAL ENERGY = -76.6762734498
The orbital-resolved SIC energies of the last iteration are in FLOSIC_ORBITAL_ENERGIES.log:
spin x y z e_coulomb e_exchange e_correlation e_sic
alpha -0.0000000 0.9819727 -0.5260348 0.4260507602 -0.3755514208 -0.0257240579 0.0247752815
alpha 1.2074829 -0.0000000 0.8344956 0.4307666353 -0.3825692868 -0.0256510071 0.0225463413
alpha 0.0000000 0.0000000 0.2216649 2.4168330231 -2.0776514621 -0.0463055352 0.2928760259
The O 1s core orbital, small and dense, carries 0.29 Ha of self-interaction per spin. The bond and lone-pair orbitals carry about 0.02 Ha each.
The localized orbitals¶
Each FLO is centred near its FOD; the FODs are drawn gold (spin up) and violet (spin down). The pictures come from
$ python3 tutorials/tools/dftsw27plot.py cube h2o_flo_sic_alpha_3.cube --sign --iso 0.08 --fod h2o.fod
What the correction does¶
LDA |
FLOSIC-LDA (KLI) |
experiment / exact |
|
|---|---|---|---|
total energy (Ha) |
\(-75.90904\) |
\(-76.67627\) |
\(-76.44\) (nonrelativistic) |
\(-\varepsilon_{\rm HOMO}\) (eV) |
7.36 |
14.87 |
12.62 (ionization energy) |
The HOMO moves from far too high to somewhat too low. In exact Kohn–Sham theory \(-\varepsilon_{\rm HOMO}\) equals the ionization energy, but LDA misses it by 5 eV because of the self-interaction error. FLOSIC removes most of that and overshoots by 2 eV, which is typical of PZ-SIC with LDA.
The total energy drops by 0.77 Ha. FLOSIC-LDA now lies 0.24 Ha below the exact energy. The oxygen atom shows the same, 0.22 Ha below its exact energy, so molecules and atoms are over-corrected alike. Locally scaled SIC (tutorial 9) removes most of this over-correction.
Things to try¶
1. KLI or Jacobi?¶
files/h2o_flosic_jacobi.yaml sets solver: jacobi: the fully variational SCF of Yang,
Pederson and Perdew, which rotates the orbitals to satisfy the localization conditions.
What you should find
solver |
total energy (Ha) |
\(-\varepsilon_{\rm HOMO}\) (eV) |
time |
|---|---|---|---|
KLI |
\(-76.67627\) |
14.87 |
1.2 s |
Jacobi |
\(-76.67890\) |
14.78 |
3.1 s |
Jacobi is 2.6 mHa lower: it minimizes the FLOSIC energy exactly, while KLI uses an approximate local potential. Jacobi also gives exact FOD forces and nuclear gradients, so FOD optimization (tutorial 8) and geometry optimization with SIC use it. KLI is cheaper per iteration and is needed for real-time SIC.
2. The one-electron test¶
For a one-electron system, PZ-SIC is exact: the self-interaction correction cancels the
spurious self-Hartree and self-exchange-correlation completely, and the energy must equal
Hartree–Fock in the same basis. Run the hydrogen atom with LDA, FLOSIC-LDA (one FOD at the
nucleus, files/h_atom.fod) and Hartree–Fock:
What you should find
\(E\) (Ha) |
\(-\varepsilon_{\rm HOMO}\) (eV) |
|
|---|---|---|
LDA |
\(-0.4786468993\) |
7.32 |
FLOSIC-LDA |
\(-0.4999218567\) |
13.60 |
HF |
\(-0.4999218567\) |
13.60 |
exact |
\(-0.5\) |
13.61 |
FLOSIC and HF agree to all ten printed digits. LDA misses the energy by 21 mHa and the ionization energy by a factor of two. The remaining \(8\times10^{-5}\) Ha against the exact \(-0.5\) Ha is the basis set.
Troubleshooting¶
The run stops while reading the FODs. A FOD file needs exactly one FOD per occupied orbital and spin; other counts are rejected. Without
fod_file, DFTSW27 builds a guess (tutorial 8).The energy is too high. The FODs are probably not optimized: relax them (
fod_optimization: energy, tutorial 8).Open-shell atoms (O, Fe, …) converge to different states. Use
solver: jacobiwithscf_algorithm: direct, which minimizes the energy directly and is reproducible (User Manual,sicsection).Not available. Hybrid functionals, noncollinear runs and
moment_modeother thanfixedare refused.
Next: FOD optimization — where good FODs come from.