Skip to content

Commit 9e718a2

Browse files
committed
renamings from TensorKit v0.15 + incoming renamings
1 parent 8fda727 commit 9e718a2

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

src/bimodulesector.jl

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -184,22 +184,22 @@ function extract_dual(::Type{I}) where {I <: BimoduleSector}
184184
return Is, allduals
185185
end
186186

187-
function Base.one(a::BimoduleSector)
187+
function TensorKitSectors.unit(a::BimoduleSector)
188188
a.i == a.j || throw(DomainError("unit of module category ($(a.i), $(a.j)) of $(typeof(a)) is ill-defined"))
189189
return typeof(a)(a.i, a.i, _get_dual_cache(typeof(a))[1][a.i])
190190
end
191191

192-
Base.isone(a::BimoduleSector) = leftone(a) == a == rightone(a)
192+
# Base.isone(a::BimoduleSector) = leftone(a) == a == rightone(a)
193193

194-
function Base.one(::Type{<:BimoduleSector})
194+
function TensorKitSectors.unit(::Type{<:BimoduleSector})
195195
throw(ArgumentError("one of Type BimoduleSector doesn't exist"))
196196
end
197197

198-
function TensorKitSectors.leftone(a::BimoduleSector)
198+
function TensorKitSectors.leftunit(a::BimoduleSector)
199199
return typeof(a)(a.i, a.i, _get_dual_cache(typeof(a))[1][a.i])
200200
end
201201

202-
function TensorKitSectors.rightone(a::BimoduleSector)
202+
function TensorKitSectors.rightunit(a::BimoduleSector)
203203
return typeof(a)(a.j, a.j, _get_dual_cache(typeof(a))[1][a.j])
204204
end
205205

@@ -345,8 +345,8 @@ function TensorKit.fuse(V₁::GradedSpace{I}, V₂::GradedSpace{I}) where {I<:Bi
345345
return typeof(V₁)(dims)
346346
end
347347

348-
# limited oneunit
349-
function Base.oneunit(S::GradedSpace{<:BimoduleSector})
348+
# limited unitspace
349+
function TensorKit.unitspace(S::GradedSpace{<:BimoduleSector})
350350
allequal(a.i for a in sectors(S)) && allequal(a.j for a in sectors(S)) ||
351351
throw(ArgumentError("sectors of $S are not all equal"))
352352
first(sectors(S)).i == first(sectors(S)).j ||
@@ -355,44 +355,44 @@ function Base.oneunit(S::GradedSpace{<:BimoduleSector})
355355
return spacetype(S)(sector => 1)
356356
end
357357

358-
function Base.oneunit(S::SumSpace{<:GradedSpace{<:BimoduleSector}})
358+
function TensorKit.unitspace(S::SumSpace{<:GradedSpace{<:BimoduleSector}})
359359
@assert !isempty(S) "Cannot determine type of empty space"
360360
return SumSpace(oneunit(first(S.spaces))) # assuming diagonal SumSpace (like in MPSKit)
361361
end
362362

363363
# oneunit for spaces whose elements all belong to the same sector
364-
function rightoneunit(S::GradedSpace{<:BimoduleSector})
364+
function rightunitspace(S::GradedSpace{<:BimoduleSector})
365365
allequal(a.j for a in sectors(S)) ||
366-
throw(ArgumentError("sectors of $S do not have the same rightone"))
366+
throw(ArgumentError("sectors of $S do not have the same rightunit"))
367367

368-
sector = rightone(first(sectors(S)))
368+
sector = rightunit(first(sectors(S)))
369369
return spacetype(S)(sector => 1)
370370
end
371371

372-
function rightoneunit(S::SumSpace{<:GradedSpace{<:BimoduleSector}})
372+
function rightunitspace(S::SumSpace{<:GradedSpace{<:BimoduleSector}})
373373
@assert !isempty(S) "Cannot determine type of empty space"
374-
return SumSpace(rightoneunit(first(S.spaces)))
374+
return SumSpace(rightunitspace(first(S.spaces)))
375375
end
376376

377-
function leftoneunit(S::GradedSpace{<:BimoduleSector})
377+
function leftunitspace(S::GradedSpace{<:BimoduleSector})
378378
allequal(a.i for a in sectors(S)) ||
379-
throw(ArgumentError("sectors of $S do not have the same leftone"))
379+
throw(ArgumentError("sectors of $S do not have the same leftunit"))
380380

381-
sector = leftone(first(sectors(S)))
381+
sector = leftunit(first(sectors(S)))
382382
return spacetype(S)(sector => 1)
383383
end
384384

385-
function leftoneunit(S::SumSpace{<:GradedSpace{<:BimoduleSector}})
385+
function leftunitspace(S::SumSpace{<:GradedSpace{<:BimoduleSector}})
386386
@assert !isempty(S) "Cannot determine type of empty space"
387-
return SumSpace(leftoneunit(first(S.spaces)))
387+
return SumSpace(leftunitspace(first(S.spaces)))
388388
end
389389

390-
function TensorKit.insertrightunit(P::ProductSpace{V,N}, ::Val{i};
390+
function TensorKit.insertrightunitspace(P::ProductSpace{V,N}, ::Val{i};
391391
conj::Bool=false,
392392
dual::Bool=false) where {i,V<:GradedSpace{I},N} where {I<:BimoduleSector}
393393
i > N && error("cannot insert a sensible right unit onto $P at index $(i+1)")
394-
# possible change to rightone of correct space for N = 0
395-
u = N > 0 ? rightoneunit(P[i]) : error("no unit object in $P")
394+
# possible change to rightunit of correct space for N = 0
395+
u = N > 0 ? rightunitspace(P[i]) : error("no unit object in $P")
396396
if dual
397397
u = TensorKit.dual(u)
398398
end
@@ -403,11 +403,11 @@ function TensorKit.insertrightunit(P::ProductSpace{V,N}, ::Val{i};
403403
end
404404

405405
# possible TODO: overwrite defaults at level of HomSpace and TensorMap?
406-
function TensorKit.insertleftunit(P::ProductSpace{V,N}, ::Val{i}; # want no defaults?
406+
function TensorKit.insertleftunitspace(P::ProductSpace{V,N}, ::Val{i}; # want no defaults?
407407
conj::Bool=false,
408408
dual::Bool=false) where {i,V<:GradedSpace{I},N} where {I<:BimoduleSector}
409409
i > N && error("cannot insert a sensible left unit onto $P at index $i") # do we want this to error in the diagonal case?
410-
u = N > 0 ? leftoneunit(P[i]) : error("no unit object in $P")
410+
u = N > 0 ? leftunitspace(P[i]) : error("no unit object in $P")
411411
if dual
412412
u = TensorKit.dual(u)
413413
end

0 commit comments

Comments
 (0)