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 PlotsDefine 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
0First, 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.08219414032883504Then 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=[:red, :red])
plot_pdos(bands; p, iatom=1, label="3D", colors=[:yellow, :orange], ε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
Nielement directly. - Pass the
:Nisymbol. - 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.
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));┌ Warning: Negative ρcore detected: -0.000618237030613506
└ @ DFTK ~/work/DFTK.jl/DFTK.jl/src/terms/xc.jl:39
n Energy log10(ΔE) log10(Δρ) Magnet |Magn| Diag Δtime
--- --------------- --------- --------- ------ ------ ---- ------
1 -361.3862489536 0.07 1.334 3.439 6.9 3.85s
2 -363.2376676936 0.27 -0.21 0.014 3.623 3.2 3.81s
3 -363.3511344882 -0.95 -0.58 0.000 3.727 3.2 2.94s
4 -363.3890470701 -1.42 -1.18 0.000 3.717 2.6 2.47s
5 -363.3959754289 -2.16 -1.67 0.000 3.681 2.0 3.72s
6 -363.3973302989 -2.87 -2.05 0.000 3.656 1.6 2.02s
7 -363.3975966638 -3.57 -2.26 0.000 3.647 1.9 2.05s
8 -363.3976946812 -4.01 -2.69 0.000 3.647 1.8 2.07s
9 -363.3977076523 -4.89 -3.01 0.000 3.649 2.1 2.22s
10 -363.3977070260 + -6.20 -2.99 -0.000 3.649 1.9 1.99s
11 -363.3977085737 -5.81 -3.12 0.000 3.648 2.0 2.19s
12 -363.3977092961 -6.14 -3.32 -0.000 3.648 1.0 1.81s
13 -363.3977097023 -6.39 -3.33 -0.000 3.648 2.0 2.08s
14 -363.3977094124 + -6.54 -3.13 -0.000 3.649 1.1 1.71s
15 -363.3977093409 + -7.15 -3.05 -0.000 3.649 1.0 1.70s
16 -363.3977095398 -6.70 -3.18 -0.000 3.649 1.0 1.70s
17 -363.3977096187 -7.10 -3.18 -0.000 3.649 1.0 1.70s
18 -363.3977096403 -7.67 -3.16 -0.000 3.649 1.0 1.70s
19 -363.3977097837 -6.84 -3.17 -0.000 3.649 1.0 1.71s
20 -363.3977097610 + -7.64 -3.19 -0.000 3.649 1.0 1.71s
21 -363.3977097730 -7.92 -3.21 -0.000 3.649 1.0 1.70s
22 -363.3977099985 -6.65 -3.56 0.000 3.648 1.0 1.69s
23 -363.3977100118 -7.88 -3.68 -0.000 3.648 1.0 1.71s
24 -363.3977100116 + -9.77 -3.87 0.000 3.648 1.0 1.70s
25 -363.3977100169 -8.28 -4.22 -0.000 3.648 1.0 1.70s
26 -363.3977100170 -9.76 -4.16 -0.000 3.648 1.2 1.74s
27 -363.3977100173 -9.55 -4.80 0.000 3.648 1.0 1.70s
28 -363.3977100176 -9.55 -4.84 0.000 3.648 2.2 1.95s
29 -363.3977100178 -9.72 -5.17 0.000 3.648 1.1 1.71s
30 -363.3977100178 -10.35 -5.85 0.000 3.648 1.6 3.35s
31 -363.3977100178 -11.19 -5.81 0.000 3.648 3.0 2.32s
32 -363.3977100178 -11.87 -5.82 0.000 3.648 1.0 1.72s
33 -363.3977100178 + -11.85 -5.64 0.000 3.648 1.0 1.70s
34 -363.3977100179 -11.32 -6.13 0.000 3.648 2.0 2.07sRun 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.11667606613571374With 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=[:blue, :blue], εrange)
plot_pdos(bands_hub; p, iatom=1, label="3D", colors=[:green, :purple], εrange)