planarcontract!/planar_contract_indices throws ArgumentError: ... is not a cyclic permutation for the simplest possible planar contraction between two (1,1) tensors with zero contracted indices (an outer-product-like call, as opposed to ⊗ itself) — even for the identity pAB. Found via the full MPSKit test suite (fast_tests=true) against this branch: breaks operators/projection, operators/mpohamiltonian (Adapt), algorithms/dynamical_dmrg, operators/lazysum, algorithms/changebonds, and their GPU variants — all going through environments/Jordan-form MPO Hamiltonian machinery for non-bosonic sector types (PlanarTrivial in the repro, but likely any BraidingStyle != Bosonic sector).
Minimal reproduction (bisects to #532, planar_contract_indices/_planar_rotate):
using TensorKit
using TensorKit: planarcontract!, planar_contract_indices
using TensorKitSectors: PlanarTrivial
using VectorInterface: One, Zero
V = Vect[PlanarTrivial](PlanarTrivial() => 1)
A = randn(ComplexF64, V ← V)
B = randn(ComplexF64, V ← V)
C = randn(ComplexF64, (V ⊗ V) ← (V ⊗ V))
pA = ((1, 2), ())
pB = ((), (1, 2))
planar_contract_indices(A, pA, B, pB, ((1, 2), (3, 4)))
# -> (((1, 2), ()), ((), (2, 1)), ((1, 2), (4, 3)))
# ^^^^^^ oindB reversed even though cindB is empty
planarcontract!(C, A, pA, B, pB, ((1, 2), (3, 4)), One(), Zero())
# ArgumentError: ((1, 2), (4, 3)) is not a cyclic permutation for ...
Even the identity pAB = ((1,2),(3,4)) (just concatenate A's legs then B's) fails. Suspect root cause: _planar_rotate(indB, cindB, oindB) with cindB empty (N₁ = 0) hits the 0 < N₁ < N guard as false and skips rotation, but still unconditionally does tail′ = reverse(rot[N₁+1:end]), reversing all of oindB — this reversal looks intended for the general case but seems wrong when there are no contracted indices at all on that operand.
This is a release blocker for the changes in #532/#526 (currently on the release-v0.17.2 branch / PR #550) — recommend fixing or reverting before that release ships.
planarcontract!/planar_contract_indicesthrowsArgumentError: ... is not a cyclic permutationfor the simplest possible planar contraction between two (1,1) tensors with zero contracted indices (an outer-product-like call, as opposed to⊗itself) — even for the identitypAB. Found via the full MPSKit test suite (fast_tests=true) against this branch: breaksoperators/projection,operators/mpohamiltonian(Adapt),algorithms/dynamical_dmrg,operators/lazysum,algorithms/changebonds, and their GPU variants — all going throughenvironments/Jordan-form MPO Hamiltonian machinery for non-bosonic sector types (PlanarTrivialin the repro, but likely anyBraidingStyle != Bosonicsector).Minimal reproduction (bisects to #532,
planar_contract_indices/_planar_rotate):Even the identity
pAB = ((1,2),(3,4))(just concatenate A's legs then B's) fails. Suspect root cause:_planar_rotate(indB, cindB, oindB)withcindBempty (N₁ = 0) hits the0 < N₁ < Nguard as false and skips rotation, but still unconditionally doestail′ = reverse(rot[N₁+1:end]), reversing all ofoindB— this reversal looks intended for the general case but seems wrong when there are no contracted indices at all on that operand.This is a release blocker for the changes in #532/#526 (currently on the
release-v0.17.2branch / PR #550) — recommend fixing or reverting before that release ships.