Skip to content

Commit a548b36

Browse files
committed
variable renames
1 parent 015fb0f commit a548b36

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

src/spaces/vectorspaces.jl

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ represent objects in 𝕜-linear monoidal categories.
4242
abstract type VectorSpace end
4343

4444
"""
45-
field(a) -> Type{𝔽<:Field}
46-
field(::Type{T}) -> Type{𝔽<:Field}
45+
field(a) -> Type{𝔽 <: Field}
46+
field(::Type{T}) -> Type{𝔽 <: Field}
4747
4848
Return the type of field over which object `a` (e.g. a vector space or a tensor) is defined.
4949
Also works in type domain.
@@ -119,12 +119,12 @@ Return the sum of all degeneracy dimensions of the vector space `V`.
119119
reduceddim(V::ElementarySpace) = sum(Base.Fix1(dim, V), sectors(V); init = 0)
120120

121121
"""
122-
unitspace(V::S) where {S<:ElementarySpace} -> S
122+
unitspace(V::S) where {S <: ElementarySpace} -> S
123123
124124
Return the corresponding vector space of type `S` that represents the trivial
125125
one-dimensional space, i.e. the space that is isomorphic to the corresponding field. Note
126126
that this is different from `one(V::S)`, which returns the empty product space
127-
`ProductSpace{S,0}(())`. `Base.oneunit` falls back to `unitspace`. For vector spaces
127+
`ProductSpace{S, 0}(())`. `Base.oneunit` falls back to `unitspace`. For vector spaces
128128
of type `GradedSpace{I}` where `Sector` `I` has a semi-simple unit structure, this
129129
returns a multi-dimensional space corresponding to all unit sectors in `I`.
130130
"""
@@ -133,7 +133,7 @@ Base.oneunit(V::ElementarySpace) = unitspace(V)
133133
Base.oneunit(::Type{V}) where {V <: ElementarySpace} = unitspace(V)
134134

135135
"""
136-
zerospace(V::S) where {S<:ElementarySpace} -> S
136+
zerospace(V::S) where {S <: ElementarySpace} -> S
137137
138138
Return the corresponding vector space of type `S` that represents the zero-dimensional or empty space.
139139
This is, with a slight abuse of notation, the zero element of the direct sum of vector spaces.
@@ -144,66 +144,66 @@ Base.zero(V::ElementarySpace) = zerospace(V)
144144
Base.zero(::Type{V}) where {V <: ElementarySpace} = zerospace(V)
145145

146146
"""
147-
leftunitspace(V::ElementarySpace)-> ElementarySpace
147+
leftunitspace(V::S) where {S <: ElementarySpace} -> S
148148
149149
Return the corresponding vector space of type `ElementarySpace` that represents the trivial
150150
one-dimensional space, i.e. the space that is isomorphic to the corresponding field. For vector spaces
151151
of type `GradedSpace{I}`, this corresponds to the unique left unit of the objects in `Sector` `I` present
152152
in the vector space.
153153
"""
154-
function leftunitspace(S::ElementarySpace)
155-
I = sectortype(S)
154+
function leftunitspace(V::ElementarySpace)
155+
I = sectortype(V)
156156
if UnitStyle(I) isa SimpleUnit
157-
return unitspace(typeof(S))
157+
return unitspace(typeof(V))
158158
else
159-
!isempty(sectors(S)) || throw(ArgumentError("Cannot determine type of empty space"))
160-
_allequal(leftunit, sectors(S)) ||
161-
throw(ArgumentError("sectors of $S do not have the same left unit"))
159+
!isempty(sectors(V)) || throw(ArgumentError("Cannot determine type of empty space"))
160+
_allequal(leftunit, sectors(V)) ||
161+
throw(ArgumentError("sectors of $V do not have the same left unit"))
162162

163-
sector = leftunit(first(sectors(S)))
164-
return spacetype(S)(sector => 1)
163+
sector = leftunit(first(sectors(V)))
164+
return spacetype(V)(sector => 1)
165165
end
166166
end
167167

168168
"""
169-
rightunitspace(S::ElementarySpace) -> ElementarySpace
169+
rightunitspace(V::S) where {S <: ElementarySpace} -> S
170170
171171
Return the corresponding vector space of type `ElementarySpace` that represents the trivial
172172
one-dimensional space, i.e. the space that is isomorphic to the corresponding field. For vector spaces
173173
of type `GradedSpace{I}`, this corresponds to the right unit of the objects in `Sector` `I` present
174174
in the vector space.
175175
"""
176-
function rightunitspace(S::ElementarySpace)
177-
I = sectortype(S)
176+
function rightunitspace(V::ElementarySpace)
177+
I = sectortype(V)
178178
if UnitStyle(I) isa SimpleUnit
179-
return unitspace(typeof(S))
179+
return unitspace(typeof(V))
180180
else
181-
!isempty(sectors(S)) || throw(ArgumentError("Cannot determine type of empty space"))
182-
_allequal(rightunit, sectors(S)) ||
183-
throw(ArgumentError("sectors of $S do not have the same right unit"))
181+
!isempty(sectors(V)) || throw(ArgumentError("Cannot determine type of empty space"))
182+
_allequal(rightunit, sectors(V)) ||
183+
throw(ArgumentError("sectors of $V do not have the same right unit"))
184184

185-
sector = rightunit(first(sectors(S)))
186-
return spacetype(S)(sector => 1)
185+
sector = rightunit(first(sectors(V)))
186+
return spacetype(V)(sector => 1)
187187
end
188188
end
189189

190190
"""
191-
isunitspace(S::ElementarySpace) -> Bool
191+
isunitspace(V::S) where {S <: ElementarySpace} -> Bool
192192
193-
Return whether the elementary space `S` is a unit space, i.e. is isomorphic to the
193+
Return whether the elementary space `V` is a unit space, i.e. is isomorphic to the
194194
trivial one-dimensional space. For vector spaces of type `GradedSpace{I}` where `Sector` `I` has a
195-
semi-simple unit structure, this returns `true` if `S` is isomorphic to either the left, right or
195+
semi-simple unit structure, this returns `true` if `V` is isomorphic to either the left, right or
196196
semi-simple unit space.
197197
"""
198-
function isunitspace(S::ElementarySpace) #TODO: add tests for this
199-
I = sectortype(S)
198+
function isunitspace(V::ElementarySpace) #TODO: add tests for this
199+
I = sectortype(V)
200200
return if isa(UnitStyle(I), SimpleUnit)
201-
isisomorphic(S, unitspace(S))
201+
isisomorphic(V, unitspace(V))
202202
else
203203
try
204-
isisomorphic(S, unitspace(S)) ||
205-
isisomorphic(S, leftunitspace(S)) ||
206-
isisomorphic(S, rightunitspace(S))
204+
isisomorphic(V, unitspace(V)) ||
205+
isisomorphic(V, leftunitspace(V)) ||
206+
isisomorphic(V, rightunitspace(V))
207207
catch e
208208
if isa(e, ArgumentError)
209209
return false

0 commit comments

Comments
 (0)