Possible bug(s) in m_krank/krank_new time reversal options
Posted: Wed Jun 10, 2020 11:11 pm
I was going through the code for tetrahedral integration and I think I spotted an issue in the treatment of time reversal at the end of krank_new. The code is below:
I believe timrev on line 179 should be itim so that the loop properly covers time reversed and non-time reversed symmetry operations. The only place I see this called is from 78_eph/m_phgamma so it could possibly cause some trouble there if time reversal isn't trivial. Also some minor adjustments to the following might be needed:
After line 152 there should maybe be krank%time_reversal = .false. ? Fortunately, as far as I can tell there is no reference to this property anywhere in the codebase.
Code: Select all
170 if (present(symrec)) then
171 if(.not. present(nsym)) then
172 TETRA_ERROR("need both symrec and nsym arguments together")
173 end if
174 do ikpt=1,nkpt
175 ! itim == 1 for positive, and itim==2 gives Kramers opposite of k-point
176 ! favor the former by looping it last
177 do itim = timrev, 1, -1
178 do isym = 1, nsym
179 symkpt = (-1)**(timrev+1) * matmul(symrec(:,:,isym), kpt(:, ikpt))
180 symkptrank = krank%get_rank(symkpt(:))
181 krank%invrank(symkptrank) = ikpt
182 end do
183 end do
184 end do
185 end if
Code: Select all
149 timrev = 2
150 krank%time_reversal = .true.
151 if (present(time_reversal)) then
152 if (.not. time_reversal) timrev = 1
153 end if