@@ -81,24 +81,9 @@ For vector spaces over the real numbers, it must hold that `conj(V) == V`.
8181For vector spaces with a Euclidean inner product, it must hold that `conj(V) == dual(V)`.
8282""" conj (:: VectorSpace )
8383
84-
8584# convenience definitions:
8685Base. adjoint (V:: VectorSpace ) = dual (V)
8786
88- @doc """
89- isdual(V::ElementarySpace) -> Bool
90-
91- Return whether an ElementarySpace `V` is normal or rather a dual space.
92- Always returns `false` for spaces where `V == dual(V)`.
93- """ isdual (:: ElementarySpace )
94-
95- @doc """
96- isconj(V::ElementarySpace) -> Bool
97-
98- Return whether an ElementarySpace `V` is normal or rather the conjugated space.
99- Always returns `false` for spaces where `V == conj(V)`, i.e. vector spaces over `ℝ`.
100- """ isconj (:: ElementarySpace )
101-
10287# Hierarchy of elementary vector spaces
10388# ---------------------------------------
10489"""
@@ -131,6 +116,20 @@ Return the sum of all degeneracy dimensions of the vector space `V`.
131116"""
132117reduceddim (V:: ElementarySpace ) = sum (Base. Fix1 (dim, V), sectors (V); init = 0 )
133118
119+ @doc """
120+ isdual(V::ElementarySpace) -> Bool
121+
122+ Return whether an ElementarySpace `V` is normal or rather a dual space.
123+ Always returns `false` for spaces where `V == dual(V)`.
124+ """ isdual (:: ElementarySpace )
125+
126+ @doc """
127+ isconj(V::ElementarySpace) -> Bool
128+
129+ Return whether an ElementarySpace `V` is normal or rather the conjugated space.
130+ Always returns `false` for spaces where `V == conj(V)`, i.e. vector spaces over `ℝ`.
131+ """ isconj (:: ElementarySpace )
132+
134133"""
135134 unitspace(V::S) where {S<:ElementarySpace} -> S
136135
@@ -164,7 +163,7 @@ Return the corresponding vector space of type `S` that represents the direct sum
164163spaces `V₁`, `V₂`, ... Note that all the individual spaces should have the same value for
165164[`isdual`](@ref), as otherwise the direct sum is not defined.
166165"""
167- function ⊕ end
166+ ⊕ (V₁ :: S , V₂ :: S ) where {S <: ElementarySpace }
168167⊕ (V₁:: ElementarySpace , V₂:: ElementarySpace ) = ⊕ (promote (V₁, V₂)... )
169168⊕ (V:: Vararg{ElementarySpace} ) = foldl (⊕ , V)
170169const oplus = ⊕
@@ -267,9 +266,6 @@ InnerProductStyle(::Type{<:VectorSpace}) = NoInnerProduct()
267266 throw (ArgumentError (" $fname requires Euclidean inner product" ))
268267end
269268
270- dual (V:: VectorSpace ) = dual (InnerProductStyle (V), V)
271- dual (:: EuclideanInnerProduct , V:: VectorSpace ) = conj (V)
272-
273269"""
274270 sectortype(a) -> Type{<:Sector}
275271 sectortype(::Type) -> Type{<:Sector}
0 commit comments