ITensor / ITensor/ITensorMPS.jl
Issue running Trotter-Suzuki example
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 85
- Forks
- 27
- Avg merge
- 22m
- Merged PRs (30d)
- 1
Description
Dear ITensors developers, I hope you are doing well!
I ran into an issue with one of the examples trotter_suzuki_decomposition.py.
$ julia trotter_suzuki_decomposition.jl
ERROR: LoadError: You are trying to add an ITensor with indices:
((dim=2|id=657|"S=1/2,Site,n=2")', (dim=2|id=657|"S=1/2,Site,n=2"), (dim=2|id=902|"S=1/2,Site,n=3")', (dim=2|id=902|"S=1/2,Site,n=3"))
into an ITensor with indices:
((dim=2|id=640|"S=1/2,Site,n=1")', (dim=2|id=640|"S=1/2,Site,n=1"), (dim=2|id=657|"S=1/2,Site,n=2")', (dim=2|id=657|"S=1/2,Site,n=2"))
but the indices are not permutations of each other.
Stacktrace:
[1] error(s::String)
@ Base ./error.jl:35
[2] _map!!(f::Function, R::NDTensors.DenseTensor{Float64, 4, NTuple{4, Index{Int64}}, NDTensors.Dense{Float64, Vector{Float64}}}, T1::NDTensors.DenseTensor{Float64, 4, NTuple{4, Index{Int64}}, NDTensors.Dense{Float64, Vector{Float64}}}, T2::NDTensors.DenseTensor{Float64, 4, NTuple{4, Index{Int64}}, NDTensors.Dense{Float64, Vector{Float64}}})
@ ITensors ~/.julia/packages/ITensors/GkEpm/src/itensor.jl:1884
[3] map!(f::Function, R::ITensor, T1::ITensor, T2::ITensor)
@ ITensors ~/.julia/packages/ITensors/GkEpm/src/itensor.jl:1910
[4] copyto!
@ ~/.julia/packages/ITensors/GkEpm/src/broadcast.jl:310 [inlined]
[5] materialize!
@ ./broadcast.jl:878 [inlined]
[6] materialize!
@ ./broadcast.jl:875 [inlined]
[7] _add(A::NDTensors.DenseTensor{Float64, 4, NTuple{4, Index{Int64}}, NDTensors.Dense{Float64, Vector{Float64}}}, B::NDTensors.DenseTensor{Float64, 4, NTuple{4, Index{Int64}}, NDTensors.Dense{Float64, Vector{Float64}}})
@ ITensors ~/.julia/packages/ITensors/GkEpm/src/itensor.jl:1806
[8] +(A::ITensor, B::ITensor)
@ ITensors ~/.julia/packages/ITensors/GkEpm/src/itensor.jl:1814
[9] ITensor(o::Sum{Scaled{Float64, Prod{Op}}}, s::Vector{Index{Int64}})
@ ITensors.ITensorsOpsExt ~/.julia/packages/ITensors/GkEpm/src/lib/ITensorsOpsExt/src/ITensorsOpsExt.jl:41
[10] main(N::Int64; nsteps::Int64, order::Int64)
@ Main ~/trotter_suzuki_decomposition.jl:20
[11] macro expansion
@ show.jl:1229 [inlined]
[12] top-level scope
@ ~/trotter_suzuki_decomposition.jl:27
in expression starting at /home/nktastr_google_com/trotter_suzuki_decomposition.jl:27
Do you have an idea what could have gone wrong? Using the CUDA.jl backend. Thank you very much!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The report identifies the trotter_suzuki_decomposition.jl example and a failure at line 20 while using the CUDA.jl backend. Start by reproducing the example with that backend and inspect the index mismatch in the stack trace; done means the example runs without the ITensor index error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100