From b6b9874f976ad51e099b351fbc78e3f752d1e732 Mon Sep 17 00:00:00 2001 From: Katharine Hyatt Date: Thu, 21 Aug 2025 14:54:20 +0200 Subject: [PATCH] Attempt to fix #262 --- src/planar/preprocessors.jl | 2 +- test/planar.jl | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/planar/preprocessors.jl b/src/planar/preprocessors.jl index 7f93560fc..031190816 100644 --- a/src/planar/preprocessors.jl +++ b/src/planar/preprocessors.jl @@ -211,7 +211,7 @@ function _construct_braidingtensors!(ex, preargs, indexmap) # ex is guaranteed t newargs = Vector{Any}(undef, length(args)) newargs[1] = args[1] success = true - indices = TO.getindices(ex) + indices = [TO.getindices(arg) for arg in args] for i in 2:length(ex.args) indexmapa = copy(indexmap) newargs[i], successa = _construct_braidingtensors!(args[i], preargs, indexmapa) diff --git a/test/planar.jl b/test/planar.jl index c347961ad..453a39c09 100644 --- a/test/planar.jl +++ b/test/planar.jl @@ -284,4 +284,13 @@ end @test tr1 ≈ tr2 ≈ tr3 ≈ tr4 ≈ tr5 ≈ tr6 ≈ tr7 end + @testset "Issue 262" begin + V = ℂ^2 + A = rand(T, V ← V) + B = rand(T, V ← V') + C = rand(T, V' ← V) + @planar D1[i; j] := A[i; j] + B[i; k] * C[k; j] + @planar D2[i; j] := B[i; k] * C[k; j] + A[i; j] + @test D1 ≈ D2 + end end