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
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ MPSKitAdaptExt = "Adapt"
[compat]
Accessors = "0.1"
Adapt = "4"
BlockTensorKit = "0.3.11"
BlockTensorKit = "0.3.14"
Compat = "3.47, 4.10"
DocStringExtensions = "0.9.3"
HalfIntegers = "1.6.0"
Expand All @@ -49,7 +49,7 @@ OptimKit = "0.3.1, 0.4"
Printf = "1"
Random = "1"
RecipesBase = "1.1"
TensorKit = "0.16.5"
TensorKit = "0.17"
TensorKitManifolds = "0.7, 0.8"
TensorOperations = "5.5.1"
TimerOutputs = "0.5.29"
Expand Down
2 changes: 1 addition & 1 deletion src/MPSKit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ using Compat: @compat
# Imports
# -------
using TensorKit
using TensorKit: BraidingTensor
using TensorKit: BraidingTensor, promote_storagetype
using TensorKit: TupleTools as TT
using MatrixAlgebraKit
using MatrixAlgebraKit: TruncationStrategy
Expand Down
8 changes: 5 additions & 3 deletions src/operators/abstractmpo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,10 @@ function _fuse_mpo_mpo(O1::MPOTensor, O2::MPOTensor, Fₗ, Fᵣ)
return if O1 isa BraidingTensor && O2 isa BraidingTensor
# shouldn't happen
T = promote_type(scalartype(O1), scalartype(O2))
A = promote_storagetype(T, O1, O2)
V = fuse(left_virtualspace(O2) ⊗ left_virtualspace(O1)) ⊗ physicalspace(O1) ←
physicalspace(O2) ⊗ fuse(right_virtualspace(O2) ⊗ right_virtualspace(O1))
return BraidingTensor{T}(V)
return BraidingTensor{T, spacetype(V), A}(V)
elseif O1 isa BraidingTensor
@plansor O′[-1 -2; -3 -4] := Fₗ[-1; 1 2] * O2[1 3; -3 5] *
τ[2 -2; 3 4] * conj(Fᵣ[-4; 5 4])
Expand All @@ -159,9 +160,10 @@ function fuse_mul_mpo(O1, O2)
end
function fuse_mul_mpo(O1::BraidingTensor, O2::BraidingTensor)
T = promote_type(scalartype(O1), scalartype(O2))
A = promote_storagetype(T, O1, O2)
V = fuse(left_virtualspace(O2) ⊗ left_virtualspace(O1)) ⊗ physicalspace(O1) ←
physicalspace(O2) ⊗ fuse(right_virtualspace(O2) ⊗ right_virtualspace(O1))
return BraidingTensor{T}(V)
return BraidingTensor{T, spacetype(V), A}(V)
end
function fuse_mul_mpo(
O1::AbstractBlockTensorMap{T₁, S, 2, 2}, O2::AbstractBlockTensorMap{T₂, S, 2, 2}
Expand Down Expand Up @@ -198,7 +200,7 @@ function add_physical_charge(O::BraidingTensor, charge::Sector)
auxspace = Vect[typeof(charge)](charge => 1)'
V = left_virtualspace(O) ⊗ fuse(physicalspace(O), auxspace) ←
fuse(physicalspace(O), auxspace) ⊗ right_virtualspace(O)
return BraidingTensor{scalartype(O)}(V)
return BraidingTensor{scalartype(O), spacetype(O), storagetype(O)}(V)
end
function add_physical_charge(O::AbstractBlockTensorMap{<:Any, <:Any, 2, 2}, charge::Sector)
sectortype(O) == typeof(charge) || throw(SectorMismatch())
Expand Down
8 changes: 4 additions & 4 deletions src/operators/jordanmpotensor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ end

const JordanMPOTensorMap{T, S, A <: DenseVector{T}} = JordanMPOTensor{
T, S,
Union{TensorMap{T, S, 2, 2, A}, BraidingTensor{T, S}},
Union{TensorMap{T, S, 2, 2, A}, BraidingTensor{T, S, A}},
TensorMap{T, S, 2, 1, A},
TensorMap{T, S, 1, 2, A},
TensorMap{T, S, 1, 1, A},
Expand Down Expand Up @@ -124,7 +124,7 @@ end
function jordanmpotensortype(::Type{S}, ::Type{E}) where {S <: VectorSpace, E}
TA = tensormaptype(S, 2, 2, E)
T = scalartype(TA)
Tτ = BraidingTensor{T, S}
Tτ = BraidingTensor{T, S, storagetype(TA)}
TB = tensormaptype(S, 2, 1, E)
TC = tensormaptype(S, 1, 2, E)
TD = tensormaptype(S, 1, 1, E)
Expand Down Expand Up @@ -172,7 +172,7 @@ BlockTensorKit.issparse(W::JordanMPOTensor) = true
# Converters
# ----------
function BlockTensorKit.SparseBlockTensorMap(W::JordanMPOTensor)
τ = BraidingTensor{scalartype(W)}(eachspace(W)[1])
τ = BraidingTensor{scalartype(W), spacetype(W), storagetype(W)}(eachspace(W)[1])
W′ = SparseBlockTensorMap{AbstractTensorMap{scalartype(W), spacetype(W), 2, 2}}(
undef_blocks, space(W)
)
Expand Down Expand Up @@ -232,7 +232,7 @@ end
j = I[4]
if (size(W, 4) > 1 && i == 1 && j == 1) ||
(size(W, 1) > 1 && i == size(W, 1) && j == size(W, 4))
return BraidingTensor{scalartype(W)}(eachspace(W)[1])
return BraidingTensor{scalartype(W), spacetype(W), storagetype(W)}(eachspace(W)[1])
elseif i == 1 && j == size(W, 4)
return insertrightunit(insertleftunit(only(W.D), 1), 3)
elseif i == 1
Expand Down
8 changes: 4 additions & 4 deletions src/operators/mpohamiltonian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ function FiniteMPOHamiltonian{O}(W_mats::Vector{<:Matrix}) where {O <: JordanMPO
if v isa MPOTensor
W[I] = v
elseif !iszero(v)
τ = BraidingTensor{T}(eachspace(W)[I])
τ = BraidingTensor{T, spacetype(W), storagetype(W)}(eachspace(W)[I])
W[I] = isone(v) ? τ : τ * v
end
end
Expand Down Expand Up @@ -261,7 +261,7 @@ function InfiniteMPOHamiltonian{O}(W_mats::Vector{<:Matrix}) where {O <: MPOTens
if v isa MPOTensor
W[I] = v
elseif !iszero(v)
τ = BraidingTensor{T}(eachspace(W)[I])
τ = BraidingTensor{T, spacetype(W), storagetype(W)}(eachspace(W)[I])
W[I] = isone(v) ? τ : τ * v
end
end
Expand Down Expand Up @@ -477,7 +477,7 @@ function FiniteMPOHamiltonian(lattice::AbstractArray{<:VectorSpace}, local_opera
key_R = key_R′ == 0 ? length(virtualsumspaces[site + 1]) : key_R′
O[key_L, 1, 1, key_R] += if o isa Number
iszero(o) && continue
τ = BraidingTensor{scalartype(TW)}(eachspace(O)[key_L, 1, 1, key_R])
τ = BraidingTensor{scalartype(TW), spacetype(TW), storagetype(TW)}(eachspace(O)[key_L, 1, 1, key_R])
isone(o) ? τ : τ * o
else
o
Expand Down Expand Up @@ -600,7 +600,7 @@ function InfiniteMPOHamiltonian(lattice′::AbstractArray{<:VectorSpace}, local_
key_R = key_R′ == 0 ? length(virtualspaces[site]) : key_R′
O[key_L, 1, 1, key_R] += if o isa Number
iszero(o) && continue
τ = BraidingTensor{scalartype(TW)}(eachspace(O)[key_L, 1, 1, key_R])
τ = BraidingTensor{scalartype(TW), spacetype(TW), storagetype(TW)}(eachspace(O)[key_L, 1, 1, key_R])
isone(o) ? τ : τ * o
else
o
Expand Down
4 changes: 2 additions & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ MPSKit = {path = ".."}

[compat]
Aqua = "0.8.9"
CUDA = "5.9"
CUDA = "6"
Combinatorics = "1"
ParallelTestRunner = "2"
Plots = "1.40"
Pkg = "1"
TensorKitTensors = "0.2"
Test = "1"
TestExtras = "0.3"
cuTENSOR = "2.3"
cuTENSOR = "6"
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ is_buildkite && filter!(startswith("gpu") ∘ first, testsuite)

# only run CUDA/cuTENSOR if available
using CUDA, cuTENSOR
(CUDA.functional() && cuTENSOR.has_cutensor()) ||
(CUDA.functional() && cuTENSOR.functional()) ||
filter!(!(startswith("gpu/cuda") ∘ first), testsuite)

# parse arguments
Expand Down
Loading