Calculations with LDA+U
Objectives
- Learn how to setup an LDA/GGA+U calculation in FLEUR
- Inspect the variation of the electronic structure
Introduction
This handson will cover the application of the DFT+U method, which can help to describe strongly correlated materials more properly. We will cover two examples here. NiO, where we improve the description of the 3d electrons, and bulk Gd, where the description of the 4f orbitals is improved.
In this tutorial, you will have to converge different setups and calculate the resulting DOS. For simplicity, we use the AiiDA workflows. If you want to perform the calculations "by hand" you should use the knowledge gained in the basic FLEUR tutorials.
1. Example NiO
NiO has a very small bandgap (0.4eV) and too small magnetic moment (1.2 Bohr) in a LDA calculation. The LDA+U method cures these problems.
In the following, we will calculate the antiferromagnetic structure (AFM1) of this material.
cd NiO ; cat inp_NiO_AFM
Please note that we have used an initial moment of to achieve better convergence.
Standard GGA
To compare the different approaches, we now start with a standard GGA calculation in a separate subdirectory
mkdir GGA
cd GGA
inpgen -f ../inp_NiO_AFM
We now run the SCF workflow followed by the DOS workflow. Please note that the system does not converge very fast, hence the SCF workflow will take some time. You might want to read on while the workflows are running.
aiida-fleur launch scf
aiida-fleur launch dos -P scf.json
GGA+U
To compare, we now also calculate the same system using GGA+U. Again we start in a different directory
cd ..
mkdir GGAU
cd GGAU
inpgen -f ../inp_NiO_AFM
To use the LDA/GGA+U scheme, we now have to add additional parameters to inp.xml
.
Basically, for each species of atoms in which we want to use this method, we have to decide:
* which l
channel we want to apply the method to
* the value of U
and J
to use. Attention these values are provided in in inp.xml
* the choice of method. FLEUR supports the fully localized LDA+U as well as the around-mean-field version.
These parameters are given in an additional xml-tag as follows:
<ldaU l="2" U="8.0" J="0.9" l_amf="F"/>
This tag has to be inserted below the energy parameters and above the line for the LO's:
<energyParameters s="4" p="4" d="3" f="4"/>
<ldaU l="2" U="8.0" J="0.9" l_amf="F"/>
<lo type="SCLO" l="1" n="3" eDeriv="0"/>
Here, we will insert the parameters U and J (taken from literature) for the Ni atoms.
Please modify the `inp.xml` accordingly. ***Note*** there are two Ni species, modify both.
Then we will start fleur once by hand to inspect the output.
fleur_MPI
Messages in the output related to LDA+U
In the first iteration there will be two messages that are normal. Since we did not specify an initial guess for the density matrix, in the first iteration no LDA+U term is added and we get the message:
no density matrix found ... skipping LDA+U
The second message is:
Reset of history
This means, that fleur removes any previous mixing history for the Anderson mixing scheme, that is used in fleur by default. This is done since introducing an LDA+U term into the Hamiltonian will inevitably lead to a large distance jump which would hinder convergence if the previous history stayed around.
The DFT+U calculations will produce some additional output. For example if we look at the distances of the charge densities, we will find additional output related to the density matrix (lines starting with n_mmp
)
grep "n_mmp distance" out
For further comparison, we now will use the AiiDA workflows again:
aiida-fleur launch scf
aiida-fleur launch dos -P scf.json
GGA+U calculation with AMF double counting
We want to calculate a third scenario for this system by calculating it with GGA+U and the around mean field limit for the double counting. For this calculation we start from scratch again.
cd ..
mkdir GGAU_amf
cd GGAU_amf
inpgen -f ../inp_NiO_AFM
Now we edit the inp.xml
file again, but this time we set l_amf="T"
attribute in the ldaU
tag
<energyParameters s="4" p="4" d="3" f="4"/>
<ldaU l="2" U="8.0" J="0.9" l_amf="T"/>
<lo type="SCLO" l="1" n="3" eDeriv="0"/>
Please modify the `inp.xml` accordingly. ***Note*** there are two Ni species, modify both.
then we run our workflow for a third time
aiida-fleur launch scf
aiida-fleur launch dos -P scf.json
Compare the results
We now can compare the electronic structure as obtained in the three calculations. For example, we can look at the bandgap and the magnetic moments obtained in the three setups:
# go back to top directory for NiO
cd ..
for f in GGA GGAU GGAU_amf
do
echo $f
grep bandgap $f/out.xml | tail -1
xmllint --xpath //magneticMomentsInMTSpheres/globalMagMoment $f/out.xml |tail -4
done
We can see that the GGA+U calculations:
- increased the magnetic moment from to .
- increased the bandgap. Without the
+U
the system is metallic, theamf="T"
calculation yields a smaller gap compared to theamf="F"
case.
To study the effects in more detail, we can also plot the DOS we calculated.
display <GGA/spinpol_dos_plot.png
display <GGAU/spinpol_dos_plot.png
display <GGAU_amf/spinpol_dos_plot.png
The density matrix in LDA+U
Before closing this example, we would like to discuss the density matrix in an LDA+U calculation. The matrix is output by FLEUR and written to a file called n_mmp_mat_out
. As it is not copied back by the AiiDA workflow by default we look at it in the calculation we performed 'by hand'
cat GGAU/n_mmp_mat_out
The file contains the density matrix for all LDA+U procedures in 7x7 complex matrices. Since the ouput format is 7 numbers per line, this means that every 2 rows corresponds to a row in the density matrix. The blocks are written out for each orbital and spin in the following order:
- orbital 1, spin-up
- orbital 2, spin-up ...
- orbital 1, spin-down
- orbital 2, spin-down
The density matrix can also be found in the out.xml, if you search for ldaUDensityMatrix, but the format of the n_mmp_mat_out file can be used to provide an initial guess for the density matrix in Fleur. Namely, if the file is renamed to n_mmp_mat it will be read in by Fleur in the next calculation and will initialize the density matrix
See Notebook Appendix- Creating initial density matrices.ipynb for some helpful tools for generating such a file from scratch if you are interested.
Example 2: Gd
In this part of the tutorial, we will have a look into 4f-materials. Indeed, 4f-electrons are characterized by a very localized nature such that DFT alone is not able to describe these systems accurately. We will do a short exercise which shows the effect of the Hubbard U on 4f-electrons.
The system we are going to try to describe is Gd bulk, as it is one of the easiest 4f-systems to start with. Remember, Gd is characterized by 7 4f-electrons, leading to a half-filled situation. The first thing to do is preparing the input file for FLEUR. In the Gd_bulk folder you can find the Gd.txt file needed for the input generator.
cd ../Gd
ls
GGA
We will again compare several calculations and start again with the standard GGA calculation
mkdir GGA
cd GGA
inpgen -f ../inp_Gd
aiida-fleur launch scf
aiida-fleur launch dos -P scf.json
GGA+U U=3eV
Now we create a GGA+U setup again.
cd ..
mkdir GGAU3
cd GGAU3
inpgen -f ../inp_Gd
In this setup we now have to modify the inp.xml
again. We insert the ldaU
tag
<ldaU l="3" U="3.0" J="0.7" l_amf="F"/>
into the inp.xml
file just above the LO's of Gd and below the energyParameters
tag.
Please modify the `inp.xml` accordingly.
Then we calculate again:
aiida-fleur launch scf
aiida-fleur launch dos -P scf.json
GGA+U U=6.7eV
Finally, we use the U value commonly accepted in literature for Gd which is 6.7 eV
cd ..
mkdir GGAU6
cd GGAU6
inpgen -f ../inp_Gd
We insert the ldaU
tag
<ldaU l="3" U="6.7" J="0.7" l_amf="F"/>
into the inp.xml
file just above the LO's of Gd and below the energyParameters
tag.
Please modify the `inp.xml` accordingly.
Then we calculate again:
aiida-fleur launch scf
aiida-fleur launch dos -P scf.json
Compare results
# Go to top Gd directory
cd ..
for f in GGA GGAU3 GGAU6
do
echo $f
xmllint --xpath //magneticMomentsInMTSpheres/globalMagMoment $f/out.xml |tail -1
xmllint -xpath //mtCharges/mtCharge $f/out.xml |tail -2
done
We can see that the GGA+U calculations tend to increase the magnetic moment slightly by increasing the "f" electrons splitting in occupation. This can be tacked down to a much improved electronic structure, as we can see in the DOS we calculated. Here, we can see that the spin-splitting of the Gd "f" states in increased by the GGA+U and the minority spin "f" peak is removed from the Fermi energy.
display <GGA/spinpol_dos_plot.png
display <GGAU3/spinpol_dos_plot.png
display <GGAU6/spinpol_dos_plot.png
Learn more
To learn more about the possibilities for LDA+U calculations in FLEUR please visit: - https://www.flapw.de/rel/documentation/ldaU/ - https://www.flapw.de/MaX-7.0/documentation/ldaUSetup/