Spin-Polarized Calculations

by Dmitrii Nabok for exciting boron

Purpose: In this tutorial you will learn how to initialize and perform spin-polarized calculations including spin-orbit coupling. As an example, we calculate groundstate properties of bcc-Fe with different types of magnetic order.


0. Define relevant environment variables

Read the following paragraphs before starting with the rest of this tutorial!

Before starting, be sure that relevant environment variables are already defined as specified in Tutorial scripts and environment variables.

From now on the symbol $ will indicate the shell prompt.

Important note: All input parameters are in atomic units!

In order to start the tutorial create somewhere a directory spin-tutorial and move inside it.

$ mkdir spin-tutorial
$ cd spin-tutorial

1. Paramagnetic phase

The system on which we will focus is iron in the body-centered cubic phase. Therefore, inside the directory spin-tutorial create a new directory Fe-bcc and move inside it.

$ mkdir Fe-bcc
$ cd Fe-bcc

Let us first start from the non-magnetic case. Below is an example for the required input file (input.xml).

<input>
 
   <title>Paramagnetic Fe-bcc</title>
 
   <structure speciespath="$EXCITINGROOT/species">
      <crystal scale="5.200">
         <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.0">
         <atom coord="0.0 0.0 0.0"/>
      </species>
   </structure>
 
   <groundstate 
      do="fromscratch"
      rgkmax="8.0"    
      ngridk="8 8 8"
      stype="Gaussian"
      swidth="0.01"
      nempty="10">
   </groundstate>
 
   <properties>
      <dos 
         nsmdos="2"
         winddos="-0.3 0.3"/>
   </properties>
 
</input>

Make sure to set $EXCITINGROOT to the correct exciting root directory in the speciespath attribute using the command

$ SETUP-excitingroot.sh

Let us look closer at this input file. In the groundstate element some attributes are explicitly given. Be aware that for time-saving reasons, here we have chosen computational parameters which do not correspond to those devised from convergence tests, although producing reasonable description of the system under consideration. Some of the attributes are known from other tutorials. The attributes stype and swidth are specified explicitly because they are relevant for metallic systems (see Input Reference for their definition). In fact, their choice is crucial when performing convergence tests with respect to the k-point number for metals. The meaning of the attribute nempty will be clear later when we initialize spin-polarized calculations. Furthermore, inside the input file you can find the elements properties and dos which allow for the calculation of the electronic density of states (see Electronic-structure calculations).

To perform actual calculations, you may run the script EXECUTE-single.sh.

$ EXECUTE-single.sh para

Using this command all results of the calculation will be stored after the execution in the subdirectory para. The next step would be to visualize the resulting density of states. For this, move inside the directory para.

$ cd para

Here, one can just execute

$ xsltproc --stringparam ID "t///" $EXCITINGVISUAL/xmldos2grace.xsl dos.xml > tdos.agr

to get the file which can be nicely visualized with

$ xmgrace tdos.agr &
Here is an example of the result.
Fe-bcc-para-dos.png

2. Ferromagnetic phase

In the previous example the spin of the electrons is not taken into account. However, it is well known that iron is a magnetic material. In this kind of materials spin up electrons behave differently from spin down ones. In this section you will learn how to include spin degrees of freedom in exciting calculations. Let us first come back to the Fe-bcc directory.

$ cd ..

Please open your favorite text editor in order to modify the input file input.xml for making it suitable for ferromagnetic calculations. First of all, you may want to change the label of the calculation using

...
   <title>Ferromagnetic Fe-bcc</title>
...

The main change is the inclusion of the element spin inside the groundstate element.

...
   <groundstate 
      do="fromscratch"
      rgkmax="8.0"    
      ngridk="8 8 8"
      stype="Gaussian"
      swidth="0.01"
      nempty="10">
 
      <spin 
         bfieldc="0.0 0.0 -4.0" 
         reducebf="0.5"
         spinorb="false">
      </spin>
 
   </groundstate>
...

The presence of the spin element will tell to exciting to initialize the spin-polarized calculations. The relevant attributes of the spin element are described in the following Table.

attribute description
bfieldc Specifies the cartesian coordinates of the external magnetic field required in spin-polarized calculations to break spin symmetry. In case of collinear magnetism, it is important to note that the preferable direction of the magnetic field should be selected along the z-axis (the axis of the spin quantization). Another important notice is that the amplitude of this field may play a crucial role to converge the system to the state with the right magnetic moment. Thus, as in the case of bulk iron, one has to specify rather high value of the field to obtain the magnetic state.
reducebf If one searches the ground state in absence of magnetic field, this attribute specifies which portion of the starting field is acting at each step during the self-consistent cycle (see more in Input Reference).
spinorb Should be set to true to include the spin-orbit coupling (false by default).

