File: h2_gs.py

package info (click to toggle)
gpaw 21.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 14,492 kB
  • sloc: python: 121,997; ansic: 14,138; sh: 1,125; csh: 139; makefile: 43
file content (16 lines) | stat: -rw-r--r-- 496 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from ase import Atoms
from gpaw import GPAW

name = 'h2_diss'

# Create H2 molecule in the center of a box aligned along the z axis.
d_bond = 0.754  # H2 equilibrium bond length
atoms = Atoms('H2', positions=[(0, 0, 0), (0, 0, d_bond)])
atoms.set_pbc(False)
atoms.center(vacuum=4.0)

# Set groundstate calculator and get and save wavefunctions
calc = GPAW(h=0.3, nbands=1, basis='dzp', txt=name + '_gs.txt')
atoms.calc = calc
atoms.get_potential_energy()
calc.write(name + '_gs.gpw', mode='all')