Context: I am an undergraduate "self-taught" noob when it comes to QE. (I've just been using online resources and textbooks thus far.) There are no QE or DFT experts at my university (I have checked with multiple departments), and I have not been referred to experts that have the time to discuss my problems. I also do not have access to VASP.

Issue: I have successfully gotten a few different calculations to work for simple systems on my university's HPC (i.e., bands.x, q2r.x, dos.x, pw.x, ph.x, matdyn.x, and so forth). However, I am struggling to produce an STM image (that I can display in XCrySDen), despite it seeming simpler than many other calculations.

To my understanding I need to run:

(0) relaxation calculation(s) like vc-relax and relax. (pw.x vc-relax, relax; I have good input files and successful outputs)

(1) self-consistent calculation (pw.x scf; I have good input files and successful outputs)

(2) a non-scf calc (pw.x nscf; I have good input files and successful outputs)

(3) an STM calc (pp.x ... I guess my input file is wrong somehow)

Question: As an example, for a simple graphene STM simulated scan, what would a successful, minimal sample input file contain? I cannot even get this to work.

Note: I think it is easiest for everyone if I compare what files/advice the replies return to my own files, and determine my errors that way, rather than provide all my input files here and have someone try to find my errors. I am also familiar with the input file descriptions, various QE forums, and have looked for examples elsewhere.

Thank you for your time, and for reading! It's possible my error is something small and stupid, but I would still very much appreciate hearing from those with more expertise than me.


1 Answer 1


A minimal input file

For simulated STM, you can use pp.x. A minimal input file might look like this:


Explanation: The value for outdir directory and the prefix are the same ones that you used for scf and nscf calculation. plot_num=5 tells us that we want to generate an STM image. The sample_bias is optional. If you want, you can set it in Ry unit. The iflag=3 tells us that we want a 3D plot. The output_format=6 tells us that the output file will be a gaussian cube file and lastly we supplied the name of the output file. If you run this, you will get a .cube file which can be opened using VESTA. Below I attached my result for graphene. You may want to slice the figure to get the 2D image using Utilities > 2D Data Display menu in VESTA.

graphene.cube in vesta sliced at 001

If you want to learn more such as how to choose the sample bias, and get an overall idea of how to do STM simulation, follow slides 22 to 26 of this HANDS-ON TUTORIAL ON THE QUANTUM-ESPRESSO PACKAGE: POST-PROCESSING.

A (possibly) better way

There is a program called Critic2 that can do, along with many other things, STM calculation from various programs (not just Quantum ESPRESSO but also siesta, VASP etc.) For your purpose, you might want to follow this tutorial: Making STM plots with Quantum ESPRESSO and critic2. For example, with the same input files, I have obtained the following STM image. The unit cell STM image doesn't look good, but the $3\times3$ one looks much better (and it is obtained by one extra command cells 3 3 only)

unit cell 3 3 supercell

(I cannot figure out why the gnuplot script cannot fit the image here. The scalebar seems to be cut. Here, is the gnuplot script:)

set encoding iso_8859_1
set terminal postscript eps color enhanced 'Helvetica, 20'
set output 'constant_height_stm.eps'

set palette rgb 34,35,36
set style line 1 lt 1 lw 1 lc rgb '#000000'
set style line 2 lt 1 lw 1 lc rgb '#000000'

set title 'Constant height plot, c-axis coord. = 0.0265'

set xrange [-3.659984E+00:7.319969E+00]
set yrange [0.000000E+00:6.339273E+00]
set xtics nomirror out
set ytics nomirror out
set xlabel 'x (\305)'
set ylabel 'y (\305)'

unset key
set size ratio -1

# set pm3d at b map interpolate 5,5 (if smoother plot needed)
set pm3d at b map

set cbtics format '%.3f'
set cblabel 'Electron density (a.u.)'

splot 'constant_height_stm.dat' u 3:4:5 w pm3d notitle ls 1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .