Skip to content

Commit 6202271

Browse files
committed
Cleanup
1 parent e850c96 commit 6202271

3 files changed

Lines changed: 45 additions & 55 deletions

File tree

src/implementations/eigh.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function check_hermitian(A; atol::Real = default_hermitian_tol(A), rtol::Real =
1818
end
1919

2020
function check_input(::typeof(eigh_full!), A::AbstractMatrix, DV, alg::AbstractAlgorithm)
21-
#check_hermitian(A, alg)
21+
check_hermitian(A, alg)
2222
D, V = DV
2323
m = size(A, 1)
2424
@assert D isa Diagonal && V isa AbstractMatrix

src/pullbacks/eig.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ function eig_pullback!(
4646
Δgauge gauge_atol ||
4747
@warn "`eig` cotangents sensitive to gauge choice: (|Δgauge| = $Δgauge)"
4848

49-
VᴴΔV ./= conj.(transpose(D) .- D)
50-
diagview(VᴴΔV) .= zero(eltype(VᴴΔV))
49+
VᴴΔV .*= conj.(inv_safe.(transpose(D) .- D, degeneracy_atol))
5150

5251
if !iszerotangent(ΔDmat)
5352
ΔDvec = diagview(ΔDmat)

0 commit comments

Comments
 (0)