How to produce the K point of the full Brillouin zone of the hexagonal structure

General discussion around the EPW software

Moderator: stiwari

Post Reply
guodonglin
Posts: 10
Joined: Mon Mar 29, 2021 5:56 am
Affiliation: CQU

How to produce the K point of the full Brillouin zone of the hexagonal structure

Post by guodonglin »

Dear all,

How to produce the K point of the full Brillouin zone of the hexagonal structure.

Donglin Guo
stiwari
Posts: 50
Joined: Mon Jun 26, 2023 9:48 pm
Affiliation: UT Austin

Re: How to produce the K point of the full Brillouin zone of the hexagonal structure

Post by stiwari »

Hi Donglin,

There are multiple codes which can produce the uniform grid in the full Brillouin zone. The easiest method is to use the perl code below (Part of Wannier90 distribution kmesh.pl). To run the code below and generate a 6 6 6 k-grid -> perl kmesh.pl 6 6 6

Best regards,
Sabya

Code: Select all

[#!/usr/bin/perl -w


$numargs = $#ARGV+1;

if (($numargs<3)||($numargs>4)) {
    print  "usage: n1 n2 n3 [wan]\n";
    print  "       n1  - divisions along 1st recip vector\n";
    print  "       n2  - divisions along 2nd recip vector\n";
    print  "       n3  - divisions along 3rd recip vector\n";
    print  "       wan - omit the kpoint weight (optional)\n";
    exit;
}

if ($ARGV[0]<=0) {
    print "n1 must be >0\n";
    exit;
}
if ($ARGV[1]<=0) {
    print "n2 must be >0\n";
    exit;
}
if ($ARGV[2]<=0) {
    print "n3 must be >0\n";
    exit;
}

$totpts=$ARGV[0]*$ARGV[1]*$ARGV[2];

if ($numargs==3) {
    print "K_POINTS crystal\n";
    print $totpts,"\n";
    for ($x=0; $x<$ARGV[0]; $x++) {
    for ($y=0; $y<$ARGV[1]; $y++) {
        for ($z=0; $z<$ARGV[2]; $z++) {
        printf ("%12.8f%12.8f%12.8f%14.6e\n", $x/$ARGV[0],$y/$ARGV[1],$z/$ARGV[2],1/$totpts);
        }
    }
    }
}


if ($numargs==4) {
    for ($x=0; $x<$ARGV[0]; $x++) {
    for ($y=0; $y<$ARGV[1]; $y++) {
        for ($z=0; $z<$ARGV[2]; $z++) {
        printf ("%12.8f%12.8f%12.8f\n", $x/$ARGV[0],$y/$ARGV[1],$z/$ARGV[2]);
        }
    }
    }
}


exit;
]
Post Reply