QuEraComputing / Bloqade.jl

Package for the quantum computation and quantum simulation based on the neutral-atom architecture.
https://queracomputing.github.io/Bloqade.jl/dev/
Other
181 stars 35 forks source link

ERROR: ArgumentError: row indices I[k] must satisfy 1 <= I[k] <= m #16

Open Roger-luo opened 3 years ago

Roger-luo commented 3 years ago

now sure why yet, when creating hamiltonian matrix for 8x8 graph

julia> H = @time SparseMatrixCSC(h, space)
ERROR: ArgumentError: row indices I[k] must satisfy 1 <= I[k] <= m
Stacktrace:
 [1] sparse!(I::Vector{Int64}, J::Vector{Int64}, V::Vector{ComplexF64}, m::Int64, n::Int64, combine::typeof(+), klasttouch::Vector{Int64}, csrrowptr::Vector{Int64}, csrcolval::Vector{Int64}, csrnzval::Vector{ComplexF64}, csccolptr::Vector{Int64}, cscrowval::Vector{Int64}, cscnzval::Vector{ComplexF64})
   @ SparseArrays /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/SparseArrays/src/sparsematrix.jl:839
 [2] sparse(I::Vector{Int64}, J::Vector{Int64}, V::Vector{ComplexF64}, m::Int64, n::Int64, combine::Function)
   @ SparseArrays /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/SparseArrays/src/sparsematrix.jl:767
 [3] sparse
   @ /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/SparseArrays/src/sparsematrix.jl:956 [inlined]
 [4] SparseMatrixCSC
   @ ~/.julia/packages/LuxurySparse/hjOQ4/src/conversions.jl:34 [inlined]
 [5] (SparseMatrixCSC{ComplexF64, Ti} where Ti<:Integer)(term::Hamiltonian{Tuple{RydInteract{Float64, StaticArrays.SVector{40, RydAtom{2, Int64}}}, XTerm{Float64, Nothing}, NTerm{Float64}}}, s::Subspace{Vector{Int64}})
   @ RydbergEmulator ~/.julia/packages/RydbergEmulator/8CXgB/src/hamiltonian.jl:488
 [6] SparseMatrixCSC(term::Hamiltonian{Tuple{RydInteract{Float64, StaticArrays.SVector{40, RydAtom{2, Int64}}}, XTerm{Float64, Nothing}, NTerm{Float64}}}, xs::Subspace{Vector{Int64}})
   @ RydbergEmulator ~/.julia/packages/RydbergEmulator/8CXgB/src/hamiltonian.jl:491
 [7] top-level scope
   @ ./timing.jl:210 [inlined]
 [8] top-level scope
   @ ./REPL[24]:0
Roger-luo commented 3 years ago

This seems to be a very strange bug, I cannot reproduce this on EC2 instances. Might because my laptop RAM is broken?

Adding assertions on this bound on every indices we generate in to_matrix! doesn't raise any error