Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
quanshengwu committed May 22, 2024
1 parent 25d8c0f commit 2e4b1b0
Show file tree
Hide file tree
Showing 5 changed files with 154 additions and 87 deletions.
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
48 changes: 48 additions & 0 deletions examples/Fe/wt.in-BerryCurvature_kpath_sepband_calc
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
&TB_FILE
Hrfile = wannier90_hr.dat
/


&CONTROL
BerryCurvature_kpath_sepband_calc = T
/

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

&PARAMETERS
Fermi_broadening = 0.01 ! infinite small value, like brodening
Nk1 = 61 ! number k points
/

LATTICE
Angstrom
1.4350000 1.4350000 -1.4350000
-1.4350000 1.4350000 1.4350000
1.4350000 -1.4350000 1.4350000

ATOM_POSITIONS
1 ! number of atoms for projectors
Direct ! Direct or Cartisen coordinate
Fe 0.0000000 0.0000000 0.000

PROJECTORS
8 ! number of projectors
Fe pz px py dz2 dxz dyz dx2-y2 dxy

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

KPATH_BULK ! k point path
6 ! number of k line only for bulk band
G 0.0 0.0 0.0 H 0.5 -0.5 0.5
H 0.5 -0.5 0.5 N 0.0 0.0 0.5
N 0.0 0.0 0.5 G 0.0 0.0 0.0
G 0.0 0.0 0.0 P 0.25 0.25 0.25
P 0.25 0.25 0.25 H 0.5 -0.5 0.5
H 0.25 0.25 0.25 N 0.0 0.0 0.5

78 changes: 0 additions & 78 deletions examples/input.dat-2d

This file was deleted.

63 changes: 55 additions & 8 deletions src/berrycurvature.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ subroutine berry_curvature_cube
!> output the Berry curvature to file
outfileindex= outfileindex+ 1
if (cpuid==0) then
open(unit=outfileindex, file='Berrycurvature_line.dat')
open(unit=outfileindex, file='Berrycurvature_line_sepband.txt')
write(outfileindex, '(a)')'# Column 1 kpath with accumulated length in the kpath, Coloum 2: energy'
write(outfileindex, '(a)')'# Column 2-4 Berry curvature (Ang^2)'
write(outfileindex, "('#column', i5, 20i16)")(i, i=1, 8)
Expand All @@ -1058,7 +1058,7 @@ subroutine berry_curvature_cube
'm_x', 'm_y', 'm_z'
do i=1, Num_wann
do ik=1, n_kpoints
write(outfileindex, '(200f16.9)')k3len(ik)*Angstrom2atomic, eigval_allk_mpi(i, ik), &
write(outfileindex, '(200E16.6)')k3len(ik)*Angstrom2atomic, eigval_allk_mpi(i, ik)/eV2Hartree, &
Omega_allk_mpi(i, :, ik), m_OrbMag_allk_mpi(i, :, ik)
enddo
write(outfileindex, *)' '
Expand All @@ -1070,13 +1070,60 @@ subroutine berry_curvature_cube
endif

!> minimum and maximum value of energy bands
emin= minval(eigval_allk_mpi)-0.5d0
emax= maxval(eigval_allk_mpi)+0.5d0
emin= minval(eigval_allk_mpi)/eV2Hartree-0.5d0
emax= maxval(eigval_allk_mpi)/eV2Hartree+0.5d0

!> write script for gnuplot
outfileindex= outfileindex+ 1
if (cpuid==0) then
open(unit=outfileindex, file='Berrycurvature_line_sepband.gnu')
write(outfileindex, '(a)') '# requirement: gnuplot version>5.4'
write(outfileindex, '(2a)') '# Please open the data file to check the data: Berrycurvature_line_sepband.txt '
write(outfileindex, '(a)') 'set terminal pdf enhanced color font ",24"'
write(outfileindex,'(2a)') 'set palette defined ( 0 "green", ', &
'5 "yellow", 10 "red" )'
write(outfileindex, '(3a)')"set output 'Berrycurvature_line_sepband.pdf'"
write(outfileindex, '(a)')'set style data linespoints'
write(outfileindex, '(a)')'unset key'
write(outfileindex, '(a)')'set pointsize 0.8'
write(outfileindex, '(a)')'#set xtics font ",24"'
write(outfileindex, '(a)')'#set ytics font ",24"'
write(outfileindex, '(a)')'#set ylabel font ",24"'
write(outfileindex, '(a)')'set ylabel offset 0.5,0'
write(outfileindex, '(a)')'set border lw 2'
write(outfileindex, '(a, f10.5, a)')'set xrange [0: ', maxval(k3len*Angstrom2atomic), ']'
write(outfileindex, '(a,f12.6)')'emin=', emin
write(outfileindex, '(a,f12.6)')'emax=', emax
write(outfileindex, '(a)')' '
write(outfileindex, '(a)')'#set cbrange if the number is too large meeting some band crossings'
write(outfileindex, '(a)')'set cbrange [-100:100]'
write(outfileindex, '(a)')' '
if (index(Particle,'phonon')/=0) then
write(outfileindex, '(a)')'set yrange [0: emax]'
write(outfileindex, '(a)')'set ylabel "Frequency (THz)"'
else
write(outfileindex, '(a)')'set ylabel "Energy (eV)"'
write(outfileindex, '(a)')'set yrange [ emin : emax ]'
endif
write(outfileindex, 202, advance="no") (k3line_name(i), k3line_stop(i)*Angstrom2atomic, i=1, Nk3lines)
write(outfileindex, 203)k3line_name(Nk3lines+1), k3line_stop(Nk3lines+1)*Angstrom2atomic

do i=1, Nk3lines-1
if (index(Particle,'phonon')/=0) then
write(outfileindex, 204)k3line_stop(i+1)*Angstrom2atomic, '0.0', k3line_stop(i+1)*Angstrom2atomic, 'emax'
else
write(outfileindex, 204)k3line_stop(i+1)*Angstrom2atomic, 'emin', k3line_stop(i+1)*Angstrom2atomic, 'emax'
endif
enddo
write(outfileindex, '(4a)')"plot 'Berrycurvature_line_sepband.txt' u 1:2:5 ", &
" w lp lw 2 pt 7 ps 0.2 lc palette, 0 w l lw 2 dt 2"
close(outfileindex)
endif

202 format('set xtics (',20('"',A3,'" ',F10.5,','))
203 format(A3,'" ',F10.5,')')
204 format('set arrow from ',F10.5,',',A5,' to ',F10.5,',',A5, ' nohead lw 2')

call generate_ek_kpath_gnu('Berrycurvature_line.dat', 'Berrycurvature_line.gnu', 'Berrycurvature_line.pdf', &
emin, emax, n_kpoints, Nk3lines, &
k3line_name, k3line_stop, k3len)

ENDIF


Expand Down
2 changes: 1 addition & 1 deletion src/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ program main
if(cpuid.eq.0)write(stdout, *)'End of calculating the Berry curvature'
endif

if (BerryCurvature_Cube_calc.or.BerryCurvature_kpath_sepband_calc)then
if (BerryCurvature_Cube_calc .or. BerryCurvature_kpath_sepband_calc)then
if(cpuid.eq.0)write(stdout, *)' '
if(cpuid.eq.0)write(stdout, *)'>> Start of calculating the Berry curvature in a k-cube'
call now(time_start)
Expand Down

0 comments on commit 2e4b1b0

Please sign in to comment.