File: sic_example_fd.py

package info (click to toggle)
gpaw 25.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 18,888 kB
  • sloc: python: 174,804; ansic: 17,564; cpp: 5,668; sh: 972; csh: 139; makefile: 45
file content (29 lines) | stat: -rwxr-xr-x 927 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import numpy as np
from ase import Atoms
from gpaw import FD, GPAW
from gpaw.directmin.etdm_fdpw import FDPWETDM

# Water molecule:
d = 0.9575
t = np.pi / 180 * 104.51
H2O = Atoms('OH2',
            positions=[(0, 0, 0),
                       (d, 0, 0),
                       (d * np.cos(t), d * np.sin(t), 0)])
H2O.center(vacuum=5.0)

calc = GPAW(mode=FD(force_complex_dtype=True),
            xc='PBE',
            occupations={'name': 'fixed-uniform'},
            eigensolver=FDPWETDM(localizationtype='PM_PZ',
                                 functional={'name': 'PZ-SIC',
                                             'scaling_factor':
                                                 (0.5, 0.5)},
                                 grad_tol_pz_localization=1.0e-4),
            mixer={'backend': 'no-mixing'},
            symmetry='off'
            )

H2O.set_calculator(calc)
H2O.get_potential_energy()
H2O.get_forces()