Skip to content

Commit d76cb14

Browse files
committed
format
1 parent 97eea7e commit d76cb14

File tree

5 files changed

+32
-24
lines changed

5 files changed

+32
-24
lines changed

src/spaces/gradedspace.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ end
144144
Return the corresponding vector space of type `GradedSpace{I}` that represents the trivial
145145
one-dimensional space consisting of the left unit of the objects in `Sector` `I`.
146146
"""
147-
function leftunitspace(S::GradedSpace{I}) where {I<:Sector}
147+
function leftunitspace(S::GradedSpace{I}) where {I <: Sector}
148148
if UnitStyle(I) isa SimpleUnit
149149
return unitspace(typeof(S))
150150
else
@@ -163,7 +163,7 @@ end
163163
Return the corresponding vector space of type `GradedSpace{I}` that represents the trivial
164164
one-dimensional space consisting of the right unit of the objects in `Sector` `I`.
165165
"""
166-
function rightunitspace(S::GradedSpace{I}) where {I<:Sector}
166+
function rightunitspace(S::GradedSpace{I}) where {I <: Sector}
167167
if UnitStyle(I) isa SimpleUnit
168168
return unitspace(typeof(S))
169169
else
@@ -183,7 +183,7 @@ Return the corresponding vector space of type `GradedSpace{I}` that represents t
183183
space consisting of the unit(s) of the objects in `Sector` `I`. For `I` with simple unit,
184184
this is a one-dimensional space.
185185
"""
186-
function unitspace(S::Type{<:GradedSpace{I}}) where {I<:Sector}
186+
function unitspace(S::Type{<:GradedSpace{I}}) where {I <: Sector}
187187
return S(unit => 1 for unit in allunits(I))
188188
end
189189
zerospace(S::Type{<:GradedSpace}) = S()

src/spaces/productspace.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,10 @@ More specifically, adds a left monoidal unit or its dual.
256256
257257
See also [`insertrightunit`](@ref insertrightunit(::ProductSpace, ::Val{i}) where {i}), [`removeunit`](@ref removeunit(::ProductSpace, ::Val{i}) where {i}).
258258
"""
259-
function insertleftunit(P::ProductSpace, ::Val{i}=Val(length(P) + 1);
260-
conj::Bool=false, dual::Bool=false) where {i}
259+
function insertleftunit(
260+
P::ProductSpace, ::Val{i} = Val(length(P) + 1);
261+
conj::Bool = false, dual::Bool = false
262+
) where {i}
261263
N = length(P)
262264
I = sectortype(P)
263265
if UnitStyle(I) isa SimpleUnit
@@ -285,8 +287,10 @@ More specifically, adds a right monoidal unit or its dual.
285287
286288
See also [`insertleftunit`](@ref insertleftunit(::ProductSpace, ::Val{i}) where {i}), [`removeunit`](@ref removeunit(::ProductSpace, ::Val{i}) where {i}).
287289
"""
288-
function insertrightunit(P::ProductSpace, ::Val{i}=Val(length(P));
289-
conj::Bool=false, dual::Bool=false) where {i}
290+
function insertrightunit(
291+
P::ProductSpace, ::Val{i} = Val(length(P));
292+
conj::Bool = false, dual::Bool = false
293+
) where {i}
290294
N = length(P)
291295
I = sectortype(P)
292296
if UnitStyle(I) isa SimpleUnit

src/tensors/indexmanipulations.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,10 @@ If `copy=false`, `tdst` might share data with `tsrc` whenever possible. Otherwis
318318
See also [`insertrightunit`](@ref insertrightunit(::AbstractTensorMap, ::Val{i}) where {i}),
319319
[`removeunit`](@ref removeunit(::AbstractTensorMap, ::Val{i}) where {i}).
320320
"""
321-
function insertleftunit(t::AbstractTensorMap, ::Val{i}=Val(numind(t) + 1);
322-
copy::Bool=false, conj::Bool=false, dual::Bool=false) where {i}
321+
function insertleftunit(
322+
t::AbstractTensorMap, ::Val{i} = Val(numind(t) + 1);
323+
copy::Bool = false, conj::Bool = false, dual::Bool = false
324+
) where {i}
323325
W = insertleftunit(space(t), Val(i); conj, dual)
324326
if t isa TensorMap
325327
return TensorMap{scalartype(t)}(copy ? Base.copy(t.data) : t.data, W)
@@ -345,8 +347,10 @@ If `copy=false`, `tdst` might share data with `tsrc` whenever possible. Otherwis
345347
See also [`insertleftunit`](@ref insertleftunit(::AbstractTensorMap, ::Val{i}) where {i}),
346348
[`removeunit`](@ref removeunit(::AbstractTensorMap, ::Val{i}) where {i}).
347349
"""
348-
function insertrightunit(t::AbstractTensorMap, ::Val{i}=Val(numind(t));
349-
copy::Bool=false, conj::Bool=false, dual::Bool=false) where {i}
350+
function insertrightunit(
351+
t::AbstractTensorMap, ::Val{i} = Val(numind(t));
352+
copy::Bool = false, conj::Bool = false, dual::Bool = false
353+
) where {i}
350354
W = insertrightunit(space(t), Val(i); conj, dual)
351355
if t isa TensorMap
352356
return TensorMap{scalartype(t)}(copy ? Base.copy(t.data) : t.data, W)
@@ -371,7 +375,7 @@ If `copy=false`, `tdst` might share data with `tsrc` whenever possible. Otherwis
371375
This operation undoes the work of [`insertleftunit`](@ref insertleftunit(::AbstractTensorMap, ::Val{i}) where {i})
372376
and [`insertrightunit`](@ref insertrightunit(::AbstractTensorMap, ::Val{i}) where {i}).
373377
"""
374-
function removeunit(t::AbstractTensorMap, ::Val{i}; copy::Bool=false) where {i}
378+
function removeunit(t::AbstractTensorMap, ::Val{i}; copy::Bool = false) where {i}
375379
W = removeunit(space(t), Val(i))
376380
if t isa TensorMap
377381
return TensorMap{scalartype(t)}(copy ? Base.copy(t.data) : t.data, W)

