Skip to content

Commit

Permalink
Merge branch 'Matrix_Element' of https://github.com/MuyamiYatara/wann…
Browse files Browse the repository at this point in the history
…ier_tools into Matrix_Element
  • Loading branch information
MuyamiYatara committed Jul 1, 2024
2 parents 61a120b + 4e6f57d commit 6e01b20
Show file tree
Hide file tree
Showing 97 changed files with 9,591 additions and 50,656 deletions.
Binary file added bin/wt2.x
Binary file not shown.
50 changes: 50 additions & 0 deletions examples/3DWeyl-model/wt.in-BerryCurvature_kpath_sepband_calc
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
&TB_FILE
Hrfile = "Weyl3D_hr.dat"
/

!> bulk band structure calculation flag
&CONTROL
BerryCurvature_kpath_sepband_calc
/

&SYSTEM
NumOccupied = 1 ! NumOccupied
SOC = 1 ! soc
E_FERMI = 0 ! e-fermi
/

&PARAMETERS
Nk1 = 60 ! number k points
/

LATTICE
Angstrom
1.0000000 000000000 000000000
000000000 1.0000000 000000000
000000000 000000000 1.0000000

ATOM_POSITIONS
1 ! number of atoms for projectors
Direct ! Direct or Cartisen coordinate
A 0 0 0.

PROJECTORS
1 ! number of projectors
A s


SURFACE ! See doc for details
0 0 1
1 0 0
0 1 0

KPLANE_BULK
Direct
0.00 0.00 0.00 ! Center for 3D k slice
1.00 0.00 0.00 ! The first vector is along x direction
0.00 0.00 1.00 ! The second vector is along z direction

