@@ -48,6 +48,9 @@ const TensorMapSpace{S <: ElementarySpace, N₁, N₂} = HomSpace{
4848 S, ProductSpace{S, N₁},
4949 ProductSpace{S, N₂},
5050}
51+ numout (:: Type{TensorMapSpace{S, N₁, N₂}} ) where {S, N₁, N₂} = N₁
52+ numin (:: Type{TensorMapSpace{S, N₁, N₂}} ) where {S, N₁, N₂} = N₂
53+ numind (T:: Type{TensorMapSpace{S, N₁, N₂}} ) where {S, N₁, N₂} = numout (T) + numin (T)
5154
5255function Base. getindex (W:: TensorMapSpace{<:IndexSpace, N₁, N₂} , i) where {N₁, N₂}
5356 return i <= N₁ ? codomain (W)[i] : dual (domain (W)[i - N₁])
@@ -137,18 +140,33 @@ fusiontrees(W::HomSpace) = fusionblockstructure(W).fusiontreelist
137140# Operations on HomSpaces
138141# -----------------------
139142"""
140- permute(W::HomSpace, (p₁, p₂)::Index2Tuple{N₁,N₂} )
143+ permute(W::HomSpace, (p₁, p₂)::Index2Tuple)
141144
142145Return the `HomSpace` obtained by permuting the indices of the domain and codomain of `W`
143146according to the permutation `p₁` and `p₂` respectively.
144147"""
145- function permute (W:: HomSpace{S} , (p₁, p₂):: Index2Tuple{N₁, N₂} ) where {S, N₁, N₂}
148+ function permute (W:: HomSpace , (p₁, p₂):: Index2Tuple )
146149 p = (p₁... , p₂... )
147150 TupleTools. isperm (p) && length (p) == numind (W) ||
148151 throw (ArgumentError (" $((p₁, p₂)) is not a valid permutation for $(W) " ))
149152 return select (W, (p₁, p₂))
150153end
151154
155+ _transpose_indices (W:: HomSpace ) = (reverse (domainind (W)), reverse (codomainind (W)))
156+
157+ function LinearAlgebra. transpose (W:: HomSpace , (p₁, p₂):: Index2Tuple = _transpose_indices (W))
158+ p = linearizepermutation (p₁, p₂, numout (W), numin (W))
159+ iscyclicpermutation (p) || throw (ArgumentError (lazy " $((p₁, p₂)) is not a cyclic permutation for $W" ))
160+ return select (W, (p₁, p₂))
161+ end
162+
163+ function braid (W:: HomSpace , (p₁, p₂):: Index2Tuple , lvls:: IndexTuple )
164+ p = (p₁... , p₂... )
165+ TupleTools. isperm (p) && length (p) == numind (W) == length (lvls) ||
166+ throw (ArgumentError (" $((p₁, p₂)) , $lvls is not a valid braiding for $(W) " ))
167+ return select (W, (p₁, p₂))
168+ end
169+
152170"""
153171 select(W::HomSpace, (p₁, p₂)::Index2Tuple{N₁,N₂})
154172
0 commit comments