diff --git a/src/contractions/site.jl b/src/contractions/site.jl index 68c495f..5aadbd5 100644 --- a/src/contractions/site.jl +++ b/src/contractions/site.jl @@ -170,6 +170,15 @@ function contract_tensors43(M::SiteTensor{R,4}, B::Tensor{R,3}) where {R<:Real} @inbounds Bp = B[:, :, p4] .* reshape(M.loc_exp, 1, 1, :) @cast Bp[(x, y), z] := Bp[x, y, z] ip123 = SparseCSC(R, M.lp, M.projs[1], M.projs[2], M.projs[3], device) + @show nnz(ip123) + @show size(ip123) + @show size(Bp) + @show size(Bp') + @show typeof(Bp) + @show typeof(ip123) + @show typeof(Bp') + @show (sm1, sm2, sm3, sb1, sb2) + @show size(ip123 * Bp') out = reshape(ip123 * Bp', sm1, sm2, sm3, sb1, sb2) out = permutedims(out, (4, 1, 5, 3, 2)) reshape(out, sb1 * sm1, sb2 * sm3, sm2) diff --git a/src/contractions/sparse.jl b/src/contractions/sparse.jl index a20af83..fc58547 100644 --- a/src/contractions/sparse.jl +++ b/src/contractions/sparse.jl @@ -12,7 +12,7 @@ end # TODO shouldn't we have CSR format instead? function SparseCSC(::Type{R}, p::CuArray{Int64,1}; mp = nothing) where {R<:Real} n = length(p) - if mp == nothing + if isnothing(mp) mp = maximum(p) end cn = CuArray(1:n+1) # aux_cusparse(R, n) @@ -22,7 +22,7 @@ end function SparseCSC(::Type{R}, p::Vector{Int64}; mp = nothing) where {R<:Real} n = length(p) - if mp == nothing + if isnothing(mp) mp = maximum(p) end cn = collect(1:n) diff --git a/src/transfer.jl b/src/transfer.jl index 7fcac54..994266e 100644 --- a/src/transfer.jl +++ b/src/transfer.jl @@ -69,7 +69,7 @@ end -which_device(ten::Nothing) = Set() +which_device(::Nothing) = Set() which_device(ψ::Union{QMpo{T},QMps{T}}) where {T} = union(which_device.(values(ψ.tensors))...) which_device(ten::MpoTensor) =