test/setup.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -88,14 +88,14 @@ function random_fusiontree(I::Type{<:Sector}, N::Int) # for fusion tree tests
8888
in = nothing
8989
else
9090
rethrow(e)
91-
end
91+
end
9292
end
9393
end
9494
return out
9595
end
9696

9797
# for fusion tree merge test
98-
function safe_tensor_product(x::I, y::I) where {I<:Sector}
98+
function safe_tensor_product(x::I, y::I) where {I <: Sector}
9999
tp = x y
100100
if isempty(tp)
101101
return nothing
@@ -194,21 +194,21 @@ C0, C1 = IsingBimodule(1, 1, 0), IsingBimodule(1, 1, 1)
194194
D0, D1 = IsingBimodule(2, 2, 0), IsingBimodule(2, 2, 1)
195195
M, Mop = IsingBimodule(1, 2, 0), IsingBimodule(2, 1, 0)
196196
VIB_diag = (
197-
Vect[IsingBimodule](C0 => 1, C1 => 2),
198-
Vect[IsingBimodule](C0 => 2, C1 => 1),
199-
Vect[IsingBimodule](C0 => 3, C1 => 1),
200-
Vect[IsingBimodule](C0 => 2, C1 => 3),
201-
Vect[IsingBimodule](C0 => 3, C1 => 2)
197+
Vect[IsingBimodule](C0 => 1, C1 => 2),
198+
Vect[IsingBimodule](C0 => 2, C1 => 1),
199+
Vect[IsingBimodule](C0 => 3, C1 => 1),
200+
Vect[IsingBimodule](C0 => 2, C1 => 3),
201+
Vect[IsingBimodule](C0 => 3, C1 => 2),
202202
)
203203

204204
# not a random ordering! designed to make V1 ⊗ V2 ← V3 ⊗ V4 ⊗ V5 work (tensors)
205205
# while V1 ⊗ V2 ← V4 isn't empty (factorizations)
206206
VIB_M = (
207207
Vect[IsingBimodule](C0 => 1, C1 => 2),
208-
Vect[IsingBimodule](M => 3),
209-
Vect[IsingBimodule](C0 => 2, C1 => 3),
210-
Vect[IsingBimodule](M => 4),
211-
Vect[IsingBimodule](D0 => 3, D1 => 4)
208+
Vect[IsingBimodule](M => 3),
209+
Vect[IsingBimodule](C0 => 2, C1 => 3),
210+
Vect[IsingBimodule](M => 4),
211+
Vect[IsingBimodule](D0 => 3, D1 => 4),
212212
)
213213

214214
end

test/symmetries/fusiontrees.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ using .TestSetup
418418
else
419419
N = 4
420420
end
421-
421+
422422
out = random_fusiontree(I, N)
423423
numtrees = count(n -> true, fusiontrees((out..., map(dual, out)...)))
424424
while !(0 < numtrees < 100)

0 commit comments

Comments
 (0)