Skip to content

Commit 16ddd33

Browse files
committed
fix missing variables
1 parent 0218dd1 commit 16ddd33

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/tensors/tensoroperations.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ end
232232
function _trace_permute!(::UniqueFusion, tdst, tsrc, (p₁, p₂), (q₁, q₂), α, β, backend)
233233
scale!(tdst, β)
234234
r₁, r₂ = (p₁..., q₁...), (p₂..., q₂...)
235+
N₁, N₂ = length(p₁), length(p₂)
235236

236237
for (f₁, f₂) in fusiontrees(tsrc)
237238
(f₁′, f₂′), coeff = permute((f₁, f₂), (r₁, r₂))
@@ -256,12 +257,14 @@ end
256257
function _trace_permute!(::FusionStyle, tdst, tsrc, (p₁, p₂), (q₁, q₂), α, β, backend)
257258
scale!(tdst, β)
258259
r₁, r₂ = (p₁..., q₁...), (p₂..., q₂...)
260+
N₁, N₂ = length(p₁), length(p₂)
259261

260262
for src in fusionblocks(tsrc)
261263
dst, U = permute(src, (r₁, r₂))
262264
for (i, (f₁, f₂)) in enumerate(fusiontrees(src))
263265
for (j, (f₁′, f₂′)) in enumerate(fusiontrees(dst))
264266
coeff = U[j, i]
267+
iszero(coeff) && continue
265268
f₁′′, g₁ = split(f₁′, N₁)
266269
f₂′′, g₂ = split(f₂′, N₂)
267270
g₁ == g₂ || continue

0 commit comments

Comments
 (0)