You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
truncrank with symmetries seems to lead to unbalanced charges #588
using TensorKit, LinearAlgebra, Random
Random.seed!(1)
# blocks have identical singular values up to rounding.
V =U1Space(0=>2, 1=>1, -1=>1)
A =randn(ComplexF64, V ⊗ V ← V ⊗ V)
@tensor T[a1 a2 b1 b2; c1 c2 d1 d2] := A[a1 a2; c1 c2] *conj(A[b1 b2; d1 d2])
_, Sfull, _ =svd_compact(T)
for q in (1, 2)
Δ =maximum(abs, diag(block(Sfull, U1Irrep(q))) .-diag(block(Sfull, U1Irrep(-q))))
println("q = ±$q: singular value difference = $Δ")
end# truncate and figure out if any charges are missing their opposite sign partner(s)functionunbalanced(trunc)
_, S, _ =svd_trunc(T; trunc)
W =space(S, 1)
d =Dict(c.charge =>dim(W, c) for c insectors(W))
returndim(W), sort([q for q inkeys(d) if d[q] !=get(d, -q, 0)])
endfor χ in20:30
n, bad =unbalanced(truncrank(χ))
println("truncrank($χ): kept $n, unbalanced charges $bad")
end
n, bad =unbalanced(trunctol(; rtol =1.0e-2))
println("trunctol(rtol = 1e-2): kept $n, unbalanced charges $bad")
Basically, we sometimes have a situation where +q and -q have the same singular values, but the truncation chops away only one of them, leading to unbalanced charges. I think truncrank should instead remove both, if they have approximately the same singular values. This arose because @GlebFedorovich noticed mysterious imaginary components arising in some CTMRG calculations. If you guess unluckily for the rank to truncate to, you end up repeatedly ping-ponging between +q and -q. I also don't find that using trunctol(; rtol=something) & truncrank(max_chi) really helps either.
Activity
Yue-Zhengyuan commentedon Oct 22, 2026
I feel this is very much related to QuantumKitHub/MatrixAlgebraKit.jl#101. I have started to port
truncdegenback to MAK in this branch, but haven't got energy to fully finish it.kshyatt commentedon Oct 22, 2026
I have some trial branches at MAK and here I can turn into real PRs, I'll do so today
kshyatt commentedon Oct 27, 2026
Wait why did this get closed? I still need to make the branch here at TensorKit
lkdvos commentedon Oct 27, 2026
Oh right, that's my bad