quanshengwu / wannier_tools

WannierTools: An open-source software package for novel topological materials. Full documentation:
http://www.wanniertools.org
GNU General Public License v3.0
261 stars 141 forks source link

Bugs in Find Nodes calculation #100

Closed tlsong closed 2 years ago

tlsong commented 2 years ago

Hello, Dear Wu @quanshengwu

When pull down the package git clone https://github.com/quanshengwu/wannier_tools.git And in the latest version, there may be some bugs in the "Find Nodes calculation". See below: in Nodes.dat

# local minimal position and the related energy gap
#        kx            ky            kz           gap             E            k1            k2            k3
   -0.00000016    0.41507169    0.04825256    0.00000001    3.27665641    0.54394386   -0.44350501    0.44350481
    0.00000015   -0.38166991    0.04719874    0.00000002    3.25834809   -0.40487065    0.50311594   -0.50311575

in WT.out

Three reciprocal lattice vectors of the primitive cell:
    0.000000    0.794342    0.907857
    1.518019    0.000000    0.907857
    1.518019    0.794342    0.000000

Use the following Python code for validation calculations

import numpy as np

#Three reciprocal lattice vectors of the primitive cell
m = np.array(
[[0.000000,  0.794342,  0.907857],
[1.518019,  0.000000,  0.907857],
[1.518019,  0.794342,  0.000000]]
)
# k1 k2 k3
k1k2k3 = [-0.40487065,0.50311594,-0.50311575]

#kx ky kz
kxkykz = np.dot(k1k2k3,m)
print(kxkykz)

it gives:

[ 2.88423610e-07 -7.21251733e-01  8.91926742e-02]

 and is different from

0.00000015   -0.38166991    0.04719874

So there may be some bugs in the source code

tlsong commented 2 years ago

@quanshengwu Tested with the latest development branch, and it is fixed, thank you very much.