Hubbard correction (DFT+U)

In this example, we'll plot the DOS and projected DOS of Nickel Oxide with and without the Hubbard term correction.

using DFTK
using PseudoPotentialData
using Unitful
using UnitfulAtomic
using Plots

Define the geometry and pseudopotential

a = 7.9  # Nickel Oxide lattice constant in Bohr
lattice = a * [[ 1.0  0.5  0.5];
               [ 0.5  1.0  0.5];
               [ 0.5  0.5  1.0]]
pseudopotentials = PseudoFamily("dojo.nc.sr.pbe.v0_4_1.standard.upf")
Ni = ElementPsp(:Ni, pseudopotentials)
O  = ElementPsp(:O, pseudopotentials)
atoms = [Ni, O, Ni, O]
positions = [zeros(3), ones(3) / 4, ones(3) / 2, ones(3) * 3 / 4]
magnetic_moments = [2, 0, -1, 0]
4-element Vector{Int64}:
  2
  0
 -1
  0

First, we run an SCF and band computation without the Hubbard term

model = model_DFT(lattice, atoms, positions; temperature=5e-3,
                  functionals=PBE(), magnetic_moments)
basis = PlaneWaveBasis(model; Ecut=20, kgrid=[2, 2, 2])
scfres = self_consistent_field(basis; tol=1e-6, ρ=guess_density(basis, magnetic_moments))
bands = compute_bands(scfres, MonkhorstPack(4, 4, 4))
lowest_unocc_band = findfirst(ε -> ε-bands.εF > 0, bands.eigenvalues[1])
band_gap = bands.eigenvalues[1][lowest_unocc_band] - bands.eigenvalues[1][lowest_unocc_band-1]
0.08219334475796897

Then we plot the DOS and the PDOS for the relevant 3D (pseudo)atomic projector

εF = bands.εF
width = 5.0u"eV"
εrange = (εF - austrip(width), εF + austrip(width))
p = plot_dos(bands; εrange, colors=[1, 1])
plot_pdos(bands; p, iatom=1, label="3D", colors=[3, 4], εrange)

To perform and Hubbard computation, we have to define the Hubbard manifold and associated constant.

In DFTK there are a few ways to construct the OrbitalManifold. Here, we will apply the Hubbard correction on the 3D orbital of all nickel atoms. To select all nickel atoms, we can:

  • Pass the Ni element directly.
  • Pass the :Ni symbol.
  • Pass the list of atom indices, here [1, 3].

To select the orbitals, it is recommended to use their label, such as "3D" for PseudoDojo pseudopotentials.

Note that "manifold" is the standard term used in the literature for the set of atomic orbitals used to compute the Hubbard correction, but it is not meant in the mathematical sense.

U = 10u"eV"
# Alternative:
# manifold = OrbitalManifold(:Ni, "3D")
# Alternative:
# manifold = OrbitalManifold([1, 3], "3D")
manifold = OrbitalManifold(Ni, "3D")
OrbitalManifold(Ni, "3D")

Run SCF with a DFT+U setup, notice the extra_terms keyword argument, setting up the Hubbard +U term. It is also possible to set up multiple manifolds with different U values by passing each pair as a separate entry in the Hubbard constructor (i.e. Hubbard(manifold1 => U1, manifold2 => U2, etc.)) or as two vectors (i.e. Hubbard([manifold1, manifold2, etc.], [U1, U2, etc.])).

model = model_DFT(lattice, atoms, positions; extra_terms=[Hubbard(manifold => U)],
                  functionals=PBE(), temperature=5e-3, magnetic_moments)
