Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
quanshengwu committed May 1, 2018
1 parent 45023e2 commit 6d31918
Show file tree
Hide file tree
Showing 12 changed files with 324 additions and 50 deletions.
10 changes: 9 additions & 1 deletion examples/Bi2Se3/input.dat
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ MILLER_INDICES

!> bulk band structure calculation flag
&CONTROL
BulkBand_calc = T
BulkBand_calc = F
BulkBand_points_calc = T
BulkFS_calc = F
BulkGap_cube_calc = F
BulkGap_plane_calc = F
Expand Down Expand Up @@ -113,6 +114,13 @@ EFFECTIVE_MASS ! optional
0.01 ! k step in unit of (1/Angstrom)
0.0 0.0 0.0 ! k point where the effective mass calculated.

KPOINTS_3D
4
Direct
0.0 0.0 0.0
0.5 0.0 0.0
0.0 0.5 0.0
0.0 0.0 0.5

WANNIER_CENTRES ! copy from wannier90.wout
Cartesian
Expand Down
36 changes: 23 additions & 13 deletions examples/Bi2Se3/wt.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,20 @@ SURFACE ! Specify surface with two vectors, see doc

!> bulk band structure calculation flag
&CONTROL
BulkBand_calc = T
DOS_calc = T
BulkFS_calc = T
BulkGap_cube_calc = T
BulkGap_plane_calc = T
SlabBand_calc = T
WireBand_calc = T
SlabSS_calc = T
SlabArc_calc = T
SlabQPI_calc = T
Z2_3D_calc = T
SlabSpintexture_calc = T
Wanniercenter_calc = T
BulkBand_calc = F
BulkBand_points_calc = T
DOS_calc = F
BulkFS_calc = F
BulkGap_cube_calc = F
BulkGap_plane_calc = F
SlabBand_calc = F
WireBand_calc = F
SlabSS_calc = F
SlabArc_calc = F
SlabQPI_calc = F
Z2_3D_calc = F
SlabSpintexture_calc = F
Wanniercenter_calc = F
/

&SYSTEM
Expand Down Expand Up @@ -107,6 +108,15 @@ EFFECTIVE_MASS ! optional
0.01 ! k step in unit of (1/Angstrom)
0.0 0.0 0.0 ! k point where the effective mass calculated.

KPOINTS_3D
4
Direct
0.0 0.0 0.0
0.5 0.0 0.0
0.0 0.5 0.0
0.0 0.0 0.5



WANNIER_CENTRES ! copy from wannier90.wout
Cartesian
Expand Down
12 changes: 8 additions & 4 deletions soc/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ obj = module.o aux.o symmetry.o readHmnR.o inverse.o proteus.o \
fermiarc.o spintexture.o berrycurvature.o \
wanniercenter.o dos.o orbital_momenta.o \
landau_level.o berry.o wanniercenter_adaptive.o \
effective_mass.o findnodes.o \
effective_mass.o findnodes.o sigma_AHC.o \
main.o


# compiler
f90 = gfortran -cpp
f90 = mpif90 -fpp -DMPI # -check all -pg -traceback

flag = -O3
#FLAGS = -O3 -nogen-interface -warn all
flag = -O3 -nogen-interface #-warn all

# blas and lapack libraries
libs = -L/usr/lib/ -llapack -lblas
libs = -L/opt/intel/mkl/lib/ \
-lmkl_intel_lp64 -lmkl_sequential \
-lmkl_core -liomp5

main : $(obj)
$(f90) $(obj) -o wt.x $(libs)
Expand Down
2 changes: 1 addition & 1 deletion soc/Makefile.gfortran
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ obj = module.o aux.o symmetry.o readHmnR.o inverse.o proteus.o \
fermiarc.o spintexture.o berrycurvature.o \
wanniercenter.o dos.o orbital_momenta.o \
landau_level.o berry.o wanniercenter_adaptive.o \
effective_mass.o findnodes.o \
effective_mass.o findnodes.o sigma_AHC.o \
main.o

# compiler
Expand Down
2 changes: 1 addition & 1 deletion soc/Makefile.gfortran_travis
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ obj = module.o aux.o symmetry.o readHmnR.o inverse.o proteus.o \
fermiarc.o spintexture.o berrycurvature.o \
wanniercenter.o dos.o orbital_momenta.o \
landau_level.o berry.o wanniercenter_adaptive.o \
effective_mass.o findnodes.o \
effective_mass.o findnodes.o sigma_AHC.o \
main.o


Expand Down
2 changes: 1 addition & 1 deletion soc/Makefile.intel-mpi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ obj = module.o aux.o symmetry.o readHmnR.o inverse.o proteus.o \
fermiarc.o spintexture.o berrycurvature.o \
wanniercenter.o dos.o orbital_momenta.o \
landau_level.o berry.o wanniercenter_adaptive.o \
effective_mass.o findnodes.o \
effective_mass.o findnodes.o sigma_AHC.o \
main.o


