Skip to content

Fix full_update for tensors with dangling indices#4

Merged
mtfishman merged 1 commit into
mf/itensorbase-backendfrom
mf/fix-full-update-symmetric
Jul 10, 2026
Merged

Fix full_update for tensors with dangling indices#4
mtfishman merged 1 commit into
mf/itensorbase-backendfrom
mf/fix-full-update-symmetric

Conversation

@mtfishman

@mtfishman mtfishman commented Jul 10, 2026

Copy link
Copy Markdown
Owner

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 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.

This bumps the ITensorBase floor to 0.11.3, where an empty replaceinds is 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.

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
mtfishman force-pushed the mf/fix-full-update-symmetric branch from 4a6758b to 4af9e57 Compare July 10, 2026 20:52
@mtfishman
mtfishman merged commit 9622bc2 into mf/itensorbase-backend Jul 10, 2026
3 checks passed
@mtfishman
mtfishman deleted the mf/fix-full-update-symmetric branch July 10, 2026 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant