In [ ]:
from __future__ import print_function
import sisl
import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

First Siesta example for analyzing output.

This example will calculate the electronic structure of graphene using Siesta and we will post-process the data to calculate band-structures etc.

We remark that settings during the Siesta/TranSiesta tutorials are not necessarily converged or proper settings. Users need to invest time in understanding the intrinsics of Siesta before performing real calculations!

Exercises

As this is your first example of running Siesta there are a few things you should know:

  1. Start by calculating the electronic structure using Siesta

    siesta RUN.fdf > RUN.out
    
    
    • Go through the output of Siesta to get used to it, also to assert that it has runned without errors (always do this!) ((always, always do THIS!))
    • Ensure the SCF has indeed converged, Siesta will, by default, die if it hasn't converged the SCF.
  2. Use sisl to read in the electronic structure (the Hamiltonian), there are several ways of doing this, for now you should try these two methods:

      H_fdf = sisl.Hamiltonian.read('RUN.fdf')
      H_TSHS = sisl.Hamiltonian.read('siesta.TSHS')
    
    

    print the objects and note the difference between the two objects. What do you think these differences mean? (it isn't relevant for this tutorial, but it will be in later tutorials).

  3. Calculate the $\Gamma$-point eigen spectrum using both above Hamiltonians (search the sisl documentation for eigh), are they different? If so, why, if not, why not?

  4. Calculate the band-structure using the DFT electronic structure using sisl. Also calculate the band-structure using the tight-binding Hamiltonian (TB 1) and compare the two.
    HINT: zoom in on an energy-range from $-3$ eV to $3$ eV and plot both the DFT bands and the TB bands in the same plot.


In [ ]:
# Read Hamiltonians using two different methods

In [ ]:
# Calculate eigenspectrum at the \Gamma-point
eig_fdf = H_fdf.<>
eig_TSHS = H_TSHS.<>

In [ ]:
# Calculate band-structure from DFT Hamiltonian and TB Hamiltonian
band = sisl.BandStructure(sisl.geom.graphene(), <fill-in correct points and labels>)
xtick, xtick_label = band.lineartick()
lk = band.lineark()

ax = plt.gca()
ax.xaxis.set_ticks(xtick)
ax.set_xticklabels(xtick_label)

# Define limits of the y-axis (Energy!)
# Play with this if you want! :)
ax.set_ylim(-3, 3)
ax.set_ylabel('Eigenspectrum [eV]')

# Plot x-major lines at the ticks
ymin, ymax = ax.get_ylim()
for tick in xtick:
    ax.plot([tick,tick], [ymin, ymax], 'k')

# Plot band-structures
band.set_parent(<DFT Hamiltonian>)
eigs = band.eigh()
ax.plot(lk, eigs)
    
# You need to create the TB Hamiltonian, see e.g. example TB 1
band.set_parent(<TB Hamiltonian>)
eigs = band.eigh()
ax.plot(lk, eigs, '--')

In [ ]: