Skip to content

Commit

Permalink
Remove debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
lkdvos committed Apr 15, 2024
1 parent 045e7bd commit dff04dc
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/algorithms/ctmrg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,6 @@ function MPSKit.leading_boundary(state, alg::CTMRG, envinit=CTMRGEnv(state))
return envfix
end

macro checkgrad(expr)
x = gensym(:x)
return esc(:(
Zygote.hook($expr) do $x
if !isfinite(norm($x))
@error $x
end
end
))
end

# Fix gauge of corner end edge tensors from last and second last CTMRG iteration
function gauge_fix(envprev::CTMRGEnv{C,T}, envfinal::CTMRGEnv{C,T}) where {C,T}
# Check if spaces in envprev and envfinal are the same
Expand Down Expand Up @@ -131,9 +120,6 @@ function gauge_fix(envprev::CTMRGEnv{C,T}, envfinal::CTMRGEnv{C,T}) where {C,T}
ρfinal = eigsolve(TransferMatrix(Tsfinal, M), ρinit, 1, :LM)[2][1]

# Decompose and multiply
# Qprev, = leftorth(ρprev, ((1,), (2,))) # QR decomposition leads to diverging gradients?
# Qfinal, = leftorth(ρfinal, ((1,), (2,)))
# σ = @checkgrad Qprev * Qfinal'
Up, _, Vp = tsvd(ρprev)
Uf, _, Vf = tsvd(ρfinal)
Qprev = Up * Vp
Expand Down

0 comments on commit dff04dc

Please sign in to comment.