[DFTB-Plus-User] Calculation of Kpoints

Carlo Nervi carlo.nervi at unito.it
Mon Nov 16 11:57:21 CET 2020


Dear Bàlint,
thank you for the reply.
I was testing and adopted your suggestion with some modifications. The code
to get the proper number of Kpoints is below.
I'd like to use DFTB+ in periodic systems, but I experienced some
difficulties whenever the periodic cell contains a relevant number of atoms
(i.e >100). I will make some further tests and report in another mail.
The bash code below (test.sh) can be used as:  "test.sh DFTB.gen" to return
computed Kpoints from DFTB.gen. The KP_x KP_y and KP_z are the number which
can be found in the "KPointsAndWeights = SupercellFolding {" section. This
routine compute the Kpoints from the input structure (gen format) with a
certain resolution (1/15):

#!/bin/bash
# Calcola i kpoints risoluzione 1/15.0 = 0.0667
  KP_x=$(awk 'NR==1 {n=$1; for (i=0; i<n+3; i++) getline; v00=$1; v01=$2;
v02=$3; getline; v10=$1; v11=$2; v12=$3; getline; v20=$1; v21=$2; v22=$3
    a=sqrt(v00^2 + v01^2 + v02^2); k=int(15.0/a + 0.5);  if (k < 1) k=1;
print k}' $1)
  KP_y=$(awk 'NR==1 {n=$1; for (i=0; i<n+3; i++) getline; v00=$1; v01=$2;
v02=$3; getline; v10=$1; v11=$2; v12=$3; getline; v20=$1; v21=$2; v22=$3
    b=sqrt(v10^2 + v11^2 + v12^2); k=int(15.0/b + 0.5);  if (k < 1) k=1;
print k}' $1)
  KP_z=$(awk 'NR==1 {n=$1; for (i=0; i<n+3; i++) getline; v00=$1; v01=$2;
v02=$3; getline; v10=$1; v11=$2; v12=$3; getline; v20=$1; v21=$2; v22=$3
    c=sqrt(v20^2 + v21^2 + v22^2); k=int(15.0/c + 0.5);  if (k < 1) k=1;
print k}' $1)

  if ((KP_x %2 + KP_y %2 + KP_z %2 == 3)); then
    kpoints=$(( KP_x * KP_y * KP_z  + 1 ))
  else
    kpoints=$(( KP_x * KP_y * KP_z ))
  fi
  if ((kpoints %2 == 0 )); then
    kpoints=$((kpoints/2))
  fi
printf "KP_x = %d   KP_y = %d   KP_z = %d   kpoints =%d\n" $KP_x $KP_y
$KP_z $kpoints

All the best,
Carlo


Il giorno ven 13 nov 2020 alle ore 10:48 Bálint Aradi <aradi at uni-bremen.de>
ha scritto:

> Dear Carlo,
>
> > As far as I understood the best value of *n* should be a multiple of
> > Kpoints, if possible.
>
> That's true, but only if you use process groups (Parallel/Groups). If
> you for example have nK K-points and nProc processes (with nProc = n *
> nK), then creating n groups would be the most efficient parallelisation.
>
> > My question is: *is there any way to compute in advance the number of
> > Kpoints without running dftb+?*
>
> Since DFTB+ only reduces the K-points by the inversion symmetry, it is
> often easy to guess nr. of k-points in advance. For the commonly used
> MP-scheme with
>
> SupercellFolding {
>   n1 0 0
>    0 n2 0
>    0  0 n3
>    s1 s2 s3
> }
>
> it would be
>
> - (n1 * n2 * n3) / 2 if n1, n2, n3 are even and s1 = s2 = s3 = 0.5
>
> - (n1 * n2 * n3 + 1) / 2 if n1, n2, n3 are odd and s1 = s2 = s3 = 0.0
>   or s1 = s2 = s3 = 0.5
>
> - and probably (n1 * n2 * n3) in most other cases.
>
>
> Best regards,
>
> Bálint
>
>
> Ps. In case, you are interested to contribute: It would actually not too
> complicated to assamble a small tool, which parses the DFTB+ input and
> spits out the k-points.
>
> --
> Dr. Bálint Aradi
> Bremen Center for Computational Materials Science, University of Bremen
> http://www.bccms.uni-bremen.de/cms/people/b-aradi/
>
>
> _______________________________________________
> DFTB-Plus-User mailing list
> DFTB-Plus-User at mailman.zfn.uni-bremen.de
> https://mailman.zfn.uni-bremen.de/cgi-bin/mailman/listinfo/dftb-plus-user
>


-- 

------------------------------------------------------------
Prof. Carlo Nervi carlo.nervi at unito.it  Tel:+39 0116707507/8
Fax: +39 0116707855      -      Dipartimento di Chimica, via
P. Giuria 7, 10125 Torino, Italy.    http://lem.ch.unito.it/

*ICCC2020 has been postponed at 2022*

ICCC 2022 28 August - 2 September 2022, Rimini, Italy: http://www.iccc2020.com
International Conference on Coordination Chemistry (ICCC 2022)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.zfn.uni-bremen.de/pipermail/dftb-plus-user/attachments/20201116/ebb0caf0/attachment.htm>


More information about the DFTB-Plus-User mailing list