[gpaw-users] Dipole moment
Taha Salavati-Fard
taha at udel.edu
Thu Aug 1 02:43:09 CEST 2019
Dear gpaw users,
I have started gpaw calculations with a 4-layer 2x2 Au111 slab which was
already optimized with vasp. I am using the same functional and E_cut when
I am trying to get wavefunction with gpaw. One very strange observation is
that the converged calculations show the following dipole moment:
Dipole moment: (-16.610906, -0.422997, -0.003230) |e|*Ang
The slab is limited in z-direction ... so this is obviously wrong ...
I need to use the wavefunction to get dielectric function. Is there
anything that you see problematic here?
I have copied my python script here.
Thanks and I really appreciate your help in advance.
Taha
from __future__ import print_function
import numpy as np
from ase.optimize import LBFGS
from ase.parallel import parprint, rank
from ase.visualize import view
from ase import Atoms, cluster, io, constraints
from ase.io import vasp
from gpaw import GPAW, PW, Mixer, FermiDirac, restart
from gpaw.poisson import PoissonSolver
from gpaw.utilities.tools import cutoff2gridspacing, gridspacing2cutoff
from ase.units import Rydberg
from gpaw.utilities import h2gpts
from ase.parallel import paropen, world
from gpaw.response.df import DielectricFunction
# Ground state calculation
atoms = vasp.read_vasp(filename='CONTCAR')
atoms.center()
atoms.set_pbc([1,1,0])
conv = {'energy': 1e-5, 'bands': -10}
calc = GPAW(mode=PW(540),txt='Au111_ground_state_energy.txt',
kpts={'size': (9,9,1), 'gamma': True},
parallel={'band': 1, 'domain': 1},
xc='PBE', convergence=conv,
occupations=FermiDirac(0.001)) # use small FD smearing
atoms.set_calculator(calc)
atoms.get_potential_energy() # get ground state density
#calc.write('Au111_step1.gpw', 'all') # write wavefunctions
# Restart Calculation with fixed density and dense kpoint sampling
#calc.set(kpts={'size': (15,15,1), 'gamma': False}, # dense kpoint sampling
# fixdensity=True)
#calc.diagonalize_full_hamiltonian(nbands=120) # diagonalize Hamiltonian
calc.write('Au111.gpw', 'all') # write wavefunctions
# Getting absorption spectrum
df =
DielectricFunction(calc='Au111.gpw',txt='Au111_dielectric_function.txt',
eta=0.05,ecut=150)
df.get_dielectric_function(filename='Au111_abs.csv')
# Getting macroscopic constant
df = DielectricFunction(calc='Au111.gpw',
frequencies=[0.0],txt='Au111_dielectric_constant.txt',
hilbert=False,
eta=0.0001,
ecut=150)
epsNLF, epsLF = df.get_macroscopic_dielectric_constant()
--
Taha Salavati-fard
Postdoctoral Fellow
Department of Chemical and Biomolecular Engineering
University of Houston, Houston TX
Office: N45, Engineering Bldg 1
Phone: 713-743-4340
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/gpaw-users/attachments/20190731/c67abe83/attachment.html>
More information about the gpaw-users
mailing list