VNL as GUI for Quantum ESPRESSO

In this tutorial you will learn the basics of how to use Virtual NanoLab as a graphical user interface for setting up and analyzing Quantum ESPRESSO calculations.

Outline:
  • We will consider the case of bulk silicon, and use VNL to set up the structure and export a Quantum ESPRESSO (QE) input file.
  • We will then run the calculation and use VNL to analyze a few results.

Many more video tutorials are available on the QuantumWise YouTube channel.

Note

This tutorial assumes you have access to the Quantum ESPRESSO distribution, or at least a working pw.x executable. If not, it can be obtained free of charge at quantum-espresso.org/download and is sometimes also available from Linux package managers, see for example here for relevant Ubuntu packages.

See also

This is an introductory tutorial. For more advanced topics, such as calculating and analyzing bandstructure and density of states, see Silicon bandstructure and DOS using VNL and Quantum ESPRESSO.

Setting up a configuration using VNL

  1. Open the VNL and create a new project by clicking on Create New. Give the project a Title (here: “Silicon_QE”), select the folder where the information will be stored, then click OK and then Open to start the project.

    ../../_images/pic_00.png
  2. Open the Builder and use Add ‣ From Database to import the Silicon (alpha) structure to the Stash.

    ../../_images/pic_01.png

Exporting a Quantum ESPRESSO input file

  1. Right-click the Silicon (alpha) Stash item and choose Export.

  2. Navigate to a suitable directory, choose Quantum ESPRESSO (*.in)* in the Files of Type drop-down menu, and save the input file as “scf.in”.

    ../../_images/pic_02.png

    The QE input file has now been generated by VNL and is saved as “scf.in”.

  3. Open a terminal and navigate to the directory containing the input file. Inspect the contents of the file. It should look like illustrated below.

&CONTROL
  calculation='scf',
  outdir='.',
  prefix='calc',
  pseudo_dir='$PSEUDO_DIR',
  verbosity='low',
  tstress=.false.,
  tprnfor=.false.,
/

&SYSTEM
  ibrav=2,
  celldm(1)=10.2623466921d0,
  nat=2,
  ntyp=1,
  ecutwfc=30.0d0,
  ecutrho=120.0d0,
  input_dft='LDA',
  occupations='smearing',
  smearing='gaussian',
  degauss=0.002000d0,
/

&ELECTRONS
  diagonalization='david',
  conv_thr=1d-06,
  mixing_mode='plain',
  mixing_beta=0.700d0,
/

ATOMIC_SPECIES
  Si 28.085500d0 Si.UPF

ATOMIC_POSITIONS {alat}
  Si   0.0000000000d0   0.0000000000d0   0.0000000000d0
  Si   0.2500000000d0   0.2500000000d0   0.2500000000d0

K_POINTS {automatic}
  1 1 1 0 0 0

Note

The default input file contains the settings and instructions needed for basic self-consistent QE calculations, but a few modifications are required before you can execute the calculation. In particular, the pseudopotential directory needs to be specified, and you may wish to tune a few of the parameters.

See also

The Quantum ESPRESSO website offers a full description of all possible settings for the input file at this link.

Adapting the input file

  1. First we need a pseudopotential. Go to the Quantum Espresso pseupotential repository at this link and download the silicon pseudopotential named Si.pbe-n-rrkjus_psl.0.1.UPF, or simply download it using this direct link. Save it in the folder that contains scf.in.

  2. Open scf.in with your favorite editor, and make the following changes:

    • Change the outdir option to outdir=’silicon’,;
    • Point to your local pseudopotential:
      • change the pseudo_dir option to pseudo_dir=’.’,;
      • change the name of the pseudopotential from Si.UPF to Si.pbe-n-rrkjus_psl.0.1.UPF;
    • Increase the density and potential cutoff energy (in Rydbergs) from ecutrho=120.0d0, to ecutrho=300.0d0, (because we are using an ultrasoft pseudopotential, not a normconserving one);
    • Remove lines 20-22. They specify options for smearing of electronic occupations; which is not needed for semiconductor bulks;
    • Insert instead nbnd=10, to include a few conduction bands;
    • Change the exchange-correlation density functional from input_dft=’LDA’, to input_dft=’PBE’,;
    • Tighten the SCF convergence threshold from conv_thr=1d-06, to conv_thr=1d-08,;
    • Increase the k-point sampling from a 1x1x1 grid to a 9x9x9 grid by changing the last line from 1 1 1 0 0 0 to 9 9 9 0 0 0.

    Warning

    It is important to preserve the comma-separation of lines in sections such as the CONTROL, SYSTEM, and ELECTRONS cards. All lines in those sections should end with a comma, otherwise the calculation will crash.

  3. Your scf.in input file should now look like illustrated below.

    &CONTROL
      calculation='scf',
      outdir='silicon',
      prefix='calc',
      pseudo_dir='.',
      verbosity='low',
      tstress=.false.,
      tprnfor=.false.,
    /
    
    &SYSTEM
      ibrav=2,
      celldm(1)=10.2623466921d0,
      nat=2,
      ntyp=1,
      ecutwfc=30.0d0,
      ecutrho=300.0d0,
      nbnd=10,
      input_dft='PBE',
    /
    
    &ELECTRONS
      diagonalization='david',
      conv_thr=1d-08,
      mixing_mode='plain',
      mixing_beta=0.700d0,
    /
    
    ATOMIC_SPECIES
      Si 28.085500d0 Si.pbe-n-rrkjus_psl.0.1.UPF
    
    ATOMIC_POSITIONS {alat}
      Si   0.0000000000d0   0.0000000000d0   0.0000000000d0
      Si   0.2500000000d0   0.2500000000d0   0.2500000000d0
    
    K_POINTS {automatic}
      9 9 9 0 0 0
    