The way in which exciting deals with spin-polarized systems (the so-called "second-variational approach", described, e.g., in Singh-2006) requires also the explicit specification in the input of the attribute nempty inside the groundstate element.

attribute description
nempty Determines the size of the "second-variational" Hamiltonian. The optimized value should be chosen on the basis of a convergence test.

As before, you may run the calculation using the script EXECUTE-single.sh.

$ EXECUTE-single.sh ferro

All results of the calculation are now stored in the subdirectory ferro. Then, move inside the directory ferro.

$ cd ferro

The main output file INFO.OUT contains information on the magnetic moments of the ferromagnetic phase. These moments are written at each iteration. The values of the magnetic moments at the last SCF cycle should look like the following.

...
 Moments :
     interstitial                           :        -0.00911428
     moment in muffin-tin spheres :
                  atom     1    Fe          :         1.98011296
     total moment in muffin-tins            :         1.98011296
     total moment                           :         1.97099868

Check the convergence of the total moment for during the SCF cycle this calculation using the script PLOT-convmoment.py as folows:

$ PLOT-convmoment.py .

Visualize the PostScript (PLOT.ps) or the PNG (PLOT.png) output file.

Furthermore, you can visualize the new density of state using first the command

$ xsltproc --stringparam ID "t///" $EXCITINGVISUAL/xmldos2grace.xsl dos.xml > tdos.agr

and then

$ xmgrace tdos.agr &
Here is an example of the result.
Fe-bcc-ferro-dos.png

Compare the density of states with the one obtained for the paramagnetic calculation.


3. Anti-ferromagnetic phase

Now we will learn how to initialize calculations for materials with anti-ferromagnetic (AFM) type of spin ordering. As an example, we consider a hypothetical AFM phase of bcc iron. In oder to realize the anti-ferromagnetic order, we need at least two nonequivalent atoms per cell. To do this with we simply apply the (standard) definition of the bcc lattice as a simple cubic lattice with a basis consisting of two atoms. Let us now come back to the Fe-bcc directory.

$ cd ..

Here is an example of input file corresponding to the hypothetical AFM phase of bcc Fe.

<input>
 
   <title>AFM Fe-bcc</title>
 
   <structure speciespath="$EXCITINGROOT/species">
      <crystal scale="5.200">
         <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="Fe.xml" rmt="2.0">
         <atom coord="0.0 0.0 0.0" bfcmt="0.0 0.0  2.0"/>
         <atom coord="0.5 0.5 0.5" bfcmt="0.0 0.0 -2.0"/>
      </species>
   </structure>
 
   <groundstate
      do="fromscratch"
      rgkmax="8.0"    
      ngridk="6 6 6"
      stype="Gaussian"
      swidth="0.01"
      nempty="10"> 
 
      <spin/>
 
   </groundstate>
 
   <properties>
      <dos 
         nsmdos="2"
         winddos="-0.3 0.3"/>
   </properties>
 
</input>

Here, the relevant difference with respect to the other calculations is the presence of the additional attribute bfcmt inside the atom element. This attribute plays a similar role as the attribute bfieldc but only inducing the local atomic (muffin-tin) magnetic moment. The presence of this magnetic moment breaks the symmetry of the crystal and make the two basis atoms indeed nonequivalent. Since in this example we do not desire any external magnetic field or spin-orbit coupling, we can skip the explicit specification of the attributes inside the spin element, keeping them to the default values.

Following the steps as above, we can calculate the total energy of the system and the local atomic magnetic moments.

As before, you may run the calculation using the script EXECUTE-single.sh.

$ EXECUTE-single.sh AFM
Proceed as in the other sections to get the visualization of the density of states.
Fe-bcc-afm-dos.png
Exercise
  • At the given lattice constants, perform complete convergence test of the total energy and (if appliable) magnetic moments for the different phases with respect to the values of the attributes ngridk, swidth, rgkmax, and nempty.
  • Perform the lattice optimization (see Volume optimization for cubic systems) for the paramagnetic, ferromagnetic, and anti-ferromagnetic phases. Compare the total energies for the optimized structures of the different phases. Which phase has the minimum total energy per atom? How does the energetics of the different phases depend on the main computational parameters?
  • Calculate the magnetic moments of the optimized structure of the ferromagnetic phase. How does the obtained total magnetic moment compare with the one calculated in Section 2. and with the experimental value of about 2.12 $\mu_{\tt B}$?
  • In order to visualize the volume dependence of total magnetic moment (magnetization) in the ferromagnetic phase, use the script PLOT-totalmoment.py inside the directory in which you performed the volume optimization for this phase.

Literature

  • Singh-2006: David J. Singh and Lars Nordström, "Planewaves, Pseudopotentials, and the LAPW Method, Second Edition", Springer 2006
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License