for lithium version of Exciting
Purpose: In this tutorial, you will learn how to set up and perform spin-polarized calculations with exciting in ferromagnetic and anti-ferromagnetic systems. You will learn which elements must be added and which attributes must be modified. Through some exercises, you will understand the effect of the main computational parameters on the density of state (for both majority and minority spins), the spin and the orbital moment.
Table of Contents
|
0. Define relevant shell variables and download scripts
Read the following paragraphs before starting with the rest of this tutorial!
Before starting, be sure that relevant shell variables are already defined and that the excitingscripts directory has already been downloaded, as specified in Tutorial scripts and environment variables. Here is a list of the scripts which are relevant for this tutorial with a short description.
- Tutorial-SPIN.tar.gz: tar.gz archive containing files and directories which are used in this tutorial.
From now on the symbol $ will indicate the shell prompt.
Preparation
Copy the archive Tutorial-SPIN.tar.gz to your working directory, extract all files and directories, and move to the directory Tutorial-SPIN.
$ cp $EXCITINGSCRIPTS/Tutorial-SPIN.tar.gz ./
$ tar xzf Tutorial-SPIN.tar.gz
$ cd Tutorial-SPIN
Now, you can find two directories, To-Do and DONE, identical in how they have been structured. In the first directory, you will find only the input files for the examples suggested here. In the second one, the most important output files of the calculations are stored. In this way, while your calculations are running, you can already analyse the output. In each of the two main directories, there are two sub-directories, FM and AFM, respectively, related to calculation for the ferromagnetic and anti-ferromagnetic case. To visualize the data you can either make use of the experience gained in other tutorials or use any other program you may want to.
1. Spin-polarized calculations
In exciting, the magnetic properties are obtained in a second-variational scheme. This means that at each iteration of the selfconsistency, the non-magnetic equations are solved (first-variational scheme). Eigenfunctions obtained in this way are not the final solutions, but being close to them, they are used as a basis set for expanding the final wavefunctions to construct spinors in the second-variational scheme. To learn how this procedure is managed by the code, you are going
- to get familiar with the definition of elements and attributes for the input file,
- to run simple ferromagnetic and anti-ferromagnetic calculations,
- to analize the results.
Creating an input file
An input file for spin-polarized calculations contains the basic elements and attributes discussed in previous tutorials. In addition, exciting requires for these calculations to start with a magnetic atomic configuration by using an external field, bfieldc. This attribute is added to the subelement spin which is included in the element groundstate. In this example, the initial external field is parallel to the z axis and has a magnitude of 0.5.
... <groundstate ...> <spin bfieldc="0.0 0.0 0.5"> ...
This external field bfieldc either vanishes during the self-consistent calculation or through an extra fictitious external magnetic contribution. This is added to the result via the attribute reducebf that damps the initial external magnetic field. For instance, in the following example, the choice reducebf=0.5 means that at every new iteration the external magnetic field will be reduced by half.
... <groundstate ...> <spin bfieldc="0.0 0.0 0.5" reducebf="0.5" spinorb="true"> </spin> </groundstate> ...
The last attributes spinorb="true" is required for including spin-orbit coupling.
Furthermore, in order to decompose the magnetic moments into spin and orbital contributions, the element LSJ (notice that the xml input file is case sensitive!) must be given as a subelement of the now required element properties.
... <properties> <LSJ/> </properties> ...
A complete input file for a specific calculation will be given in Section 2.
How output files look like
The Cartesian components of the total magnetic moment per unit cell are written in the file MOMENT.OUT. An example for this file is shown here
...
-0.6752316193E-20 0.1179704690E-19 -2.293664741
Similar informations are also contained in the file INFO.OUT, where the decomposition of the magnetic moment per atom, in the muffin-tin spheres, and in the interstitial space is also saved.
...
Moments :
interstitial : -0.8860331678E-20 0.1232139874E-19 0.4445389422E-01
muffin-tins
species : 1 (Fe)
atom 1 : 0.2108015485E-20 -0.5243518432E-21 -2.338118635
total in muffin-tins : 0.2108015485E-20 -0.5243518432E-21 -2.338118635
total moment : -0.6752316193E-20 0.1179704690E-19 -2.293664741
...
The expectation value of the Cartesian components of L, S, and J=L+S are printed in the output file LSJ.OUT. Notice that these values should be multiplied by 2 to get the total value of the components of the orbital, spin, and total moment, respectively.
Expectation values are computed only over the muffin-tin
Species : 1 ()
atom : 1
L : -0.5571546298E-19 0.2325110800E-17 -0.4724817308E-01
S : -0.1138754100E-18 0.2325908361E-19 -1.169575317
J : -0.1695908730E-18 0.2348369884E-17 -1.216823490
2. Including spin-orbit interaction: Ferromagnetic bcc Fe
Till now, the spin-specific elements and attributes have been presented. We will see them in action in the following example for bcc Fe.
Non-polarized calculation
First, we start with a non-polarized calculation. Copy and paste the following lines as a file named input.xml in the directory To-Do/FM/spinorb-false/step0.
<input> <title>FM bcc Fe</title> <structure speciespath="$EXCITINGROOT/species/"> <crystal scale="5.416"> <basevect> 0.5 0.5 -0.5 </basevect> <basevect> 0.5 -0.5 0.5 </basevect> <basevect>-0.5 0.5 0.5 </basevect> </crystal> <species speciesfile="Fe.xml" rmt="2.3"> <atom coord="0.00 0.00 0.00"/> </species> </structure> <groundstate ngridk="10 10 10" xctype="GGAPerdew-Burke-Ernzerhof" stype= "Methfessel-Paxton 1" swidth="0.01" rgkmax="7.0" nempty="5"> </groundstate> <properties> <dos nsmdos="0" winddos="-0.3 0.3" /> <LSJ/> </properties> </input>
N.B.: Do not forget to replace in the input.xml the string "$EXCITINGROOT" by the actual value of the environment variable $EXCITINGROOT using the command
$ SETUP-excitingroot.sh
Now you can run exciting.
$ excitingser
To visualize the density of states in the file TDOS.OUT you can use the xmgrace visualization template coming along with the code. In this case, type in the bash shell the command lines
$ xsltproc --stringparam ID "t///" $EXCITINGVISUAL/xmldos2grace.xsl dos.xml > tdos.agr
$ xmgrace tdos.agr
The resulting density of states should look this.
Spin-polarized calculation
In order to perform a spin-polarized calculation, we move to the parent directory and then to the step1 directory.
$ cd ..
$ cd step1
Here, copy and paste the following input to which the element spin has been added.
<input> <title>FM bcc Fe</title> <structure speciespath="$EXCITINGROOT/species/"> <crystal scale="5.416"> <basevect> 0.5 0.5 -0.5 </basevect> <basevect> 0.5 -0.5 0.5 </basevect> <basevect>-0.5 0.5 0.5 </basevect> </crystal> <species speciesfile="Fe.xml" rmt="2.3"> <atom coord="0.00 0.00 0.00"/> </species> </structure> <groundstate ngridk="10 10 10" xctype="GGAPerdew-Burke-Ernzerhof" stype= "Methfessel-Paxton 1" swidth="0.01" rgkmax="7.0" nempty="5"> <spin bfieldc="0.0 0.0 0.5" reducebf="0.5" spinorb="false"> </spin> </groundstate> <properties> <dos nsmdos="0" winddos="-0.3 0.3" /> <LSJ/> </properties> </input>
Also in this case, do not forget to replace in the input.xml the string "$EXCITINGROOT" by the actual value of the environment variable $EXCITINGROOT.
You can now run again exciting.
$ excitingser
Notice that in the file input.xml which is shown above, we added the calculation of the density of states inside the element properties. To visualize the density of states use the command lines
$ xsltproc --stringparam ID "t///" $EXCITINGVISUAL/xmldos2grace.xsl dos.xml > tdos.agr
$ xmgrace tdos.agr
The plot you obain is should be similar to this.
Exercises
- Move to the parent directory To-Do/FM/spinorb-false. Compare the results you have stored in the directories step0 and step1. In particular, compare the two files LSJ.OUT and the two density of states.
- What happens to the Cartesian components of S and J?
- What is the effect of the presence of the element spin?
- What is the main difference in the density of states?
- Move to directory To-Do/FM/spinorb-true. Here, you find an already prepared input file in which the attribute spinorb is set to ''True''. Furthermore, you find a total of 5 directories, each one with an input.xml file inside it. In step0, step1, and step2 the attribute bfieldc varies. It is set to 0.0, 0.5, and 1.0, respectively. Run all these calculations.
- Compare the density of state (following the same procedure as above),
- Compare the information stored in LSJ.OUT, MOMENT.OUT, and INFO.OUT. What is the resulting value of the total spin (orbital) moment of bcc Fe?
- What do you learn about bfieldc?
- In To-Do/FM/spinorb-true, the directories step3 and step4 contain input files where the attribute bfieldc is set to a much much higher value (5.0), while reducebf is set to 1.0 and 0.5 for step3 and step4, respectively . Run all these calculations.
- Compare the density of state.
- Compare the information in LSJ.OUT, MOMENT.OUT, and INFO.OUT.
- Is reducebf="1.0" enough?
3. Example for anti-ferromagnetic bcc Cr
For an anti-ferromagnetic calculation, the only major change with respect to the ferromagnetic one is that the spin axis for each atom has to be specified. In exciting this is done by setting the attribute bfcmt of the element atom.
... <species speciesfile="Cr.xml"> <atom coord="0.00 0.00 0.00" bfcmt="0.0 0.0 1.7"/> <atom coord="0.50 0.50 0.50" bfcmt="0.0 0.0 -1.7"/> </species> ...
To simulate the anti-ferromagnetic ordering for Cr in the bcc phase, we have to choose a unit cell which is twice as large the primitive cell of the bcc lattice and, therefore, contains two Cr atoms (do you know why?). The corresponding input file (input.xml) can be found in To-Do/AFM/step0.
<input> <title>AFM bcc Cr</title> <structure speciespath="$EXCITINGROOT/species/"> <crystal scale="5.4424"> <basevect> 1.0 0.0 0.0 </basevect> <basevect> 0.0 1.0 0.0 </basevect> <basevect> 0.0 0.0 1.0 </basevect> </crystal> <species speciesfile="Cr.xml"> <atom coord="0.00 0.00 0.00" bfcmt="0.0 0.0 1.7"/> <atom coord="0.50 0.50 0.50" bfcmt="0.0 0.0 -1.7"/> </species> </structure> <groundstate ngridk="8 8 8" xctype="GGAPerdew-Burke-Ernzerhof" stype= "Methfessel-Paxton 1" swidth="0.05" rgkmax="6.0" nempty="5" maxscl="20" vkloff="0.5 0.5 0.5"> <spin bfieldc="0.0 0.0 1.0" reducebf="0.5" spinorb="true"> </spin> </groundstate> <properties> <dos nsmdos="0" winddos="-0.3 0.3" /> <LSJ/> </properties> </input>
Also in this case, do not forget to replace in the input.xml the string "$EXCITINGROOT" by the actual value of the environment variable $EXCITINGROOT.
Now, run exciting.
$ excitingser
As we have seen before, the resulting total moment per unit cell is written in the output file MOMENT.OUT. In this case, obviously, the value should be very close to zero for anti-ferromagnetic systems. The result for the magnetic moment per atom can be found at the bottom of the file INFO.OUT.
Exercise
- How many empty states need to be considered to reach a converged value of the magnetic moment?