basis = PlaneWaveBasis(model; Ecut=20, kgrid=[2, 2, 2])
scfres = self_consistent_field(basis; tol=1e-6, ρ=guess_density(basis, magnetic_moments));
n     Energy            log10(ΔE)   log10(Δρ)   Magnet   |Magn|   Diag   Δtime 
---   ---------------   ---------   ---------   ------   ------   ----   ------
  1   -361.3825138110                    0.07    1.334    3.444    6.6    7.19s
  2   -362.9704045997        0.20       -0.10    0.224    3.873    2.5    3.44s
  3   -363.1932764564       -0.65       -0.20    0.000    3.776    3.1    1.85s
  4   -363.2410718852       -1.32       -0.29    0.000    3.781    2.1    934ms
  5   -363.3692202976       -0.89       -0.30    0.000    3.684    4.0    1.31s
  6   -363.3860890759       -1.77       -0.48   -0.000    3.653    2.0    1.01s
  7   -363.3969221606       -1.97       -1.11   -0.000    3.674    2.8    1.07s
  8   -363.3934220578   +   -2.46       -0.93    0.000    3.678    2.0    980ms
  9   -363.3967282896       -2.48       -1.08    0.000    3.657    1.0    802ms
 10   -363.3974629685       -3.13       -1.34    0.000    3.647    1.0    799ms
 11   -363.3975725006       -3.96       -1.43    0.000    3.644    1.0    815ms
 12   -363.3975912718       -4.73       -1.42    0.000    3.642    1.0    799ms
 13   -363.3976966892       -3.98       -2.05    0.000    3.643    1.0    826ms
 14   -363.3977049464       -5.08       -2.61   -0.000    3.645    1.0    1.41s
 15   -363.3977027929   +   -5.67       -2.54   -0.000    3.645    1.6    904ms
 16   -363.3977038495       -5.98       -2.60   -0.000    3.646    1.0    810ms
 17   -363.3977057654       -5.72       -2.75    0.000    3.646    1.0    810ms
 18   -363.3977085033       -5.56       -3.00    0.000    3.647    1.0    827ms
 19   -363.3977096208       -5.95       -3.24   -0.000    3.648    1.6    831ms
 20   -363.3977099763       -6.45       -3.84   -0.000    3.648    2.0    975ms
 21   -363.3977098661   +   -6.96       -3.52   -0.000    3.649    2.2    974ms
 22   -363.3977099273       -7.21       -3.70    0.000    3.649    1.0    816ms
 23   -363.3977100044       -7.11       -4.14    0.000    3.649    2.0    998ms
 24   -363.3977100000   +   -8.35       -3.98    0.000    3.649    1.0    811ms
 25   -363.3977100066       -8.18       -3.99    0.000    3.648    1.0    795ms
 26   -363.3977100135       -8.16       -4.08    0.000    3.648    1.0    1.44s
 27   -363.3977100162       -8.57       -4.34    0.000    3.648    1.9    830ms
 28   -363.3977100158   +   -9.44       -4.42    0.000    3.648    1.0    827ms
 29   -363.3977100177       -8.72       -4.89    0.000    3.648    1.0    796ms
 30   -363.3977100176   +  -10.02       -4.90    0.000    3.648    2.0    943ms
 31   -363.3977100177      -10.17       -5.01    0.000    3.648    1.0    809ms
 32   -363.3977100178       -9.79       -5.54    0.000    3.648    1.1    857ms
 33   -363.3977100178      -10.88       -5.78    0.000    3.648    2.2    960ms
 34   -363.3977100178      -11.12       -5.62    0.000    3.648    1.2    846ms
 35   -363.3977100178      -11.36       -5.66    0.000    3.648    1.0    820ms
 36   -363.3977100179      -11.56       -6.13    0.000    3.648    1.0    800ms

Run band computation

bands_hub = compute_bands(scfres, MonkhorstPack(4, 4, 4))
lowest_unocc_band = findfirst(ε -> ε-bands_hub.εF > 0, bands_hub.eigenvalues[1])
band_gap = bands_hub.eigenvalues[1][lowest_unocc_band] - bands_hub.eigenvalues[1][lowest_unocc_band-1]
0.11667623178566089

With the electron localization introduced by the Hubbard term, the band gap has now opened, reflecting the experimental insulating behaviour of Nickel Oxide.

εF = bands_hub.εF
εrange = (εF - austrip(width), εF + austrip(width))
p = plot_dos(bands_hub; p, colors=[2, 2], εrange)
plot_pdos(bands_hub; p, iatom=1, label="3D", colors=[3, 4], εrange)