Skip to content

Commit b1a5a74

Browse files
Jutholeburgel
authored andcommitted
more fixes
1 parent 3baa70f commit b1a5a74

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/pullbacks/lq.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ end
115115

116116
function check_lq_null_cotangents(Nᴴ, ΔNᴴ; gauge_atol::Real = default_pullback_gauge_atol(ΔNᴴ))
117117
aNᴴΔN = project_antihermitian!(Nᴴ * ΔNᴴ')
118-
Δgauge = maximum(abs, aNᴴΔN; init = zero(eltype(aNᴴΔN)))
118+
Δgauge = maximum(abs, aNᴴΔN; init = abs(zero(eltype(aNᴴΔN))))
119119
Δgauge ≤ gauge_atol ||
120120
@warn "`lq_null` cotangent sensitive to gauge choice: (|Δgauge| = $Δgauge)"
121121
return

‎src/pullbacks/qr.jl‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function check_and_prepare_qr_cotangents(
3939
I = uppertriangularind(ΔR₂₂)
4040
upper_inds = view(LinearIndices(ΔR), (p + 1):minmn, (p + 1):n)[I]
4141
ΔR₂₂upper = view(ΔR, upper_inds)
42-
Δgauge_R = maximum(abs, ΔR₂₂upper; init = zero(eltype(ΔR₂₂upper)))
42+
Δgauge_R = maximum(abs, ΔR₂₂upper; init = abs(zero(eltype(ΔR))))
4343
Δgauge_R = max(Δgauge_R, maximum(abs, view(ΔR₂₂, diagind(ΔR₂₂)); init = zero(Δgauge_R)))
4444
Δgauge = max(Δgauge, Δgauge_R)
4545
end
@@ -121,7 +121,7 @@ end
121121

122122
function check_qr_null_cotangents(N, ΔN; gauge_atol::Real = default_pullback_gauge_atol(ΔN))
123123
aNᴴΔN = project_antihermitian!(N' * ΔN)
124-
Δgauge = maximum(abs, aNᴴΔN; init = zero(eltype(aNᴴΔN)))
124+
Δgauge = maximum(abs, aNᴴΔN; init = abs(zero(eltype(aNᴴΔN))))
125125
Δgauge ≤ gauge_atol ||
126126
@warn "`qr_null` cotangent sensitive to gauge choice: (|Δgauge| = $Δgauge)"
127127
return

‎src/pullbacks/svd.jl‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ function check_and_prepare_svd_cotangents(
9090
if !iszerotangent(ΔSmat)
9191
ΔS = diagview(ΔSmat)
9292
length(indS) == length(ΔS) || throw(DimensionMismatch(lazy"length of selected S values ($(length(indS))) does not match length of ΔS ($(length(ΔS)))"))
93-
diagview(view(hUᴴΔAV₁₀, ind₀, :)) .+= real.(view(ΔS, J)) # the diagonal entries
93+
diagview(view(hUᴴΔAV₁₀, ind₀, :)) .+= real.(view(ΔS, J₁)) # the diagonal entries
9494
Δgauge = max(Δgauge, maximum(abs, view(ΔS, J₂); init = zero(Δgauge)))
9595
end
9696

0 commit comments

Comments
 (0)