Running the ground state calculation

  1. Run the Quantum ESPRESSO calculation and send the standard output to a file named scf.out:

    pw.x < scf.in > scf.out
    
  2. Once the calculation has finished (should be very fast), a number of QE output items should be visible on the VNL LabFloor:

    • scf.in contains the initial bulk configuration;
    • scf.out contains the bulk configuration (icon bulkconfiguration_icon) and a total-energy report (icon totalenergy_icon;
    • the ground state electron charge density is available from data-file.xml.
    ../../_images/pic_05.png

Analyzing results

Viewing the configuration

  1. Make sure that the bulkconfiguration_icon named “scf.out” is selected in the LabFloor and click Viewer at the bottom of the plugins panel on the right. This opens the Viewer, which allows you to inspect the silicon unit cell as it is read from the QE output.

    ../../_images/pic_06.png

Total energy components

  1. Click the totalenergy_icon icon named “scf.out” on the LabFloor and click Text Representation in the plugins panel. A window pops up with the ground state total energy and its various components. You can also save this total energy report in plain text format by using the Export... function in the plugins panel.

    ../../_images/pic_07.png

Electron charge density projections

The 1D Projector plugin allows you to visualize real-space projections of the ground state electron charge density.

  1. On the LabFloor, highlight the data-file.xml item and click 1D Projector in the plugins panel.

  2. Click the Add line button to project the electron density onto a 2D plane along the C-axis and plot the sum along this axis.

    ../../_images/pic_08.png
  3. You can also plot the electron density along a line that passes through a specific point and is parallel to one of the crystal axes. To do this, change Projection type from Sum to Through point, click Clear plot, and then click Add line. The result is a plot of the charge density along the C-axis.

    ../../_images/pic_09.png

Isosurfaces and contour plots

Finally, let us use the Grid Operations plugin to visualize an isosurface and a contour plot of the electron density.

  1. On the LabFloor, highlight the data-file.xml item and click Grid Operations in the plugins panel.

  2. The ElectronDensity object has the default alias A1. Type this into the input line in the Grids panel and hit Enter on your keyboard.

  3. On the right-hand side you can now choose between Isosurface and Cutplane plots. The View botton shows the selected plot.

    ../../_images/pic_10.png

    ../../_images/pic_11.png

More Quantum ESPRESSO calculations

You can easily use the output configuration in the LabFloor as a starting point for setting up structures for more QE calculations:

  1. Drag-and-drop the bulkconfiguration_icon named “scf.out” onto the Builder icon.

  2. Try to create a silicon nanoparticle going to Builders ‣ Wulff Constructor.

    ../../_images/pic_12.png

The Builder can also be used to visualize the first Brillouin zone of the silicon crystal:

  1. Double-click the bulkconfiguration_icon icon named “scf.out” in the Stash, and choose Bulk Tools ‣ Brillouin Zone Viewer.

  2. Hold down the right mouse bottom to rotate the visualization for close inspection. High-symmetry points in reciprocal space are indicated in green letters.

    ../../_images/pic_13.png

See also

You are now ready to continue with Silicon bandstructure and DOS using VNL and Quantum ESPRESSO, where you learn more about calculating and analyzing the electronic structure of semiconductors.