@@ -278,7 +278,9 @@ println("------------------------------------")
278278 @test @constinferred (⊗ (V1 ⊗ V2, V3 ⊗ V4)) == P
279279 @test @constinferred (⊗ (V1, V2, V3 ⊗ V4)) == P
280280 @test @constinferred (⊗ (V1, V2 ⊗ V3, V4)) == P
281- @test @constinferred (insertunit (P, 3 )) == V1 * V2 * oneunit (V1) * V3 * V4
281+ @test V1 * V2 * oneunit (V1) * V3 * V4 ==
282+ @constinferred (insertleftunit (P, 3 )) ==
283+ @constinferred (insertrightunit (P, 2 ))
282284 @test @constinferred (removeunit (V1 * V2 * oneunit (V1)' * V3 * V4, 3 )) == P
283285 @test fuse (V1, V2' , V3) ≅ V1 ⊗ V2' ⊗ V3
284286 @test fuse (V1, V2' , V3) ≾ V1 ⊗ V2' ⊗ V3
@@ -339,8 +341,10 @@ println("------------------------------------")
339341 @test @constinferred (* (V1, V2, V3)) == P
340342 @test @constinferred (⊗ (V1, V2, V3)) == P
341343 @test @constinferred (adjoint (P)) == dual (P) == V3' ⊗ V2' ⊗ V1'
342- @test @constinferred (insertunit (P, 3 ; conj= true )) == V1 * V2 * oneunit (V1)' * V3
343- @test P == @constinferred (removeunit (insertunit (P, 3 ), 3 ))
344+ @test V1 * V2 * oneunit (V1)' * V3 ==
345+ @constinferred (insertleftunit (P, 3 ; conj= true )) ==
346+ @constinferred (insertrightunit (P, 2 ; conj= true ))
347+ @test P == @constinferred (removeunit (insertleftunit (P, 3 ), 3 ))
344348 @test fuse (V1, V2' , V3) ≅ V1 ⊗ V2' ⊗ V3
345349 @test fuse (V1, V2' , V3) ≾ V1 ⊗ V2' ⊗ V3 ≾ fuse (V1 ⊗ V2' ⊗ V3)
346350 @test fuse (V1, V2' ) ⊗ V3 ≾ V1 ⊗ V2' ⊗ V3
@@ -421,15 +425,21 @@ println("------------------------------------")
421425 @test W == @constinferred permute (W, ((1 , 2 ), (3 , 4 , 5 )))
422426 @test permute (W, ((2 , 4 , 5 ), (3 , 1 ))) == (V2 ⊗ V4' ⊗ V5' ← V3 ⊗ V1' )
423427 @test (V1 ⊗ V2 ← V1 ⊗ V2) == @constinferred TensorKit. compose (W, W' )
424- @test @constinferred (insertunit (W)) == (V1 ⊗ V2 ← V3 ⊗ V4 ⊗ V5 ⊗ oneunit (V5))
425- @test @constinferred (removeunit (insertunit (W), $ (numind (W) + 1 ))) == W
426- @test @constinferred (insertunit (W; conj= true )) == (V1 ⊗ V2 ←
427- V3 ⊗ V4 ⊗ V5 ⊗ oneunit (V5)' )
428- @test @constinferred (insertunit (W, 1 )) == (oneunit (V1) ⊗ V1 ⊗ V2 ← V3 ⊗ V4 ⊗ V5)
429- @test @constinferred (insertunit (W, 3 )) == (V1 ⊗ V2 ⊗ oneunit (V1) ← V3 ⊗ V4 ⊗ V5)
430- @test @constinferred (removeunit (insertunit (W, 3 ), 3 )) == W
431- @test @constinferred (insertunit (W, 3 ; preferdomain= true )) ==
432- (V1 ⊗ V2 ← oneunit (V1) ⊗ V3 ⊗ V4 ⊗ V5)
433- @test @constinferred (removeunit (insertunit (W, 3 ; preferdomain= true ), 3 )) == W
428+ @test (V1 ⊗ V2 ← V3 ⊗ V4 ⊗ V5 ⊗ oneunit (V5)) ==
429+ @constinferred (insertleftunit (W)) ==
430+ @constinferred (insertrightunit (W))
431+ @test @constinferred (removeunit (insertleftunit (W), $ (numind (W) + 1 ))) == W
432+ @test (V1 ⊗ V2 ← V3 ⊗ V4 ⊗ V5 ⊗ oneunit (V5)' ) ==
433+ @constinferred (insertleftunit (W; conj= true )) ==
434+ @constinferred (insertrightunit (W; conj= true ))
435+ @test (oneunit (V1) ⊗ V1 ⊗ V2 ← V3 ⊗ V4 ⊗ V5) ==
436+ @constinferred (insertleftunit (W, 1 )) ==
437+ @constinferred (insertrightunit (W, 0 ))
438+ @test (V1 ⊗ V2 ⊗ oneunit (V1) ← V3 ⊗ V4 ⊗ V5) ==
439+ @constinferred (insertrightunit (W, 2 ))
440+ @test (V1 ⊗ V2 ← oneunit (V1) ⊗ V3 ⊗ V4 ⊗ V5) == @constinferred (insertleftunit (W, 3 ))
441+ @test @constinferred (removeunit (insertleftunit (W, 3 ), 3 )) == W
442+ @test @constinferred (insertrightunit (one (V1) ← V1, 0 )) == (oneunit (V1) ← V1)
443+ @test_throws BoundsError insertleftunit (one (V1) ← V1, 0 )
434444 end
435445end
0 commit comments