Skip to content

Commit

Permalink
Print degenerate S warning only if Zygote.isderiving() (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
pbrehmer authored Nov 8, 2024
1 parent e78e5fa commit 08cf1dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/algorithms/ctmrg/ctmrg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ function ctmrg_projectors(
ϵ = max(ϵ, ϵ_local / norm(S))

# Compute SVD truncation error and check for degenerate singular values
ignore_derivatives() do
Zygote.isderiving() && ignore_derivatives() do
if alg.verbosity > 0 && is_degenerate_spectrum(S)
svals = TensorKit.SectorDict(c => diag(b) for (c, b) in blocks(S))
@warn("degenerate singular values detected: ", svals)
Expand Down Expand Up @@ -273,7 +273,7 @@ function ctmrg_projectors(
ϵ = max(ϵ, ϵ_local / norm(S_local))

# Compute SVD truncation error and check for degenerate singular values
ignore_derivatives() do
Zygote.isderiving() && ignore_derivatives() do
if alg.verbosity > 0 && is_degenerate_spectrum(S_local)
svals = TensorKit.SectorDict(c => diag(b) for (c, b) in blocks(S_local))
@warn("degenerate singular values detected: ", svals)
Expand Down

0 comments on commit 08cf1dc

Please sign in to comment.