232232Return a tensor product of zero spaces of type `S`, i.e. this is the unit object under the
233233tensor product operation, such that `V ⊗ one(V) == V`.
234234"""
235+ # TODO : unit(V::S)?
235236Base. one (V:: VectorSpace ) = one (typeof (V))
236237Base. one (:: Type{<:ProductSpace{S}} ) where {S<: ElementarySpace } = ProductSpace {S,0} (())
237238Base. one (:: Type{S} ) where {S<: ElementarySpace } = ProductSpace {S,0} (())
@@ -242,7 +243,7 @@ function Base.literal_pow(::typeof(^), V::ElementarySpace, p::Val{N}) where {N}
242243 return ProductSpace {typeof(V),N} (ntuple (n -> V, p))
243244end
244245
245- fuse (P:: ProductSpace{S,0} ) where {S<: ElementarySpace } = oneunit (S)
246+ fuse (P:: ProductSpace{S,0} ) where {S<: ElementarySpace } = unitspace (S)
246247fuse (P:: ProductSpace{S} ) where {S<: ElementarySpace } = fuse (P. spaces... )
247248
248249"""
@@ -256,7 +257,7 @@ See also [`insertrightunit`](@ref insertrightunit(::ProductSpace, ::Val{i}) wher
256257"""
257258function insertleftunit (P:: ProductSpace , :: Val{i} = Val (length (P) + 1 );
258259 conj:: Bool = false , dual:: Bool = false ) where {i}
259- u = oneunit (spacetype (P))
260+ u = unitspace (spacetype (P))
260261 if dual
261262 u = TensorKit. dual (u)
262263 end
@@ -277,7 +278,7 @@ See also [`insertleftunit`](@ref insertleftunit(::ProductSpace, ::Val{i}) where
277278"""
278279function insertrightunit (P:: ProductSpace , :: Val{i} = Val (length (P));
279280 conj:: Bool = false , dual:: Bool = false ) where {i}
280- u = oneunit (spacetype (P))
281+ u = unitspace (spacetype (P))
281282 if dual
282283 u = TensorKit. dual (u)
283284 end
@@ -299,7 +300,7 @@ and [`insertrightunit`](@ref insertrightunit(::ProductSpace, ::Val{i}) where {i}
299300"""
300301function removeunit (P:: ProductSpace , :: Val{i} ) where {i}
301302 1 ≤ i ≤ length (P) || _boundserror (P, i)
302- isisomorphic (P[i], oneunit (P[i])) || _nontrivialspaceerror (P, i)
303+ isisomorphic (P[i], unitspace (P[i])) || _nontrivialspaceerror (P, i)
303304 return ProductSpace {spacetype(P)} (TupleTools. deleteat (P. spaces, i))
304305end
305306
@@ -326,7 +327,7 @@ function Base.promote_rule(::Type{S}, ::Type{<:ProductSpace{S}}) where {S<:Eleme
326327end
327328
328329# ProductSpace to ElementarySpace
329- Base. convert (:: Type{S} , P:: ProductSpace{S,0} ) where {S<: ElementarySpace } = oneunit (S)
330+ Base. convert (:: Type{S} , P:: ProductSpace{S,0} ) where {S<: ElementarySpace } = unitspace (S)
330331Base. convert (:: Type{S} , P:: ProductSpace{S} ) where {S<: ElementarySpace } = fuse (P. spaces... )
331332
332333# ElementarySpace to ProductSpace
0 commit comments