Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Printf = "1"
QuadGK = "2.11.1"
Random = "1"
Statistics = "1"
TensorKit = "0.14.6"
TensorKit = "0.14.9"
TensorOperations = "5"
TestExtras = "0.3"
VectorInterface = "0.4, 0.5"
Expand Down
3 changes: 0 additions & 3 deletions src/environments/ctmrg_environments.jl
Original file line number Diff line number Diff line change
Expand Up @@ -384,10 +384,7 @@ cornertype(::Type{CTMRGEnv{C,E}}) where {C,E} = C
edgetype(env::CTMRGEnv) = edgetype(typeof(env))
edgetype(::Type{CTMRGEnv{C,E}}) where {C,E} = E

TensorKit.spacetype(env::CTMRGEnv) = spacetype(typeof(env))
TensorKit.spacetype(::Type{E}) where {E<:CTMRGEnv} = spacetype(cornertype(E))
TensorKit.sectortype(env::CTMRGEnv) = sectortype(typeof(env))
TensorKit.sectortype(::Type{E}) where {E<:CTMRGEnv} = sectortype(cornertype(E))

# In-place update of environment
function update!(env::CTMRGEnv{C,T}, env´::CTMRGEnv{C,T}) where {C,T}
Expand Down
1 change: 1 addition & 0 deletions src/operators/infinitepepo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ end

## Spaces

TensorKit.spacetype(::Type{P}) where {P<:InfinitePEPO} = spacetype(eltype(P))
virtualspace(T::InfinitePEPO, r::Int, c::Int, h::Int, dir) = virtualspace(T[r, c, h], dir)
domain_physicalspace(T::InfinitePEPO, r::Int, c::Int) = domain_physicalspace(T[r, c, 1])
function codomain_physicalspace(T::InfinitePEPO, r::Int, c::Int)
Expand Down
3 changes: 0 additions & 3 deletions src/operators/localoperator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,6 @@ end

# Charge shifting
# ---------------
TensorKit.sectortype(O::LocalOperator) = sectortype(typeof(O))
TensorKit.sectortype(::Type{<:LocalOperator{T,S}}) where {T,S} = sectortype(S)
TensorKit.spacetype(O::LocalOperator) = spacetype(typeof(O))
TensorKit.spacetype(::Type{T}) where {S,T<:LocalOperator{<:Any,S}} = S

@generated function _fuse_isomorphisms(
Expand Down
1 change: 1 addition & 0 deletions src/states/infinitepartitionfunction.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ end

## Spaces

TensorKit.spacetype(::Type{T}) where {T<:InfinitePartitionFunction} = spacetype(eltype(T))
virtualspace(n::InfinitePartitionFunction, r::Int, c::Int, dir) = virtualspace(n[r, c], dir)

## InfiniteSquareNetwork interface
Expand Down
3 changes: 0 additions & 3 deletions src/states/infinitepeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ end

## Spaces

TensorKit.sectortype(t::InfinitePEPS) = sectortype(typeof(t))
TensorKit.sectortype(::Type{T}) where {T<:InfinitePEPS} = sectortype(eltype(T))
TensorKit.spacetype(t::InfinitePEPS) = spacetype(typeof(t))
TensorKit.spacetype(::Type{T}) where {T<:InfinitePEPS} = spacetype(eltype(T))
virtualspace(n::InfinitePEPS, r::Int, c::Int, dir) = virtualspace(n[r, c], dir)
physicalspace(n::InfinitePEPS, r::Int, c::Int) = physicalspace(n[r, c])
Expand Down
6 changes: 0 additions & 6 deletions src/states/infiniteweightpeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@ Base.axes(W::SUWeight, args...) = axes(W.data, args...)
Base.iterate(W::SUWeight, args...) = iterate(W.data, args...)

## spaces
TensorKit.spacetype(w::SUWeight) = spacetype(typeof(w))
TensorKit.spacetype(::Type{T}) where {E,T<:SUWeight{E}} = spacetype(E)
TensorKit.sectortype(w::SUWeight) = sectortype(typeof(w))
TensorKit.sectortype(::Type{<:SUWeight{T}}) where {T} = sectortype(spacetype(T))

## (Approximate) equality
function Base.:(==)(wts1::SUWeight, wts2::SUWeight)
Expand Down Expand Up @@ -216,10 +213,7 @@ function Base.size(peps::InfiniteWeightPEPS)
return size(peps.vertices)
end

TensorKit.spacetype(peps::InfiniteWeightPEPS) = spacetype(typeof(peps))
TensorKit.spacetype(::Type{T}) where {E,T<:InfiniteWeightPEPS{E}} = spacetype(E)
TensorKit.sectortype(peps::InfiniteWeightPEPS) = sectortype(typeof(peps))
TensorKit.sectortype(::Type{<:InfiniteWeightPEPS{T}}) where {T} = sectortype(spacetype(T))

function _absorb_weights(
t::PEPSTensor,
Expand Down
5 changes: 5 additions & 0 deletions test/ctmrg/partition_function.jl
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,11 @@ env0 = CTMRGEnv(Z, χenv)
ctm_styles = [:sequential, :simultaneous]
projector_algs = [:halfinfinite, :fullinfinite]

@test spacetype(typeof(Z)) === ComplexSpace
@test spacetype(Z) === ComplexSpace
@test sectortype(typeof(Z)) === Trivial
@test sectortype(Z) === Trivial

@testset "Classical Ising partition function using $alg with $projector_alg" for (
alg, projector_alg
) in Iterators.product(
Expand Down
5 changes: 5 additions & 0 deletions test/ctmrg/pepo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ projector_algs = [:halfinfinite, :fullinfinite]
n = InfiniteSquareNetwork(psi0, T)
env0 = CTMRGEnv(n, χenv)

@test spacetype(typeof(T)) === ComplexSpace
@test spacetype(T) === ComplexSpace
@test sectortype(typeof(T)) === Trivial
@test sectortype(T) === Trivial

@testset "PEPO CTMRG contraction using $alg with $projector_alg" for (
alg, projector_alg
) in Iterators.product(
Expand Down
Loading