#!/usr/bin/env python
from ase import Atom, Atoms
from gpaw import GPAW, KohnShamConvergenceError
from gpaw.test import equal

a = 2.0
b = a / 2
mol = Atoms([Atom('O',(b, b, 0.1219 + b)),
             Atom('H',(b, 0.7633 + b, -0.4876 + b)),
             Atom('H',(b, -0.7633 + b, -0.4876 + b))],
            pbc=True, cell=[a, a, a])
calc = GPAW(#gpts=(12, 12, 12),
            nbands=4, mode='lcao',
            h=0.2,
            kpts=(1, 1, 4),
            maxiter=1, txt=None
            #parallel=dict(sl_default=(1,1,2))
            )
mol.set_calculator(calc)
try:
    e = mol.get_potential_energy()
except KohnShamConvergenceError:
    pass