KPATH_BULK ! k point path
2 ! number of k line only for bulk band
X 0.50000 0.00000 0.0000 G 0.00000 0.00000 0.0000
G 0.00000 0.00000 0.0000 Z 0.00000 0.00000 0.5000
84 changes: 84 additions & 0 deletions examples/BHZ-model/BHZ_hr.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
4-band of BHZ model
4 !num_wann
5 ! nrpts
1 1 1 1 1 1 1
0 0 0 1 1 -2.00000000 0.00000000
0 0 0 1 2 0.00000000 0.00000000
0 0 0 1 3 0.00000000 0.00000000
0 0 0 1 4 0.00000000 0.00000000
0 0 0 2 1 0.00000000 0.00000000
0 0 0 2 2 2.00000000 0.00000000
0 0 0 2 3 0.00000000 0.00000000
0 0 0 2 4 0.00000000 0.00000000
0 0 0 3 1 0.00000000 0.00000000
0 0 0 3 2 0.00000000 0.00000000
0 0 0 3 3 -2.00000000 0.00000000
0 0 0 3 4 0.00000000 0.00000000
0 0 0 4 1 0.00000000 0.00000000
0 0 0 4 2 0.00000000 0.00000000
0 0 0 4 3 0.00000000 0.00000000
0 0 0 4 4 2.00000000 0.00000000
1 0 0 1 1 1.00000000 0.00000000
1 0 0 1 2 0.00000000 -0.50000000
1 0 0 1 3 0.00000000 0.00000000
1 0 0 1 4 0.00000000 0.00000000
1 0 0 2 1 0.00000000 -0.50000000
1 0 0 2 2 -1.00000000 0.00000000
1 0 0 2 3 0.00000000 0.00000000
1 0 0 2 4 0.00000000 0.00000000
1 0 0 3 1 0.00000000 0.00000000
1 0 0 3 2 0.00000000 0.00000000
1 0 0 3 3 1.00000000 0.00000000
1 0 0 3 4 0.00000000 0.50000000
1 0 0 4 1 0.00000000 0.00000000
1 0 0 4 2 0.00000000 0.00000000
1 0 0 4 3 0.00000000 0.50000000
1 0 0 4 4 -1.00000000 0.00000000
0 1 0 1 1 1.00000000 0.00000000
0 1 0 1 2 -0.50000000 0.00000000
0 1 0 1 3 0.00000000 0.00000000
0 1 0 1 4 0.00000000 0.00000000
0 1 0 2 1 0.50000000 0.00000000
0 1 0 2 2 -1.00000000 0.00000000
0 1 0 2 3 0.00000000 0.00000000
0 1 0 2 4 0.00000000 0.00000000
0 1 0 3 1 0.00000000 0.00000000
0 1 0 3 2 0.00000000 0.00000000
0 1 0 3 3 1.00000000 0.00000000
0 1 0 3 4 -0.50000000 0.00000000
0 1 0 4 1 0.00000000 0.00000000
0 1 0 4 2 0.00000000 0.00000000
0 1 0 4 3 0.50000000 0.00000000
0 1 0 4 4 -1.00000000 0.00000000
-1 0 0 1 1 1.00000000 0.00000000
-1 0 0 1 2 0.00000000 0.50000000
-1 0 0 1 3 0.00000000 0.00000000
-1 0 0 1 4 0.00000000 0.00000000
-1 0 0 2 1 0.00000000 0.50000000
-1 0 0 2 2 -1.00000000 0.00000000
-1 0 0 2 3 0.00000000 0.00000000
-1 0 0 2 4 0.00000000 0.00000000
-1 0 0 3 1 0.00000000 0.00000000
-1 0 0 3 2 0.00000000 0.00000000
-1 0 0 3 3 1.00000000 0.00000000
-1 0 0 3 4 0.00000000 -0.50000000
-1 0 0 4 1 0.00000000 0.00000000
-1 0 0 4 2 0.00000000 0.00000000
-1 0 0 4 3 0.00000000 -0.50000000
-1 0 0 4 4 -1.00000000 0.00000000
0 -1 0 1 1 1.00000000 0.00000000
0 -1 0 1 2 0.50000000 0.00000000
0 -1 0 1 3 0.00000000 0.00000000
0 -1 0 1 4 0.00000000 0.00000000
0 -1 0 2 1 -0.50000000 0.00000000
0 -1 0 2 2 -1.00000000 0.00000000
0 -1 0 2 3 0.00000000 0.00000000
0 -1 0 2 4 0.00000000 0.00000000
0 -1 0 3 1 0.00000000 0.00000000
0 -1 0 3 2 0.00000000 0.00000000
0 -1 0 3 3 1.00000000 0.00000000
0 -1 0 3 4 0.50000000 0.00000000
0 -1 0 4 1 0.00000000 0.00000000
0 -1 0 4 2 0.00000000 0.00000000
0 -1 0 4 3 -0.50000000 0.00000000
0 -1 0 4 4 -1.00000000 0.00000000
123 changes: 123 additions & 0 deletions examples/BHZ-model/BHZ_hr_gen-case1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#!/bin/python3
import numpy as np
import cmath

# The Hamiltonian is
# ( M-Bk^2 Delta_0+A*k+ )
# ( Delta_0+A*k_ -M+Bk^2 )
# where k^2=kx^2+ky^2

# Case I, QSHE with band inversion and no trivial hybridization
# Delta_0=0, M*B>0, |A|>0

# Case I, QSHE with band inversion and with trivial and nontrivial hybridization
# Delta_0=0.5, M*B>0, |A|>0


# from the kp to TB we use sustitution
# k->sin(k)
# k^2->2(1-cos(k))

# Constants
dp = np.float64
pi = np.arctan(1) * 4
zi = 1j

# Lattice constants
M = 2.0
B = 1.0
A = 1.0
Delta_0= 0.0


# Number of Wannier functions and R points
num_wann = 4
nrpts = 7

# R coordinates
Irvec = np.zeros((3, nrpts), dtype=int)

