This tutorial can be downloaded [link](http://greatfire.uchicago.edu/west-public/westpy/raw/master/doc/tutorials/westpy_100.ipynb).
This tutorial can be downloaded [link](http://greatfire.uchicago.edu/west-public/westpy/raw/master/doc/tutorials/westpy_100.ipynb).
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
# 1.0 Getting Started: Ground State
# 1.0 Getting Started: Ground State
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
We are going to generate an input file for the [QuantumEspresso](https://www.quantum-espresso.org/) code or [Qbox](http://qboxcode.org/). Each code will compute the ground state electronic stucture for the methane molecule using Density Functional Theory.
We are going to generate an input file for the [QuantumEspresso](https://www.quantum-espresso.org/) code or [Qbox](http://qboxcode.org/). Each code will compute the ground state electronic stucture for the methane molecule using Density Functional Theory.
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
## Step 1: Load westpy
## Step 1: Load westpy
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
fromwestpyimport*
fromwestpyimport*
```
```
%%%% Output: stream
%%%% Output: stream
_ _ _____ _____ _____
_ _ _____ _____ _____
| | | | ___/ ___|_ _|
| | | | ___/ ___|_ _|
| | | | |__ \ `--. | |_ __ _ _
| | | | |__ \ `--. | |_ __ _ _
| |/\| | __| `--. \ | | '_ \| | | |
| |/\| | __| `--. \ | | '_ \| | | |
\ /\ / |___/\__/ / | | |_) | |_| |
\ /\ / |___/\__/ / | | |_) | |_| |
\/ \/\____/\____/ \_/ .__/ \__, |
\/ \/\____/\____/ \_/ .__/ \__, |
| | __/ |
| | __/ |
|_| |___/
|_| |___/
WEST version : 3.1.0
WEST version : 3.1.1
Today : 2018-06-29 15:23:25.768394
Today : 2018-09-19 15:21:13.244247
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
## Step 2: Geometry
## Step 2: Geometry
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
geom=Geometry()
geom=Geometry()
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Let's define a cubic cell of edge 25 Bohr.
Let's define a cubic cell of edge 25 Bohr.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
geom.setCell((25,0,0),(0,25,0),(0,0,25))
geom.setCell((25,0,0),(0,25,0),(0,0,25))
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
We load the atomic positions from a XYZ file, available online.
We load the atomic positions from a XYZ file, available online.
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.
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.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
gs=GroundState(geom,xc="PBE",ecut=40.0)
gs=GroundState(geom,xc="PBE",ecut=40.0)
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
We are now able to generate the input file for QuantumEspresso.
We are now able to generate the input file for QuantumEspresso.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
gs.generateInputPW()
gs.generateInputPW()
```
```
%%%% Output: stream
%%%% Output: stream
Generated file: pw.in
Generated file: pw.in
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
We can inspect the file pw.in
We can inspect the file pw.in
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
withopen("pw.in","r")asfile:
withopen("pw.in","r")asfile:
data=file.read()
data=file.read()
print(data)
print(data)
```
```
%%%% Output: stream
%%%% Output: stream
&CONTROL
&CONTROL
calculation = 'scf'
calculation = 'scf'
restart_mode = 'from_scratch'
restart_mode = 'from_scratch'
pseudo_dir = './'
pseudo_dir = './'
outdir = './'
outdir = './'
prefix = 'calc'
prefix = 'calc'
wf_collect = .TRUE.
wf_collect = .TRUE.
/
/
&SYSTEM
&SYSTEM
ibrav = 0
ibrav = 0
nat = 5
nat = 5
ntyp = 2
ntyp = 2
ecutwfc = 40.0
ecutwfc = 40.0
nbnd = 8
nbnd = 8
input_dft = 'PBE'
input_dft = 'PBE'
nosym = .TRUE.
nosym = .TRUE.
noinv = .TRUE.
noinv = .TRUE.
/
/
&ELECTRONS
&ELECTRONS
diago_full_acc = .TRUE.
diago_full_acc = .TRUE.
conv_thr = 1.d-8
conv_thr = 1.d-8
/
/
ATOMIC_SPECIES
ATOMIC_SPECIES
C 12.011 C_ONCV_PBE-1.0.upf
C 12.011 C_ONCV_PBE-1.0.upf
H 1.008 H_ONCV_PBE-1.0.upf
H 1.008 H_ONCV_PBE-1.0.upf
ATOMIC_POSITIONS {bohr}
ATOMIC_POSITIONS {bohr}
C 0.0 0.0 0.0
C 0.0 0.0 0.0
H 1.185992116575257 -1.185803143962673 1.185992116575257
H 1.185992116575257 -1.185803143962673 1.185992116575257
H -1.185992116575257 1.185992116575257 1.185992116575257
H -1.185992116575257 1.185992116575257 1.185992116575257
H -1.185992116575257 -1.185992116575257 -1.185992116575257
H -1.185992116575257 -1.185992116575257 -1.185992116575257
H 1.185992116575257 1.185992116575257 -1.185992116575257
H 1.185992116575257 1.185992116575257 -1.185992116575257
K_POINTS {gamma}
K_POINTS {gamma}
CELL_PARAMETERS {bohr}
CELL_PARAMETERS {bohr}
25.0 0.0 0.0
25.0 0.0 0.0
0.0 25.0 0.0
0.0 25.0 0.0
0.0 0.0 25.0
0.0 0.0 25.0
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
We can optionally also download the pseudopotentials files.
We can optionally also download the pseudopotentials files.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
gs.downloadPseudopotentials()
gs.downloadPseudopotentials()
```
```
%%%% Output: stream
%%%% Output: stream
Downloaded file: C_ONCV_PBE-1.0.upf , from url: http://www.quantum-simulation.org/potentials/sg15_oncv/upf/C_ONCV_PBE-1.0.upf
Downloaded file: C_ONCV_PBE-1.0.upf , from url: http://www.quantum-simulation.org/potentials/sg15_oncv/upf/C_ONCV_PBE-1.0.upf
Downloaded file: H_ONCV_PBE-1.0.upf , from url: http://www.quantum-simulation.org/potentials/sg15_oncv/upf/H_ONCV_PBE-1.0.upf
Downloaded file: H_ONCV_PBE-1.0.upf , from url: http://www.quantum-simulation.org/potentials/sg15_oncv/upf/H_ONCV_PBE-1.0.upf
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
## Step 3.2: Ground State with Qbox
## Step 3.2: Ground State with Qbox
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
To generate the input for Qbox we can simply update Species to use the xml formats.
To generate the input for Qbox we can simply update Species to use the xml formats.
This tutorial can be downloaded [link](http://greatfire.uchicago.edu/west-public/westpy/raw/master/doc/tutorials/westpy_101.ipynb).
This tutorial can be downloaded [link](http://greatfire.uchicago.edu/west-public/westpy/raw/master/doc/tutorials/westpy_101.ipynb).
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
# 1.1 Ground State Calculation with Qbox
# 1.1 Ground State Calculation with Qbox
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
We are going to generate an input file for the [Qbox](http://qboxcode.org/) code. The code will compute the ground state electronic stucture for the methane molecule using Density Functional Theory.
We are going to generate an input file for the [Qbox](http://qboxcode.org/) code. The code will compute the ground state electronic stucture for the methane molecule using Density Functional Theory.
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
## Step 1: Load westpy
## Step 1: Load westpy
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
fromwestpyimport*
fromwestpyimport*
```
```
%%%% Output: stream
%%%% Output: stream
_ _ _____ _____ _____
_ _ _____ _____ _____
| | | | ___/ ___|_ _|
| | | | ___/ ___|_ _|
| | | | |__ \ `--. | |_ __ _ _
| | | | |__ \ `--. | |_ __ _ _
| |/\| | __| `--. \ | | '_ \| | | |
| |/\| | __| `--. \ | | '_ \| | | |
\ /\ / |___/\__/ / | | |_) | |_| |
\ /\ / |___/\__/ / | | |_) | |_| |
\/ \/\____/\____/ \_/ .__/ \__, |
\/ \/\____/\____/ \_/ .__/ \__, |
| | __/ |
| | __/ |
|_| |___/
|_| |___/
WEST version : 3.1.0
WEST version : 3.1.1
Today : 2018-06-29 15:23:42.948747
Today : 2018-09-19 15:21:57.535713
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
## Step 2: Geometry
## Step 2: Geometry
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
geom=Geometry()
geom=Geometry()
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
Let's define a cubic cell of edge 25 Bohr.
Let's define a cubic cell of edge 25 Bohr.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
geom.setCell((25,0,0),(0,25,0),(0,0,25))
geom.setCell((25,0,0),(0,25,0),(0,0,25))
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
We load the atomic positions from a XYZ file, available online.
We load the atomic positions from a XYZ file, available online.
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.
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.
%% Cell type:code id: tags:
%% Cell type:code id: tags:
``` python
``` python
gs=GroundState(geom,xc="PBE",ecut=40.0)
gs=GroundState(geom,xc="PBE",ecut=40.0)
```
```
%% Cell type:markdown id: tags:
%% Cell type:markdown id: tags:
We are now able to generate the input file for Qbox.
We are now able to generate the input file for Qbox.