Expand Down
2 changes: 1 addition & 1 deletion soc/Makefile.intel-seq
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ obj = module.o aux.o symmetry.o readHmnR.o inverse.o proteus.o \
fermiarc.o spintexture.o berrycurvature.o \
wanniercenter.o dos.o orbital_momenta.o \
landau_level.o berry.o wanniercenter_adaptive.o \
effective_mass.o findnodes.o \
effective_mass.o findnodes.o sigma_AHC.o \
main.o


Expand Down
10 changes: 4 additions & 6 deletions soc/berrycurvature.f90
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ subroutine berry_curvarture
outfileindex= outfileindex+ 1
if (cpuid==0) then
open(unit=outfileindex, file='Berrycurvature.dat')
write(outfileindex, '(20a18)')'# kx (1/A)', 'ky (1/A)', 'kz (1/A)', &
write(outfileindex, '(20a28)')'# kx (1/A)', 'ky (1/A)', 'kz (1/A)', &
'real(Omega_x)', 'imag(Omega_x)', &
'real(Omega_y)', 'imag(Omega_y)', &
'real(Omega_z)', 'imag(Omega_z)'
Expand Down Expand Up @@ -220,7 +220,7 @@ subroutine berry_curvarture
ik= ik+ 1
o1=real(Omega_mpi(:,ik))
if (norm(o1)>eps9) o1= o1/norm(o1)
write(outfileindex, '(20f28.10)')kslice_shape(:, ik), o1
write(outfileindex, '(20f18.10)')kslice_shape(:, ik), o1
enddo
write(outfileindex, *) ' '
enddo
Expand Down Expand Up @@ -303,14 +303,12 @@ subroutine berry_curvarture
write(outfileindex, '(a)')"set xlabel 'k (1/{\305})'"
write(outfileindex, '(a)')"set ylabel 'k (1/{\305})'"
write(outfileindex, '(a)')"unset colorbox"
write(outfileindex, '(a)')"unset xtics"
write(outfileindex, '(a)')"unset xlabel"
write(outfileindex, '(a)')"set xrange [] noextend"
write(outfileindex, '(a)')"set yrange [] noextend"
write(outfileindex, '(a)')"set ytics 0.5 nomirror scale 0.5"
write(outfileindex, '(a)')"set pm3d interpolate 2,2"
write(outfileindex, '(a)')"set title '(Omega_x, Omega_y) real'"
write(outfileindex, '(a)')"plot 'Berrycurvature-normalized.dat' u 1:2:($4/500):($5/500) w vec"
write(outfileindex, '(a)')"set title '(Omega_x, Omega_z) real'"
write(outfileindex, '(a)')"plot 'Berrycurvature-normalized.dat' u 1:3:($4/500):($6/500) w vec"
close(outfileindex)
endif

Expand Down
122 changes: 104 additions & 18 deletions soc/ek_bulk.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,12 @@ subroutine ek_bulk

implicit none

integer :: ik, i, j
integer :: knv3
integer :: Nwann
integer :: ierr
real(dp) :: emin
real(dp) :: emax
real(Dp) :: k(3)
real(Dp) :: W(Num_wann)
integer :: ik, i, j, knv3, Nwann, ierr
real(dp) :: emin, emax, k(3)
real(Dp), allocatable :: W(:)

! Hamiltonian of bulk system
complex(Dp) :: Hamk_bulk(Num_wann,Num_wann)
complex(Dp), allocatable :: Hamk_bulk(:, :)

! eigen value of H
real(dp), allocatable :: eigv(:,:)
Expand All @@ -27,8 +22,10 @@ subroutine ek_bulk
real(dp), allocatable :: weight_mpi(:,:,:)

knv3= nk3_band
allocate( W(Num_wann))
allocate( eigv (Num_wann, knv3))
allocate( eigv_mpi(Num_wann, knv3))
allocate( Hamk_bulk (Num_wann,Num_wann))
allocate( weight (Num_wann,Num_wann, knv3))
allocate( weight_mpi(Num_wann,Num_wann, knv3))
eigv = 0d0
Expand Down Expand Up @@ -137,6 +134,102 @@ subroutine ek_bulk
end subroutine ek_bulk


!>> calculate energy band levels at given kpoints
subroutine ek_bulk_point_mode

use wmpi
use para

implicit none

integer :: ik, i, j, knv3, Nwann, ierr
real(dp) :: emin, emax, k(3)
real(Dp), allocatable :: W(:)

! Hamiltonian of bulk system
complex(Dp), allocatable :: Hamk_bulk(:, :)

! eigen value of H
real(dp), allocatable :: eigv(:,:)
real(dp), allocatable :: eigv_mpi(:,:)
real(dp), allocatable :: weight(:,:,:)
real(dp), allocatable :: weight_mpi(:,:,:)