# Hamiltonian m,n are band indexes
HmnR = np.zeros((num_wann, num_wann, nrpts), dtype=complex)

# No of degeneracy of R point
ndegen = np.ones(nrpts, dtype=int)

# Initialization of matrices
Irvec[:, :] = 0
HmnR[:, :, :] = 0.0

# 0 0 0
ir = 0
Irvec[:, ir] = [0, 0, 0]
HmnR[0, 0, ir] = M - 4 * B
HmnR[1, 1, ir] = -M + 4 * B
HmnR[2, 2, ir] = M - 4 * B
HmnR[3, 3, ir] = -M + 4 * B
HmnR[0, 1, ir] = Delta_0
HmnR[1, 0, ir] = Delta_0
HmnR[2, 3, ir] = Delta_0
HmnR[3, 2, ir] = Delta_0

# 1 0
ir = 1
Irvec[:, ir] = [1, 0, 0]
HmnR[0, 0, ir] = B
HmnR[1, 1, ir] = -B
HmnR[2, 2, ir] = B
HmnR[3, 3, ir] = -B
HmnR[0, 1, ir] =-0.5*zi*A
HmnR[1, 0, ir] =-0.5*zi*A
HmnR[2, 3, ir] = 0.5*zi*A
HmnR[3, 2, ir] = 0.5*zi*A

# 0 1
ir = 2
Irvec[:, ir] = [0, 1, 0]
HmnR[0, 0, ir] = B
HmnR[1, 1, ir] = -B
HmnR[2, 2, ir] = B
HmnR[3, 3, ir] = -B
HmnR[0, 1, ir]= -A/2
HmnR[1, 0, ir]= A/2
HmnR[2, 3, ir]= -A/2
HmnR[3, 2, ir]= A/2


# -1 0
ir = 3
Irvec[:, ir] = [-1, 0, 0]
HmnR[0, 0, ir] = B
HmnR[1, 1, ir] = -B
HmnR[2, 2, ir] = B
HmnR[3, 3, ir] = -B
HmnR[0, 1, ir]= 0.5*zi*A
HmnR[1, 0, ir]= 0.5*zi*A
HmnR[2, 3, ir]=-0.5*zi*A
HmnR[3, 2, ir]=-0.5*zi*A


# 0 -1
ir = 4
Irvec[:, ir] = [0, -1, 0]
HmnR[0, 0, ir] = B
HmnR[1, 1, ir] = -B
HmnR[2, 2, ir] = B
HmnR[3, 3, ir] = -B
HmnR[0, 1, ir]= A/2
HmnR[1, 0, ir]= -A/2
HmnR[2, 3, ir]= A/2
HmnR[3, 2, ir]= -A/2

nrpts= ir+1
# Writing to a file
with open('BHZ_hr.dat', 'w') as file:
file.write('4-band of BHZ model\n')
file.write('4 !num_wann \n')
file.write(f'{nrpts} ! nrpts\n')
file.write(' '.join(f'{x:5d}' for x in ndegen) + '\n')
for ir in range(nrpts):
for i in range(4):
for j in range(4):
file.write(f"{Irvec[0, ir]:5d}{Irvec[1, ir]:5d}{Irvec[2, ir]:5d}{i+1:5d}{j+1:5d} {HmnR[i, j, ir].real:16.8f} {HmnR[i, j, ir].imag:16.8f}\n")

123 changes: 123 additions & 0 deletions examples/BHZ-model/BHZ_hr_gen-case2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
#!/bin/python3
import numpy as np
import cmath

# The Hamiltonian is
# ( M-Bk^2 Delta_0+A*k+ )
# ( Delta_0+A*k_ -M+Bk^2 )
# where k^2=kx^2+ky^2

# Case I, QSHE with band inversion and no trivial hybridization
# Delta_0=0, M*B>0, |A|>0

# Case I, QSHE with band inversion and with trivial and nontrivial hybridization
# Delta_0=0.5, M*B>0, |A|>0


