Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix isnothing #18

Merged
merged 1 commit into from
Mar 20, 2024
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
9 changes: 9 additions & 0 deletions src/contractions/site.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/contractions/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/transfer.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down
Loading