Fix full_update for tensors with dangling indices#4
Merged
Conversation
Full update now handles site tensors that carry a dangling index the gate does not act on, such as the length-1 auxiliary index that makes a definite-charge tensor symmetry-invariant. Previously `optimise_p_q`'s right-hand-side closure `b` built the bra as `conj(prime(r))` and un-primed the whole contraction with `noprime`. A dangling index the gate leaves untouched then survived both unprimed (ket) and primed (bra) and collapsed to a duplicate name under `noprime`, throwing `Dimension names must be distinct`. The fix un-primes those spectator legs on the bra so they trace against the ket, mirroring what the metric closure `M_p` already did. Tensors without dangling indices are unchanged, so the dense backend is unaffected. A separate numerical discrepancy remains on the GradedArrays backend (the TensorKit backend gives correct results). It does not come from this factorization logic and is being looked into separately.
mtfishman
force-pushed
the
mf/fix-full-update-symmetric
branch
from
July 10, 2026 20:52
4a6758b to
4af9e57
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Full update now handles site tensors that carry a dangling index the gate does not act on, such as the length-1 auxiliary index that makes a definite-charge tensor symmetry-invariant. Previously
optimise_p_q's right-hand-side closurebbuilt the bra asconj(prime(r))and un-primed the whole contraction withnoprime. A dangling index the gate leaves untouched then survived both unprimed (ket) and primed (bra) and collapsed to a duplicate name undernoprime, throwingDimension names must be distinct. The fix un-primes those spectator legs on the bra so they trace against the ket, mirroring what the metric closureM_palready did. Tensors without dangling indices are unchanged, so the dense backend is unaffected.This bumps the
ITensorBasefloor to0.11.3, where an emptyreplaceindsis a no-op, so the spectator un-priming applies unconditionally with no special case for tensors that have no dangling index.A separate numerical discrepancy remains on the GradedArrays backend (the TensorKit backend gives correct results). It does not come from this factorization logic and is being looked into separately.