gs.py 1.16 KB
Newer Older
Tuomas Rossi's avatar
Tuomas Rossi committed
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 30 31 32 33 34 35 36
from ase.io import read
from gpaw import GPAW, FermiDirac, Mixer, PoissonSolver
from gpaw import setup_paths

# Insert the path to the created basis set
setup_paths.insert(0, '.')

# Read the structure from the xyz file
atoms = read('Ag55.xyz')
atoms.center(vacuum=6.0)

# Increase the accuracy of density for ground state
convergence = {'density': 1e-12}

# Use occupation smearing and weak mixer to facilitate convergence
occupations = FermiDirac(25e-3)
mixer = Mixer(0.02, 5, 1.0)

# Parallelzation settings
parallel = {'sl_auto': True, 'domain': 2, 'augment_grids': True}

# Increase the accuracy of PoissonSolver and
# apply multipole corrections for monopole and dipoles
poissonsolver = PoissonSolver(eps=1e-16, remove_moment=1 + 3)

# Ground-state calculation
calc = GPAW(mode='lcao', xc='GLLBSC', h=0.3, nbands=360,
            setups={'Ag': 'my'},
            basis={'Ag': 'GLLBSC.dz', 'default': 'dpz'},
            convergence=convergence, poissonsolver=poissonsolver,
            occupations=occupations, mixer=mixer, parallel=parallel,
            maxiter=1000,
            txt='gs.out')
atoms.set_calculator(calc)
atoms.get_potential_energy()
calc.write('gs.gpw', mode='all')