@@ -53,6 +53,23 @@ function BraidingTensor{T}(V::HomSpace, adjoint::Bool = false) where {T}
5353 throw (SpaceMismatch (" Cannot define a braiding on $V " ))
5454 return BraidingTensor {T} (V[2 ], V[1 ], adjoint)
5555end
56+ # these are here to make the preprocessing for `@planar` expressions less painful
57+ function BraidingTensor (TorA:: Type , V1:: S , V2:: S , adjoint:: Bool = false ) where {S <: IndexSpace }
58+ T = eltype (TorA)
59+ TA = storagetype (TorA)
60+ return BraidingTensor {T, S, TA} (V1, V2, adjoint)
61+ end
62+ function BraidingTensor (TorA:: Type , V1:: IndexSpace , V2:: IndexSpace , adjoint:: Bool = false )
63+ return BraidingTensor (TorA, promote (V1, V2)... , adjoint)
64+ end
65+ function BraidingTensor (TorA:: Type , V:: HomSpace , adjoint:: Bool = false )
66+ domain (V) == reverse (codomain (V)) ||
67+ throw (SpaceMismatch (" Cannot define a braiding on $V " ))
68+ T = eltype (TorA)
69+ S = spacetype (V[2 ])
70+ TA = storagetype (TorA)
71+ return BraidingTensor {T, S, TA} (V[2 ], V[1 ], adjoint)
72+ end
5673function Base. adjoint (b:: BraidingTensor{T, S, A} ) where {T, S, A}
5774 return BraidingTensor {T, S, A} (b. V1, b. V2, ! b. adjoint)
5875end
0 commit comments