@@ -66,12 +66,14 @@ println("------------------------------------")
6666 @test length (sectors (V)) == 1
6767 @test @constinferred (TensorKit. hassector (V, Trivial ()))
6868 @test @constinferred (dim (V)) == d == @constinferred (dim (V, Trivial ()))
69- @test dim (@constinferred (typeof (V)( ))) == 0
70- @test (sectors (typeof (V)( ))... ,) == ()
69+ @test dim (@constinferred (zero (V ))) == 0
70+ @test (sectors (zero (V ))... ,) == ()
7171 @test @constinferred (TensorKit. axes (V)) == Base. OneTo (d)
7272 @test ℝ^ d == ℝ[](d) == CartesianSpace (d) == typeof (V)(d)
7373 W = @constinferred ℝ^ 1
7474 @test @constinferred (oneunit (V)) == W == oneunit (typeof (V))
75+ @test @constinferred (zero (V)) == ℝ^ 0 == zero (typeof (V))
76+ @test @constinferred (⊕ (V, zero (V))) == V
7577 @test @constinferred (⊕ (V, V)) == ℝ^ (2 d)
7678 @test @constinferred (⊕ (V, oneunit (V))) == ℝ^ (d + 1 )
7779 @test @constinferred (⊕ (V, V, V, V)) == ℝ^ (4 d)
@@ -111,12 +113,14 @@ println("------------------------------------")
111113 @test length (sectors (V)) == 1
112114 @test @constinferred (TensorKit. hassector (V, Trivial ()))
113115 @test @constinferred (dim (V)) == d == @constinferred (dim (V, Trivial ()))
114- @test dim (@constinferred (typeof (V)( ))) == 0
115- @test (sectors (typeof (V)( ))... ,) == ()
116+ @test dim (@constinferred (zero (V ))) == 0
117+ @test (sectors (zero (V ))... ,) == ()
116118 @test @constinferred (TensorKit. axes (V)) == Base. OneTo (d)
117119 @test ℂ^ d == Vect[Trivial](d) == Vect[](Trivial () => d) == ℂ[](d) == typeof (V)(d)
118120 W = @constinferred ℂ^ 1
119121 @test @constinferred (oneunit (V)) == W == oneunit (typeof (V))
122+ @test @constinferred (zero (V)) == ℂ^ 0 == zero (typeof (V))
123+ @test @constinferred (⊕ (V, zero (V))) == V
120124 @test @constinferred (⊕ (V, V)) == ℂ^ (2 d)
121125 @test_throws SpaceMismatch (⊕ (V, V' ))
122126 # promote_except = ErrorException("promotion of types $(typeof(ℝ^d)) and " *
@@ -200,11 +204,12 @@ println("------------------------------------")
200204 @test eval (Meta. parse (sprint (show, V))) == V
201205 @test eval (Meta. parse (sprint (show, typeof (V)))) == typeof (V)
202206 # space with no sectors
203- @test dim (@constinferred (typeof (V)( ))) == 0
207+ @test dim (@constinferred (zero (V ))) == 0
204208 # space with a single sector
205209 W = @constinferred GradedSpace (one (I) => 1 )
206210 @test W == GradedSpace (one (I) => 1 , randsector (I) => 0 )
207211 @test @constinferred (oneunit (V)) == W == oneunit (typeof (V))
212+ @test @constinferred (zero (V)) == GradedSpace (one (I) => 0 )
208213 # randsector never returns trivial sector, so this cannot error
209214 @test_throws ArgumentError GradedSpace (one (I) => 1 , randsector (I) => 0 , one (I) => 3 )
210215 @test eval (Meta. parse (sprint (show, W))) == W
@@ -226,6 +231,7 @@ println("------------------------------------")
226231 if hasfusiontensor (I)
227232 @test @constinferred (TensorKit. axes (V)) == Base. OneTo (dim (V))
228233 end
234+ @test @constinferred (⊕ (V, zero (V))) == V
229235 @test @constinferred (⊕ (V, V)) == Vect[I](c => 2 dim (V, c) for c in sectors (V))
230236 @test @constinferred (⊕ (V, V, V, V)) == Vect[I](c => 4 dim (V, c) for c in sectors (V))
231237 @test @constinferred (⊕ (V, oneunit (V))) ==
0 commit comments