This tutorial can be downloaded link.

1.1 Ground State Calculation with Qbox

We are going to generate an input file for the Qbox code. The code will compute the ground state electronic stucture for the methane molecule using Density Functional Theory.

Step 1: Load westpy

[1]:
from westpy import *

 _    _ _____ _____ _____
| |  | |  ___/  ___|_   _|
| |  | | |__ \ `--.  | |_ __  _   _
| |/\| |  __| `--. \ | | '_ \| | | |
\  /\  / |___/\__/ / | | |_) | |_| |
 \/  \/\____/\____/  \_/ .__/ \__, |
                       | |     __/ |
                       |_|    |___/

WEST version     :  3.1.1
Today            :  2018-09-19 15:21:57.535713

Step 2: Geometry

[2]:
geom = Geometry()

Let’s define a cubic cell of edge 25 Bohr.

[3]:
geom.setCell((25,0,0),(0,25,0),(0,0,25))

We load the atomic positions from a XYZ file, available online.

[4]:
geom.addAtomsFromOnlineXYZ( "https://west-code.org/doc/training/methane/CH4.xyz" )

We associate pseudopotential files to each species.

[5]:
geom.addSpecies( "C", "http://www.quantum-simulation.org/potentials/sg15_oncv/xml/C_ONCV_PBE-1.0.xml")
geom.addSpecies( "H", "http://www.quantum-simulation.org/potentials/sg15_oncv/xml/C_ONCV_PBE-1.0.xml")

Step 3.1: Ground State

The ground state calculation is defined by the geometry, a choice of the exchange-correlation functional, and by setting an energy cutoff for the wavefunctions.

[6]:
gs = GroundState(geom,xc="PBE",ecut=40.0)

We are now able to generate the input file for Qbox.

[7]:
gs.generateInputQbox()

Generated file:  qbox.in

We can inspect the file qbox.in

[8]:
with open("qbox.in","r") as file :
    data = file.read()
    print(data)
set cell 25.0 0.0 0.0 0.0 25.0 0.0 0.0 0.0 25.0
species Carbon http://www.quantum-simulation.org/potentials/sg15_oncv/xml/C_ONCV_PBE-1.0.xml
species Hydrogen http://www.quantum-simulation.org/potentials/sg15_oncv/xml/C_ONCV_PBE-1.0.xml
atom C1 Carbon 0.0 0.0 0.0
atom H2 Hydrogen 1.185992116575257 -1.185803143962673 1.185992116575257
atom H3 Hydrogen -1.185992116575257 1.185992116575257 1.185992116575257
atom H4 Hydrogen -1.185992116575257 -1.185992116575257 -1.185992116575257
atom H5 Hydrogen 1.185992116575257 1.185992116575257 -1.185992116575257
set ecut 40.0
set wf_dyn JD
set xc PBE
set scf_tol 1.e-8
randomize_wf
run -atomic_density 0 100 5
save gs.xml

We can optionally also download the pseudopotentials files.

[9]:
gs.downloadPseudopotentials()
Downloaded file:  C_ONCV_PBE-1.0.xml , from url:  http://www.quantum-simulation.org/potentials/sg15_oncv/xml/C_ONCV_PBE-1.0.xml
Downloaded file:  C_ONCV_PBE-1.0.xml , from url:  http://www.quantum-simulation.org/potentials/sg15_oncv/xml/C_ONCV_PBE-1.0.xml
[ ]: