GPAW: DFT and beyond within the projector-augmented wave method

GPAW is a density-functional theory (DFT) Python code based on the projector-augmented wave (PAW) method and the atomic simulation environment (ASE). The wave functions can be described with:

  • Plane-waves (pw)

  • Real-space uniform grids, multigrid methods and the finite-difference approximation (fd)

  • Atom-centered basis-functions (lcao)

>>> # H2-molecule example:
>>> import numpy as np
>>> from ase import Atoms
>>> from gpaw import GPAW, PW
>>> h2 = Atoms('H2', [(0, 0, 0), (0, 0, 0.74)])
>>> h2.center(vacuum=2.5)
>>> h2.cell
Cell([5.0, 5.0, 5.74])
>>> h2.positions
array([[2.5 , 2.5 , 2.5 ],
       [2.5 , 2.5 , 3.24]])
>>> h2.calc = GPAW(xc='PBE',
...                mode=PW(300),
...                txt='h2.txt')
>>> energy = h2.get_potential_energy()
>>> print(f'Energy: {energy:.3f} eV')
Energy: -6.631 eV
>>> forces = h2.get_forces()
>>> forces.shape
(2, 3)
>>> print(f'Force: {forces[0, 2]:.3f} eV/Å')
Force: -0.639 eV/Å
https://badge.fury.io/py/gpaw.svg

News