Debian Codegraph @

doc/tutorialsexercises/energetics/rpa_ex/si.rpa_init_pbe.py

raw symbols SCIP
1 from ase.build import bulk
2 from gpaw import GPAW, FermiDirac
3 from gpaw import PW
4
5
6 # Plane wave cutoff
7 pwcutoff = 400.0
8
9 # NxNxN k-point sampling
10 k = 4
11
12 # Si lattice constant
13 alat = 5.421
14
15 # bulk calculation
16 bulk_crystal = bulk('Si', 'diamond', a=alat)
17 bulk_calc = GPAW(mode=PW(pwcutoff),
18 parallel={'domain': 1, 'band': 1},
19 kpts={'size': (k, k, k), 'gamma': True}, # gamma-centred grid
20 xc='PBE',
21 occupations=FermiDirac(0.01),
22 txt='si.rpa.pbe_output.txt')
23
24 bulk_crystal.calc = bulk_calc
25 e0_bulk_pbe = bulk_crystal.get_potential_energy()
26
27 # Now we have the density, but only the occupied states;
28 # at this point we diagonalise the full Hamiltonian to get
29 # the empty states as well (expensive)
30 bulk_calc.diagonalize_full_hamiltonian(nbands=200)
31
32 # the 'all' ensures we write wavefunctions too
33 bulk_calc.write('bulk.all.gpw', mode='all')