From 27923f50100933ad2cae8c5ac40aae6291ef76d1 Mon Sep 17 00:00:00 2001 From: QuanSheng Wu Date: Thu, 24 Feb 2022 11:04:07 +0800 Subject: [PATCH] fixed a bug in AHC calculation when there are degenerate bands --- src/berrycurvature.f90 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/berrycurvature.f90 b/src/berrycurvature.f90 index 423c084c..ab2fc4cc 100644 --- a/src/berrycurvature.f90 +++ b/src/berrycurvature.f90 @@ -451,7 +451,9 @@ subroutine get_Dmn_Ham(W, velocity_Ham, Dmn_Ham) do i=1, 3 do n=1, Num_wann do m=1, Num_wann - Dmn_Ham(m,n,i)=velocity_Ham(m,n,i)/(W(n)-W(m)) + if (abs(W(n)-W(m))>eps12) then + Dmn_Ham(m,n,i)=velocity_Ham(m,n,i)/(W(n)-W(m)) + endif enddo Dmn_Ham(n, n, i)=zzero enddo