[ase-users] Minimum k-point density
Peter Bjerre Jensen
pbjen at dtu.dk
Fri Mar 6 16:38:06 CET 2015
(crossposting to gpaw-users and ase-users, as both codes are involved)
Hi
According to the gpaw manual
(https://wiki.fysik.dtu.dk/gpaw/documentation/manual.html#manual-kpts)
one can specify a k-point density, instead of number of kpts per direction:
You can also specify the *k*-point density in units of points per Å−1:
kpts={'density': 2.5} # Monkhorst-Pack with a density of 2.5 points/Ang^-1
kpts={'density': 2.5, 'even': True} # round off to neares even number
kpts={'density': 2.5, 'gamma': True} # include gamma-point
The *k*-point density is calculated as:
Na2π,
Normally I would expect that one was interested in specifying a minimum
k-point density, but that is not how the function works. (the calls go
all the way to ase.calculators.calculator.py)
def kptdensity2monkhorstpack(atoms, kptdensity=3.5, even=True):
"""Convert k-point density to Monkhorst-Pack grid size.
atoms: Atoms object
Contains unit cell and information about boundary conditions.
kptdensity: float
K-point density. Default value is 3.5 point per Ang^-1.
even: bool
Round to even numbers.
"""
recipcell = atoms.get_reciprocal_cell()
kpts = []
for i in range(3):
if atoms.pbc[i]:
k = 2 * pi * sqrt((recipcell[i]**2).sum()) * kptdensity
if even:
kpts.append(max(1, 2 * int(round(k / 2))))
else:
kpts.append(max(1, int(round(k))))
else:
kpts.append(1)
return np.array(kpts)
If one for example specify a cell = [6,6,6] and a kptdensity = 25/(2pi),
kpts is set to [4,4,4], which give a lower kpts-density (24 kpts per Å^-1).
Wouldn't it make more sence to use int(ceil(***)), to ensure a minimum
density? (if so, the max(1,*) can also be skipped)
Furthermore there is the option to only allow even integers - are there
any other reasons that one wants this, than to optimize the
parallelization, and it is recommend "always" to use even=True?
Best regards
Peter
Peter Bjerre Jensen
Postdoc
DTU Energy
Technical University of Denmark
Department of Energy Conversion and Storage
Fysikvej, Building 309
2800 Kgs. Lyngby
pbjen at dtu.dk <mailto:pbjen at dtu.dk>
www.ecs.dtu.dk <http://www.ecs.dtu.dk>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20150306/083fd0af/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DTU_email_logo_01.gif
Type: image/gif
Size: 1055 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20150306/083fd0af/attachment.gif>
More information about the ase-users
mailing list