Skip to content

Commit e48e672

Browse files
committed
add deprecation warnings and some final fixes
1 parent 7c7f9f9 commit e48e672

File tree

4 files changed

+35
-30
lines changed

4 files changed

+35
-30
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TensorKit"
22
uuid = "07d1fe3e-3e46-537d-9eac-e9e13d0d4cec"
33
authors = ["Jutho Haegeman"]
4-
version = "1.0.0-DEV"
4+
version = "0.13"
55

66
[deps]
77
LRUCache = "8ac3fa9e-de4c-5943-b1dc-09c6b5f20637"

docs/src/man/sectors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ collect(fusiontrees((s2,s2,s2,s2)))
979979
Note that `FusionTree` instances are shown (printed) in a way that is valid code to
980980
reproduce them, a property which also holds for both instances of `Sector` and instances of
981981
`VectorSpace`. All of those should be displayed in a way that can be copy pasted as valid
982-
code. Furthermore, we use contact to determine how to print e.g. a sector. In isolation,
982+
code. Furthermore, we use context to determine how to print e.g. a sector. In isolation,
983983
`s2` is printed as `(Irrep[SU₂](1/2) ⊠ Irrep[SU₂](1/2))`, however, within the fusion tree,
984984
it is simply printed as `(1/2, 1/2)`, because it will be converted back into a
985985
`ProductSector`, namely `Irrep[SU₂] ⊠ Irrep[SU₂]` by the constructor of

src/auxiliary/deprecate.jl

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,41 @@
11
import Base: transpose
22

33
#! format: off
4-
@deprecate permute(t::AbstractTensorMap, p1::IndexTuple, p2::IndexTuple; copy::Bool=false) permute(t, (p1, p2); copy=copy)
5-
@deprecate transpose(t::AbstractTensorMap, p1::IndexTuple, p2::IndexTuple; copy::Bool=false) transpose(t, (p1, p2); copy=copy)
6-
@deprecate braid(t::AbstractTensorMap, p1::IndexTuple, p2::IndexTuple, levels; copy::Bool=false) braid(t, (p1, p2), levels; copy=copy)
4+
Base.@deprecate(permute(t::AbstractTensorMap, p1::IndexTuple, p2::IndexTuple; copy::Bool=false),
5+
permute(t, (p1, p2); copy=copy))
6+
Base.@deprecate(transpose(t::AbstractTensorMap, p1::IndexTuple, p2::IndexTuple; copy::Bool=false),
7+
transpose(t, (p1, p2); copy=copy))
8+
Base.@deprecate(braid(t::AbstractTensorMap, p1::IndexTuple, p2::IndexTuple, levels; copy::Bool=false),
9+
braid(t, (p1, p2), levels; copy=copy))
710

8-
import LinearAlgebra: svd, svd!
11+
Base.@deprecate(tsvd(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...),
12+
tsvd(t, (p₁, p₂); kwargs...))
13+
Base.@deprecate(leftorth(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...),
14+
leftorth(t, (p₁, p₂); kwargs...))
15+
Base.@deprecate(rightorth(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...),
16+
rightorth(t, (p₁, p₂); kwargs...))
17+
Base.@deprecate(leftnull(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...),
18+
leftnull(t, (p₁, p₂); kwargs...))
19+
Base.@deprecate(rightnull(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...),
20+
rightnull(t, (p₁, p₂); kwargs...))
21+
Base.@deprecate(LinearAlgebra.eigen(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...),
22+
LinearAlgebra.eigen(t, (p₁, p₂); kwargs...), false)
23+
Base.@deprecate(eig(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...),
24+
eig(t, (p₁, p₂); kwargs...))
25+
Base.@deprecate(eigh(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...),
26+
eigh(t, (p₁, p₂); kwargs...))
927

10-
Base.@deprecate(svd(t::AbstractTensorMap, leftind::IndexTuple, rightind::IndexTuple;
11-
trunc::TruncationScheme=notrunc(), p::Real=2, alg::SVDAlg=SDD()),
12-
tsvd(t, (leftind, rightind); trunc=trunc, p=p, alg=alg))
13-
Base.@deprecate(svd(t::AbstractTensorMap;
14-
trunc::TruncationScheme=notrunc(), p::Real=2, alg::SVDAlg=SDD()),
15-
tsvd(t; trunc=trunc, p=p, alg=alg))
16-
Base.@deprecate(svd!(t::AbstractTensorMap;
17-
trunc::TruncationScheme=notrunc(), p::Real=2, alg::SVDAlg=SDD()),
18-
tsvd(t; trunc=trunc, p=p, alg=alg))
28+
for f in (:rand, :randn, :zeros, :ones)
29+
@eval begin
30+
Base.@deprecate TensorMap(::typeof($f), T::Type, P::HomSpace) $f(T, P)
31+
Base.@deprecate TensorMap(::typeof($f), P::HomSpace) $f(P)
32+
Base.@deprecate TensorMap(::typeof($f), T::Type, cod::TensorSpace, dom::TensorSpace) $f(T, P, cod, dom)
33+
Base.@deprecate TensorMap(::typeof($f), cod::TensorSpace, dom::TensorSpace) $f(cod, dom)
34+
Base.@deprecate Tensor(::typeof($f), T::Type, space::TensorSpace) $f(T, space)
35+
Base.@deprecate Tensor(::typeof($f), space::TensorSpace) $f(space)
36+
end
37+
end
1938

20-
# TODO: deprecate
21-
22-
tsvd(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...) = tsvd(t, (p₁, p₂); kwargs...)
23-
leftorth(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...) = leftorth(t, (p₁, p₂); kwargs...)
24-
rightorth(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...) = rightorth(t, (p₁, p₂); kwargs...)
25-
leftnull(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...) = leftnull(t, (p₁, p₂); kwargs...)
26-
rightnull(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...) = rightnull(t, (p₁, p₂); kwargs...)
27-
LinearAlgebra.eigen(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...) = LinearAlgebra.eigen(t, (p₁, p₂); kwargs...)
28-
eig(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...) = eig(t, (p₁, p₂); kwargs...)
29-
eigh(t::AbstractTensorMap, p₁::IndexTuple, p₂::IndexTuple; kwargs...) = eigh(t, (p₁, p₂); kwargs...)
39+
Base.@deprecate EuclideanProduct() EuclideanInnerProduct()
3040

3141
#! format: on

src/spaces/homspace.jl

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,6 @@ struct GlobalLRUCache <: CacheStyle end
158158

159159
function CacheStyle(I::Type{<:Sector})
160160
return GlobalLRUCache()
161-
# if FusionStyle(I) === UniqueFusion()
162-
# return TaskLocalCache{SectorDict{I,Any}}()
163-
# else
164-
# return GlobalCache()
165-
# end
166161
end
167162

168163
fusionblockstructure(W::HomSpace) = fusionblockstructure(W, CacheStyle(sectortype(W)))

0 commit comments

Comments
 (0)