Calculation of STM Spectra

by Christian Vorwerk, Benedikt Maurer, & Pasquale Pavonefor exciting neon

Purpose: In this tutorial you will learn how to execute simulations of Scanning Tunneling Microscope (STM) images and also how to visualize the results. Both differential-conductance and constant-voltage imaging will be performed in the usual modes of operation in STM, namely, constant-height and topographic. In this tutorial, the example of a simplified W(110) surface is considered.

0. Define relevant shell variables and download scripts

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

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

1. Preparation of the input file for the W(110) surface

At first, we have to create a working directory. Since we are calculating the example of a (simplified) W(110) surface, we create a directory called W-110-stm and move into it:

$ mkdir W-110-stm
$ cd W-110-stm

As a starting point, we create an input file input.xml for a ground-state calculation of the W(110) surface. To this end, you can copy the following example.

   <title>Tungsten (110) surface ground-state calculation</title>
   <structure speciespath="$EXCITINGROOT/species" cartesian="true">
         <basevect> 5.9952538681 0.0000000000  0.0000000000 </basevect>
         <basevect> 2.9976269341 4.2392846651  0.0000000000 </basevect>
         <basevect> 0.0000000000 0.0000000000 27.3758289122 </basevect>
      <species chemicalSymbol="W" speciesfile="W.xml">
         <atom coord="0.000000 0.0 0.000"/>
         <atom coord="2.997627 0.0 4.239"/>
         <atom coord="0.000000 0.0 8.478"/>
      ngridk="8 8 1"

In this example we use a course grid of 8×8×1 k-points and the value of rgkmax = "4.0". The values of these parameters are not enough to ensure a good convergence of the calculations and are thus chosen only so as to be able to obtain rapid calculation times.

Note: For realistic calculations a fine k-grid is needed for the generation of STM images. In particular, the k-grid should be finer than what is needed for a reasonable convergence of ground-state properties. In this case, a useful approach consists in performing first a self-consistent ground-state calculation with a courser k-grid and then a further one-step ground-state calculation with a fine k-grid appropiate for STM simulations, taking as starting point the potential and density from the previous calculation.

Once the input file is created, do not forget to replace the string $EXCITINGROOT by the actual value of the environment variable in the input.xml file. This can be done by the command


Now, you are ready for the next steps.

2. Performing differential-conductance imaging

The first step is to perform a differential-conductance image at zero bias. In order to specify the parameters for the generation of the STM image, we have to add to the previous input.xml the following block inside the input element just after the groundstate element:

            grid2d="100 100"/>

By setting the attribute stmtype to "differentialConductance", we will perform a differential-conductance imaging, i.e., a map of the derivative of the total tunneling current with respect to the bias potential. Strictly speaking, inside the Tersoff-Hamann approximation that we are using (see the Reference Section at the bottom of this page), a quantity proportional to this derivative is generated. By setting the bias attribute to zero, this derivative is calculated at the Fermi level. Furthermore, the attribute stmmode = "constantHeight" sets the operational mode of STM to constant height, i.e., the tip of the microscope is kept at a fixed height from the sample. Inside the stm element the region subelement is set. Through it, we indicate, by means of the attributes height and grid2d, the fixed height of the STM's tip and the real space grid for the generated two-dimensional image, respectively.

Summarizing what discussed above, the new added blocks contain the following information:

  • stm: Perform an STM image simulation.
  • stmtype: Set to "differentialConductance" to generate a differential-conductance image.
  • stmmode: Allows you to choose between "constantHeight" (this example) and "topographic" (see below) images.
  • region: This element is used to define the plane for the constant-height image or the region for a topographic image. The attribute height sets the height (z-coordinate) of the STM tip, measured from the origin of the unit cell. The attribute grid2D serves to set the real-space two-dimensional grid for a constant-height image.

Now, you can execute the calculation with the command

$ dci

The results of the calculation are stored inside the directory dci. In order to visualize the results, first you have to move inside the directory dci:

$ cd dci

To visualize the result use the script This script accepts several command-line arguments. One of them is -mode. We set it to either 1, to visualize constant-height two-dimensional images, or 2, for the visualization of three-dimensional topographic images. Another command-line argument is -tile n1 n2, where n1 and n2 must be replaced by integers indicating the repetition of the unit cell along the first and second unit cell vectors (this argument is only used when -mode is set to 1. The argument -skip n allows for a faster visualization by skipping points of the grid by reading the data in steps of n points. For instance, for generating 2$\times$2=4 unit cells skipping every second step, to make the grid coarser, we can use the command

$ -mode 1 -tile 2 2 -skip 1

As a result of the command an image like the following will appear on the screen.


A PNG file (PLOT.png) of this plot can be obtained adding the option -png to the previous command.

$ -mode 1 -tile 2 2 -skip 1 -png

3. Performing constant-voltage imaging

In the element stm the attribute bias allows you to define a finite bias between tip and surface. If the attribute stmtype = "integratedLDOS" is selected, the integrated local density of states is calculated in the energy range defined by this bias. This allows for the simulation of an STM image in constant-voltage mode. For starting the new calculation, first move to the parent directory.

$ cd ..

Then, modify the input file by setting the attributes bias = "0.0514" and stmtype = "integratedLDOS" inside the stm element (still keeping rgkmax = "4.0" and ngridk = "8 8 1"). Using the modified input file, we can generate a constant-voltage image for an energy window of 1.4 eV at a height of 2 Å. To do that, run again exciting:

$ bdi

The results are now stored inside the subdirectory bdi. Move inside bdi.

$ cd bdi

Now, the output can be visualized with the command

$ -mode 1 -tile 2 2
Reversal bias

For the system we are considering in this example, you can also investigate the influence of the sign of the applied energy bias on the STM image. The W(100) surface shows a corrugation reversal between 1.4 and -1.4 eV. To show this result, we perform a new calculation with the attribute bias = "-0.05145" in a new directory. You start by moving to the parent directory.

$ cd ..

After changing the input file, run the calculation

$ bdim

The results are now stored inside the subdirectory bdim. Move inside bdim.

$ cd bdim

Now, you can use the same command as before to visualize the result.

$ -mode 1 -tile 2 2

4.Topographic imaging

For both types of STM imaging (differential-conductance and constant-voltage) topographic images are possible. In this mode of operation the height of the STM tip is varied in order to keep the differential-conductance or total current fixed. In the following we perform a differential-conductance image in the topographic mode. Then, move to the parent directory using:

$ cd ..

Change the input file to perform a topographic image. Replace the content of the element properties of the input file with the following block:

            zrange="8.5 15.0" 
            grid3d="20 20 20"/>

In this case, the region element contains the attribute zrange, defining the minimum and maximum z-coordinate for the sampling of the desired property. Now, you run the calculation (still keeping rgkmax = "4.0" and ngridk = "8 8 1") with

$ topo

The results are stored inside topo. Move inside topo.

$ cd topo

You can visualize the results by typing

$ -mode 2

This will generate a visualization of the isosurfaces using XCrysDen. You can change the isovalue and use the various settings of the XCrysDen visualization program. An image with an isovalue of 0.0008 should look similar to the following image:



  • Dawn A. Bonnell, Scanning Tunneling Microscopy and Spectroscopy (VCH Publishers, Inc. 1993)
  • J. Tersoff and D.R. Hamann, Phys. Rev. B 31, 805 (1985)
  • S. Heinze, S. Blügel, R. Pascal, M. Bode, and R. Wiesendanger, Phys. Rev. B 58, 16432 (1998)
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License