# from the kp to TB we use sustitution
# k->sin(k)
# k^2->2(1-cos(k))

# Constants
dp = np.float64
pi = np.arctan(1) * 4
zi = 1j

# Lattice constants
M = 2.0
B = 1.0
A = 1.0
Delta_0= 0.5


# Number of Wannier functions and R points
num_wann = 4
nrpts = 7

# R coordinates
Irvec = np.zeros((3, nrpts), dtype=int)

# Hamiltonian m,n are band indexes
HmnR = np.zeros((num_wann, num_wann, nrpts), dtype=complex)

# No of degeneracy of R point
ndegen = np.ones(nrpts, dtype=int)

# Initialization of matrices
Irvec[:, :] = 0
HmnR[:, :, :] = 0.0

# 0 0 0
ir = 0
Irvec[:, ir] = [0, 0, 0]
HmnR[0, 0, ir] = M - 4 * B
HmnR[1, 1, ir] = -M + 4 * B
HmnR[2, 2, ir] = M - 4 * B
HmnR[3, 3, ir] = -M + 4 * B
HmnR[0, 1, ir] = Delta_0
HmnR[1, 0, ir] = Delta_0
HmnR[2, 3, ir] = Delta_0
HmnR[3, 2, ir] = Delta_0

# 1 0
ir = 1
Irvec[:, ir] = [1, 0, 0]
HmnR[0, 0, ir] = B
HmnR[1, 1, ir] = -B
HmnR[2, 2, ir] = B
HmnR[3, 3, ir] = -B
HmnR[0, 1, ir] =-0.5*zi*A
HmnR[1, 0, ir] =-0.5*zi*A
HmnR[2, 3, ir] = 0.5*zi*A
HmnR[3, 2, ir] = 0.5*zi*A

# 0 1
ir = 2
Irvec[:, ir] = [0, 1, 0]
HmnR[0, 0, ir] = B
HmnR[1, 1, ir] = -B
HmnR[2, 2, ir] = B
HmnR[3, 3, ir] = -B
HmnR[0, 1, ir]= -A/2
HmnR[1, 0, ir]= A/2
HmnR[2, 3, ir]= -A/2
HmnR[3, 2, ir]= A/2


# -1 0
ir = 3
Irvec[:, ir] = [-1, 0, 0]
HmnR[0, 0, ir] = B
HmnR[1, 1, ir] = -B
HmnR[2, 2, ir] = B
HmnR[3, 3, ir] = -B
HmnR[0, 1, ir]= 0.5*zi*A
HmnR[1, 0, ir]= 0.5*zi*A
HmnR[2, 3, ir]=-0.5*zi*A
HmnR[3, 2, ir]=-0.5*zi*A


# 0 -1
ir = 4
Irvec[:, ir] = [0, -1, 0]
HmnR[0, 0, ir] = B
HmnR[1, 1, ir] = -B
HmnR[2, 2, ir] = B
HmnR[3, 3, ir] = -B
HmnR[0, 1, ir]= A/2
HmnR[1, 0, ir]= -A/2
HmnR[2, 3, ir]= A/2
HmnR[3, 2, ir]= -A/2

nrpts= ir+1
# Writing to a file
with open('BHZ_hr.dat', 'w') as file:
file.write('4-band of BHZ model\n')
file.write('4 !num_wann \n')
file.write(f'{nrpts} ! nrpts\n')
file.write(' '.join(f'{x:5d}' for x in ndegen) + '\n')
for ir in range(nrpts):
for i in range(4):
for j in range(4):
file.write(f"{Irvec[0, ir]:5d}{Irvec[1, ir]:5d}{Irvec[2, ir]:5d}{i+1:5d}{j+1:5d} {HmnR[i, j, ir].real:16.8f} {HmnR[i, j, ir].imag:16.8f}\n")

Loading

0 comments on commit 6e01b20

Please sign in to comment.