Skip to content

Commit

Permalink
fixed a bug for phonon system when finding the nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
quanshengwu committed Jul 22, 2018
1 parent 3ca0e0c commit 3815e9a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 2 additions & 0 deletions examples/FeSi/README.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# phonon_hr.py is well tested with phonopy-1.11.8

# In this folder we use WannierTools to perform the phonon calculation.
0. Quick running, to get the results in PRL
tar -xzvf phonopyTB_hr.dat.tar.gz
Expand Down
29 changes: 27 additions & 2 deletions soc/findnodes.f90
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,30 @@ function func_energy(X)
allocate(Hamk_bulk(num_wann, num_wann))

! generate bulk Hamiltonian
call ham_bulk_old(X, Hamk_bulk)
if (index(KPorTB, 'KP')/=0)then
call ham_bulk_kp(X, Hamk_bulk)
else
!> deal with phonon system
if (index(Particle,'phonon')/=0.and.LOTO_correction) then
call ham_bulk_LOTO(X, Hamk_bulk)
else
call ham_bulk_old (X, Hamk_bulk)
endif
endif


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

func_energy= W(Numoccupied)

!> deal with phonon system
!> sign(A, B) returns the value of A with the sign of B.
if (index(Particle,'phonon')/=0) then
func_energy= sqrt(abs(func_energy))*sign(1d0, func_energy)
endif

deallocate(W, Hamk_bulk)

return
Expand Down Expand Up @@ -275,7 +291,16 @@ function func_gap(N,X)
allocate(Hamk_bulk(num_wann, num_wann))

! generate bulk Hamiltonian
call ham_bulk_old(X, Hamk_bulk)
if (index(KPorTB, 'KP')/=0)then
call ham_bulk_kp(X, Hamk_bulk)
else
!> deal with phonon system
if (index(Particle,'phonon')/=0.and.LOTO_correction) then
call ham_bulk_LOTO(X, Hamk_bulk)
else
call ham_bulk_old (X, Hamk_bulk)
endif
endif

! diagonalization by call zheev in lapack
W= 0d0
Expand Down

0 comments on commit 3815e9a

Please sign in to comment.