Commit df446344 authored by Marco Govoni's avatar Marco Govoni
Browse files

Preparing 3.1.1

parent 3179d1ea
...@@ -64,7 +64,7 @@ author = u'Marco Govoni' ...@@ -64,7 +64,7 @@ author = u'Marco Govoni'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '3.1.0' version = '3.1.1'
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = version release = version
......
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
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
from westpy import * from westpy import *
``` ```
%%%% 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.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
geom.addAtomsFromOnlineXYZ( "http://www.west-code.org/doc/training/methane/CH4.xyz" ) geom.addAtomsFromOnlineXYZ( "http://www.west-code.org/doc/training/methane/CH4.xyz" )
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
We associate pseudopotential files to each species. We associate pseudopotential files to each species.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
geom.addSpecies( "C", "http://www.quantum-simulation.org/potentials/sg15_oncv/upf/C_ONCV_PBE-1.0.upf") geom.addSpecies( "C", "http://www.quantum-simulation.org/potentials/sg15_oncv/upf/C_ONCV_PBE-1.0.upf")
geom.addSpecies( "H", "http://www.quantum-simulation.org/potentials/sg15_oncv/upf/H_ONCV_PBE-1.0.upf") geom.addSpecies( "H", "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.1: Ground State ## Step 3.1: Ground State
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
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
with open("pw.in","r") as file : with open("pw.in","r") as file :
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.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
gs.updateSpecies("C", "http://www.quantum-simulation.org/potentials/sg15_oncv/xml/C_ONCV_PBE-1.0.xml") gs.updateSpecies("C", "http://www.quantum-simulation.org/potentials/sg15_oncv/xml/C_ONCV_PBE-1.0.xml")
gs.updateSpecies("H", "http://www.quantum-simulation.org/potentials/sg15_oncv/xml/H_ONCV_PBE-1.0.xml") gs.updateSpecies("H", "http://www.quantum-simulation.org/potentials/sg15_oncv/xml/H_ONCV_PBE-1.0.xml")
``` ```
%% 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.generateInputQbox() gs.generateInputQbox()
``` ```
%%%% Output: stream %%%% Output: stream
Generated file: qbox.in Generated file: qbox.in
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
We can inspect the file qbox.in We can inspect the file qbox.in
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
with open("qbox.in","r") as file : with open("qbox.in","r") as file :
data = file.read() data = file.read()
print(data) print(data)
``` ```
%%%% Output: stream %%%% Output: stream
set cell 25.0 0.0 0.0 0.0 25.0 0.0 0.0 0.0 25.0 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 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/H_ONCV_PBE-1.0.xml species Hydrogen http://www.quantum-simulation.org/potentials/sg15_oncv/xml/H_ONCV_PBE-1.0.xml
atom C1 Carbon 0.0 0.0 0.0 atom C1 Carbon 0.0 0.0 0.0
atom H2 Hydrogen 1.185992116575257 -1.185803143962673 1.185992116575257 atom H2 Hydrogen 1.185992116575257 -1.185803143962673 1.185992116575257
atom H3 Hydrogen -1.185992116575257 1.185992116575257 1.185992116575257 atom H3 Hydrogen -1.185992116575257 1.185992116575257 1.185992116575257
atom H4 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 atom H5 Hydrogen 1.185992116575257 1.185992116575257 -1.185992116575257
set ecut 40.0 set ecut 40.0
set wf_dyn JD set wf_dyn JD
set xc PBE set xc PBE
set scf_tol 1.e-8 set scf_tol 1.e-8
randomize_wf randomize_wf
run -atomic_density 0 100 5 run -atomic_density 0 100 5
save gs.xml save gs.xml
%% 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.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
Downloaded file: H_ONCV_PBE-1.0.xml , from url: http://www.quantum-simulation.org/potentials/sg15_oncv/xml/H_ONCV_PBE-1.0.xml Downloaded file: H_ONCV_PBE-1.0.xml , from url: http://www.quantum-simulation.org/potentials/sg15_oncv/xml/H_ONCV_PBE-1.0.xml
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
``` ```
......
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
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
from westpy import * from westpy import *
``` ```
%%%% 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.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
geom.addAtomsFromOnlineXYZ( "http://www.west-code.org/doc/training/methane/CH4.xyz" ) geom.addAtomsFromOnlineXYZ( "http://www.west-code.org/doc/training/methane/CH4.xyz" )
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
We associate pseudopotential files to each species. We associate pseudopotential files to each species.
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
geom.addSpecies( "C", "http://www.quantum-simulation.org/potentials/sg15_oncv/xml/C_ONCV_PBE-1.0.xml") 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") geom.addSpecies( "H", "http://www.quantum-simulation.org/potentials/sg15_oncv/xml/C_ONCV_PBE-1.0.xml")
``` ```
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
## Step 3.1: Ground State ## Step 3.1: Ground State
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
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.