knv3= nk3_band
allocate( W(Num_wann))
allocate( eigv (Num_wann, knv3))
allocate( eigv_mpi(Num_wann, knv3))
allocate( Hamk_bulk (Num_wann,Num_wann))
allocate( weight (Num_wann,Num_wann, knv3))
allocate( weight_mpi(Num_wann,Num_wann, knv3))
eigv = 0d0
weight = 0d0
eigv_mpi= 0d0
weight_mpi = 0d0

do ik= 1+cpuid, Nk3_point_mode, num_cpu
if (cpuid==0) write(stdout, *)'# BulkBand in point mode, ik, knv3 ', ik, knv3

k = k3points_pointmode_direct(:, ik)

!> calculation bulk hamiltonian
Hamk_bulk= 0d0
call ham_bulk_old(k, Hamk_bulk)
!call ham_bulk (k, Hamk_bulk)

!> diagonalization by call zheev in lapack
W= 0d0
call eigensystem_c( 'V', 'U', Num_wann ,Hamk_bulk, W)

eigv(:, ik)= W
do i=1, Num_wann !> band
if (SOC==0) then
do j=1, Num_wann !> projector
weight(j, i, ik)= (abs(Hamk_bulk(j, i))**2)
enddo ! j
else
do j=1, Num_wann !> projector
weight(j, i, ik)= abs(Hamk_bulk(j, i))**2
enddo ! j
endif
enddo ! i

enddo ! ik

#if defined (MPI)
call mpi_allreduce(eigv,eigv_mpi,size(eigv),&
mpi_dp,mpi_sum,mpi_cmw,ierr)
call mpi_allreduce(weight, weight_mpi,size(weight),&
mpi_dp,mpi_sum,mpi_cmw,ierr)
#else
eigv_mpi= eigv
weight_mpi= weight
#endif

weight= weight_mpi/maxval(weight_mpi)*255d0

outfileindex= outfileindex+ 1
if (cpuid==0)then
open(unit=outfileindex, file='bulkek-pointsmode.dat')

do ik=1, Nk3_point_mode
write(outfileindex, '(a, i10)')'# No. of k point', ik
write(outfileindex, '("#",a9,100a10)')'k1', 'k2', 'k3', 'kx', 'ky', 'kz'
write(outfileindex, '(100f10.6)')k3points_pointmode_direct(:, ik), k3points_pointmode_cart(:, ik)
write(outfileindex, '("#", a11, a19, a)')'band index', 'Eigenvalue', ' orbital weights (0-255)'
do i=1, Num_wann
write(outfileindex, '(i12, f19.10, 1000i5)')i, eigv_mpi(i, ik), &
int(weight(:, i, ik))
enddo
write(outfileindex, *)' '
enddo
close(outfileindex)
endif

return
end subroutine ek_bulk_point_mode


! calculate bulk's energy band using wannier TB method
!> calculate spin direction for each band and each kpoint
subroutine ek_bulk_spin
Expand All @@ -146,15 +239,8 @@ subroutine ek_bulk_spin

implicit none

integer :: ik, i, j, ib
integer :: knv3
integer :: ierr
integer :: nwann
real(dp) :: sx, sy, sz
real(dp) :: emin
real(dp) :: emax
real(dp) :: k(3)
real(dp) :: W(Num_wann)
integer :: ik, i, j, ib, knv3, ierr, nwann
real(dp) :: sx, sy, sz, emin, emax, k(3), W(Num_wann)

! Hamiltonian of bulk system
complex(dp), allocatable :: Hamk_bulk(:, :)
Expand Down
24 changes: 24 additions & 0 deletions soc/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,18 @@ program main
if(cpuid.eq.0)write(stdout, *)'<< End of calculating bulk band'
endif

!> bulk band of a series k points.
if (BulkBand_points_calc) then
if(cpuid.eq.0)write(stdout, *)' '
if(cpuid.eq.0)write(stdout, *)'>> Start of calculating the bulk band in points mode'
call now(time_start)
call ek_bulk_point_mode
call now(time_end)
call print_time_cost(time_start, time_end, 'BulkBand_points')
if(cpuid.eq.0)write(stdout, *)'<< End of calculating the bulk band in points mode'
endif



!> bulk band in a plane. For Dirac or Weyl cone
if (BulkBand_plane_calc) then
Expand Down Expand Up @@ -348,6 +360,18 @@ program main
if(cpuid.eq.0)write(stdout, *)'End of calculating the Berry phase'
endif

!> calculate anomalouls hall conductivity
if (AHC_calc)then
if(cpuid.eq.0)write(stdout, *)' '
if(cpuid.eq.0)write(stdout, *)'>> Start to calculate anomalouls hall conductivity'
call now(time_start)
call sigma_AHC
call now(time_end)
call print_time_cost(time_start, time_end, 'AHC_calc')
if(cpuid.eq.0)write(stdout, *)'End of AHC calculation'
endif


!> surface state
if (SlabSS_calc) then
if(cpuid.eq.0)write(stdout, *)' '
Expand Down
Loading

0 comments on commit 6d31918

Please sign in to comment.