Debian Codegraph @

doc/tutorialsexercises/opticalresponse/tddft/lcaotddft_Ag55/mybasis/gs.py

raw
1 from ase.io import read
2 from gpaw import GPAW, FermiDirac, Mixer, PoissonSolver
3 from gpaw import setup_paths
4 from gpaw.poisson_moment import MomentCorrectionPoissonSolver
5
6 # Insert the path to the created basis set
7 setup_paths.insert(0, '.')
8
9 # Read the structure from the xyz file
10 atoms = read('Ag55.xyz')
11 atoms.center(vacuum=6.0)
12
13 # Increase the accuracy of density for ground state
14 convergence = {'density': 1e-12}
15
16 # Use occupation smearing, weak mixer and GLLB weight smearing
17 # to facilitate convergence
18 occupations = FermiDirac(25e-3)
19 mixer = Mixer(0.02, 5, 1.0)
20 xc = 'GLLBSC:width=0.002'
21
22 # Parallelzation settings
23 parallel = {'sl_auto': True, 'domain': 2, 'augment_grids': True}
24
25 # Apply multipole corrections for monopole and dipoles
26 poissonsolver = MomentCorrectionPoissonSolver(poissonsolver=PoissonSolver(),
27 moment_corrections=1 + 3)
28
29 # Ground-state calculation
30 calc = GPAW(mode='lcao', xc=xc, h=0.3, nbands=360,
31 setups={'Ag': 'my'},
32 basis={'Ag': 'GLLBSC.dz', 'default': 'dzp'},
33 convergence=convergence, poissonsolver=poissonsolver,
34 occupations=occupations, mixer=mixer, parallel=parallel,
35 maxiter=1000,
36 txt='gs.out',
37 symmetry={'point_group': False})
38 atoms.calc = calc
39 atoms.get_potential_energy()
40 calc.write('gs.gpw', mode='all')