@@ -10,8 +10,8 @@ codomain of the map. The starting point is an abstract type `VectorSpace`
1010``` julia
1111abstract type VectorSpace end
1212```
13- which serves in a sense as the category `` Vect `` . All instances of subtypes of ` VectorSpace `
14- will represent vector spaces. In particular, we define two abstract subtypes
13+ which serves in a sense as the category `` \mathbf{ Vect} `` . All instances of subtypes of
14+ ` VectorSpace ` will represent vector spaces. In particular, we define two abstract subtypes
1515``` julia
1616abstract type ElementarySpace{𝕜} <: VectorSpace end
1717const IndexSpace = ElementarySpace
@@ -68,19 +68,18 @@ objects of the same concrete type (i.e. with the same type parameters in case of
6868parametric type). In particular, every ` ElementarySpace ` should implement the following
6969methods
7070
71- * ` dim(::ElementarySpace) -> ::Int `
72- return the dimension of the space as an ` Int `
71+ * ` dim(::ElementarySpace) -> ::Int ` returns the dimension of the space as an ` Int `
7372
74- * ` dual{S<:ElementarySpace}(::S) -> ::S `
75- return the [ dual space] ( http://en.wikipedia.org/wiki/Dual_space ) ` dual(V) ` , using an
76- instance of the same concrete type (i.e. not via type parameters); this should satisfy
73+ * ` dual{S<:ElementarySpace}(::S) -> ::S ` returns the
74+ [ dual space] ( http://en.wikipedia.org/wiki/Dual_space ) ` dual(V) ` , using an instance of
75+ the same concrete type (i.e. not via type parameters); this should satisfy
7776 ` dual(dual(V)==V `
7877
79- * ` conj{S<:ElementarySpace}(::S) -> ::S `
80- return the [ complex conjugate space] ( http://en.wikipedia.org/wiki/Complex_conjugate_vector_space )
78+ * ` conj{S<:ElementarySpace}(::S) -> ::S ` returns the
79+ [ complex conjugate space] ( http://en.wikipedia.org/wiki/Complex_conjugate_vector_space )
8180 ` conj(V) ` , using an instance of the same concrete type (i.e. not via type parameters);
8281 this should satisfy ` conj(conj(V))==V ` and we automatically have
83- ` conj{F<:Real} (V::ElementarySpace{F }) = V ` .
82+ ` conj(V::ElementarySpace{ℝ }) = V ` .
8483
8584For convenience, the dual of a space ` V ` can also be obtained as ` V' ` .
8685
@@ -98,17 +97,18 @@ We furthermore define the abstract type
9897``` julia
9998abstract InnerProductSpace{𝕜} <: ElementarySpace{𝕜}
10099```
101- to contain all vector spaces ` V ` which have an inner product and thus a canonical mapping from
102- ` dual(V) ` to ` V ` (for ` 𝕜 ⊆ ℝ ` ) or from ` dual(V) ` to ` conj(V) ` (otherwise). This mapping
103- is provided by the metric, but no further support for working with metrics is currently implemented.
100+ to contain all vector spaces ` V ` which have an inner product and thus a canonical mapping
101+ from ` dual(V) ` to ` V ` (for ` 𝕜 ⊆ ℝ ` ) or from ` dual(V) ` to ` conj(V) ` (otherwise). This
102+ mapping is provided by the metric, but no further support for working with metrics is
103+ currently implemented.
104104
105105Finally there is
106106``` julia
107107abstract EuclideanSpace{𝕜} <: InnerProductSpace{𝕜}
108108```
109109to contain all spaces ` V ` with a standard Euclidean inner product (i.e. where the metric is
110- the identity). These spaces have the natural isomorphisms ` dual(V) == V ` (for ` 𝕜<:Real ` ) or
111- ` dual(V) == conj(V) ` (for ` 𝕜<:Complex ` ). In particular, we have two concrete types
110+ the identity). These spaces have the natural isomorphisms ` dual(V) == V ` (for ` 𝕜<:Real ` )
111+ or ` dual(V) == conj(V) ` (for ` 𝕜<:Complex ` ). In particular, we have two concrete types
112112``` julia
113113immutable CartesianSpace <: EuclideanSpace{ℝ}
114114 d:: Int
@@ -118,10 +118,10 @@ immutable ComplexSpace <: EuclideanSpace{ℂ}
118118 dual:: Bool
119119end
120120```
121- to represent the Euclidean spaces $ℝ^d$ or $ℂ^d$ without further inner structure. They can be
122- created using the syntax ` ℝ^d ` and ` ℂ^d ` , or ` (ℂ^d)' ` for the dual space of the latter. Note
123- that the brackets are required because of the precedence rules, since ` d' == d ` for `d::Integer``.
124- Some examples
121+ to represent the Euclidean spaces $ℝ^d$ or $ℂ^d$ without further inner structure. They can
122+ be created using the syntax ` ℝ^d ` and ` ℂ^d ` , or ` (ℂ^d)' ` for the dual space of the latter.
123+ Note that the brackets are required because of the precedence rules, since ` d' == d ` for
124+ ` d::Integer ` . Some examples:
125125``` @repl tensorkit
126126dim(ℝ^10)
127127(ℝ^10)' == ℝ^10
@@ -136,19 +136,19 @@ an inner structure corresponding to the irreducible representations of a group.
136136
137137## Composite spaces
138138
139- Composite spaces are vector spaces that are built up out of individual elementary vector spaces.
140- The most prominent (and currently only) example is a tensor product of ` N ` elementary spaces
141- of the same type ` S ` , which is implemented as
139+ Composite spaces are vector spaces that are built up out of individual elementary vector
140+ spaces. The most prominent (and currently only) example is a tensor product of ` N ` elementary spaces of the same type ` S ` , which is implemented as
142141``` julia
143142struct ProductSpace{S<: ElementarySpace , N} <: CompositeSpace{S}
144143 spaces:: NTuple{N, S}
145144end
146145```
147146Given some ` V1::S ` , ` V2::S ` , ` V3::S ` of the same type ` S<:ElementarySpace ` , we can easily
148- construct ` ProductSpace{S,3}((V1,V2,V3)) ` as ` ProductSpace(V1,V2,V3) ` or using ` V1 ⊗ V2 ⊗ V3 ` ,
149- where ` ⊗ ` is simply obtained by typing ` \otimes ` +TAB. In fact, for convenience, even the regular
150- multiplication operator ` * ` acts as tensor product between vector spaces, and as a consequence
151- so does raising a vector space to a positive integer power, i.e.
147+ construct ` ProductSpace{S,3}((V1,V2,V3)) ` as ` ProductSpace(V1,V2,V3) ` or using
148+ ` V1 ⊗ V2 ⊗ V3 ` , where ` ⊗ ` is simply obtained by typing ` \otimes ` +TAB. In fact, for
149+ convenience, also the regular multiplication operator ` * ` acts as tensor product between
150+ vector spaces, and as a consequence so does raising a vector space to a positive integer
151+ power, i.e.
152152``` @repl tensorkit
153153V1 = ℂ^2
154154V2 = ℂ^3
@@ -158,51 +158,52 @@ dim(V1 ⊗ V2)
158158dims(V1 ⊗ V2)
159159dual(V1 ⊗ V2)
160160```
161- Here, the new function ` dims ` maps ` dim ` to the individual spaces in a ` ProductSpace ` and returns
162- the result as a tuple. Note that the rationale for the last result was explained in the subsection
163- [ Duals] ( @ref ) of [ Properties of monoidal categories] ( @ref ) .
161+ Here, the new function ` dims ` maps ` dim ` to the individual spaces in a ` ProductSpace ` and
162+ returns the result as a tuple. Note that the rationale for the last result was explained in
163+ the subsection [ Duals] ( @ref ) of [ Properties of monoidal categories] ( @ref ) .
164164
165165Following Julia's Base library, the function ` one ` applied to a ` ProductSpace{S,N} ` returns
166166the multiplicative identity, which is ` ProductSpace{S,0} ` . The same result is obtained when
167- acting on an instance ` V ` of ` S::ElementarySpace ` directly, however note that ` V ⊗ one(V) ` will
168- yield a ` ProductSpace{S,1}(V) ` and not ` V ` itself. Similar to Julia Base, ` one ` also works in
169- the type domain.
170-
171- In the future, other ` CompositeSpace ` types could be added. For example, the wave function of
172- an ` N ` -particle quantum system in first quantization would require the introduction of a ` SymmetricSpace{S,N} `
173- or a ` AntiSymmetricSpace{S,N} ` for bosons or fermions respectively, which correspond to the
174- symmetric (permutation invariant) or antisymmetric subspace of ` V^N ` , where ` V::S ` represents
175- the Hilbert space of the single particle system. Other domains, like general relativity, might
176- also benefit from tensors living in a subspace with certain symmetries under specific index
177- permutations.
167+ acting on an instance ` V ` of ` S::ElementarySpace ` directly, however note that ` V ⊗ one(V) `
168+ will yield a ` ProductSpace{S,1}(V) ` and not ` V ` itself. Similar to Julia Base, ` one ` also
169+ works in the type domain.
170+
171+ In the future, other ` CompositeSpace ` types could be added. For example, the wave function
172+ of an ` N ` -particle quantum system in first quantization would require the introduction of a
173+ ` SymmetricSpace{S,N} ` or a ` AntiSymmetricSpace{S,N} ` for bosons or fermions respectively,
174+ which correspond to the symmetric (permutation invariant) or antisymmetric subspace of
175+ ` V^N ` , where ` V::S ` represents the Hilbert space of the single particle system. Other
176+ domains, like general relativity, might also benefit from tensors living in a subspace with
177+ certain symmetries under specific index permutations.
178178
179179## Some more functionality
180- Some more convenience functions are provided for the euclidean spaces [ ` CartesianSpace ` ] ( @ref )
181- and [ ` ComplexSpace ` ] ( @ref ) , as well as for [ ` RepresentationSpace ` ] ( @ref ) discussed in the next
182- section. All functions below that act on more than a single elementary space, are only defined
183- when the different spaces are of the same concrete subtype ` S<:ElementarySpace `
184-
185- The function ` fuse(V1, V2, ...) ` or ` fuse(V1 ⊗ V2 ⊗ ...) ` returns an elementary space that is
186- isomorphic to ` V1 ⊗ V2 ⊗ ... ` , in the sense that a unitary tensor map can be constructed between
187- those spaces, e.g. from ` W = V1 ⊗ V2 ⊗ ... ` to ` V = fuse(V1 ⊗ V2 ⊗ ...) ` . The function ` flip(V1) `
188- returns a space that is isomorphic to ` V1 ` but has ` isdual(flip(V1)) == isdual(V1') ` , i.e. if
189- ` V1 ` is a normal space than ` flip(V1) ` is a dual space. Again, isomorphism here implies that
190- a unitary map (but there is no canonical choice) can be constructed between both spaces. ` flip(V1) `
191- is different from ` dual(V1) ` in the case of [ ` RepresentationSpace ` ] ( @ref ) . It is useful to
192- flip a tensor index from a ket to a bra (or vice versa), by contracting that index with a unitary
193- map from ` V1 ` to ` map(V1) ` . We refer to ` [Index operations](@ref) ` for further information.
194- Some examples
180+ Some more convenience functions are provided for the euclidean spaces
181+ [ ` CartesianSpace ` ] ( @ref ) and [ ` ComplexSpace ` ] ( @ref ) , as well as for
182+ [ ` RepresentationSpace ` ] ( @ref ) discussed in the next section. All functions below that act
183+ on more than a single elementary space, are only defined when the different spaces are of
184+ the same concrete subtype ` S<:ElementarySpace `
185+
186+ The function ` fuse(V1, V2, ...) ` or ` fuse(V1 ⊗ V2 ⊗ ...) ` returns an elementary space that
187+ is isomorphic to ` V1 ⊗ V2 ⊗ ... ` , in the sense that a unitary tensor map can be constructed
188+ between those spaces, e.g. from ` W = V1 ⊗ V2 ⊗ ... ` to ` V = fuse(V1 ⊗ V2 ⊗ ...) ` . The
189+ function ` flip(V1) ` returns a space that is isomorphic to ` V1 ` but has
190+ ` isdual(flip(V1)) == isdual(V1') ` , i.e. if ` V1 ` is a normal space than ` flip(V1) ` is a dual
191+ space. Again, isomorphism here implies that a unitary map (but there is no canonical
192+ choice) can be constructed between both spaces. ` flip(V1) ` is different from ` dual(V1) ` in
193+ the case of [ ` RepresentationSpace ` ] ( @ref ) . It is useful to flip a tensor index from a ket
194+ to a bra (or vice versa), by contracting that index with a unitary map from ` V1 ` to
195+ ` flip(V1) ` . We refer to ` [Index operations](@ref) ` for further information. Some examples:
195196``` @repl tensorkit
196197fuse(ℝ^5, ℝ^3)
197198fuse(ℂ^3, (ℂ^5)', ℂ^2)
198199flip(ℂ^4)
199200```
200201
201202We also define the direct sum ` V1 ` and ` V2 ` as ` V1 ⊕ V2 ` , where ` ⊕ ` is obtained by typing
202- ` \oplus ` +TAB. This is possible only if ` isdual(V1) == isdual(V2) ` . With a little pun on Julia
203- Base, ` oneunit ` applied to an elementary space (in the value or type domain) returns the one-dimensional
204- space, which is isomorphic to the scalar field of the spaceitself. Some examples illustrate
205- this better
203+ ` \oplus ` +TAB. This is possible only if ` isdual(V1) == isdual(V2) ` . With a little pun on
204+ Julia Base, ` oneunit ` applied to an elementary space (in the value or type domain) returns
205+ the one-dimensional space, which is isomorphic to the scalar field of the spaceitself. Some
206+ examples illustrate this better
206207``` @repl tensorkit
207208ℝ^5 ⊕ ℝ^3
208209ℂ^5 ⊕ ℂ^3
@@ -214,13 +215,13 @@ oneunit((ℂ^3)')
214215(ℂ^5)' ⊕ oneunit((ℂ^5)')
215216```
216217
217- For two spaces ` V1 ` and ` V2 ` , ` min(V1,V2) ` returns the space with the smallest dimension, whereas
218- ` max(V1,V2) ` returns the space with the largest dimension, as illustrated by
218+ For two spaces ` V1 ` and ` V2 ` , ` min(V1,V2) ` returns the space with the smallest dimension,
219+ whereas ` max(V1,V2) ` returns the space with the largest dimension, as illustrated by
219220``` @repl tensorkit
220221min(ℝ^5, ℝ^3)
221222max(ℂ^5, ℂ^3)
222223max(ℂ^5, (ℂ^3)')
223224```
224225Again, we impose ` isdual(V1) == isdual(V2) ` . Again, the use of these methods is to construct
225- unitary or isometric tensors that map between different spaces, which will be elaborated upon
226- in the section on Tensors
226+ unitary or isometric tensors that map between different spaces, which will be elaborated
227+ upon in the section on Tensors.
0 commit comments