36 SUBROUTINE hall_response(energies, current, mu, kt, gamma, hall, status)
37 REAL(dp),
INTENT(IN) :: energies(:)
38 COMPLEX(dp),
INTENT(IN) :: current(:, :, :)
39 REAL(dp),
INTENT(IN) :: mu, kt,
gamma
40 REAL(dp),
INTENT(OUT) :: hall(3, 3)
41 INTEGER,
INTENT(OUT) :: status
43 INTEGER :: a, b, m, n, nstate
44 REAL(dp) :: delta, factor, scale, total(3, 3)
48 nstate =
SIZE(energies)
49 IF (nstate < 1 .OR. any(shape(current) /= [nstate, nstate, 3]))
RETURN
50 IF (.NOT. all(ieee_is_finite([mu, kt,
gamma])))
RETURN
51 IF (kt <= 0.0_dp .OR.
gamma <= 0.0_dp)
RETURN
52 IF (.NOT. all(ieee_is_finite(energies)))
RETURN
53 IF (.NOT. all(ieee_is_finite(real(current, dp))) .OR. &
54 .NOT. all(ieee_is_finite(aimag(current))))
RETURN
56 scale = max(1.0_dp, maxval(abs(current(:, :, a))))
57 IF (maxval(abs(current(:, :, a) + conjg(transpose(current(:, :, a))))) > antihermiticity_tolerance*scale)
RETURN
62 delta = energies(n) - energies(m)
63 IF (.NOT. ieee_is_finite(delta))
RETURN
64 IF (delta == 0.0_dp) cycle
65 scale = max(
gamma, abs(delta))
66 factor = 2.0_dp*
fermi_slope(energies(n), energies(m), mu, kt)* &
67 (delta/scale)/scale/((
gamma/scale)**2 + (delta/scale)**2)
68 IF (.NOT. ieee_is_finite(factor))
RETURN
71 total(a, b) = total(a, b) + factor*aimag(current(m, n, a)*current(n, m, b))
76 IF (.NOT. all(ieee_is_finite(total)))
RETURN
77 hall = total - transpose(total)
pure real(dp) function, public fermi_slope(ea, eb, mu, kt)
Stable Fermi divided difference including the intraband and degenerate limits.
subroutine, public hall_response(energies, current, mu, kt, gamma, hall, status)
Hall tensor, with first index the current and second index the electric field.