ERROR: LoadError: UndefRefError: access to undefined reference
Stacktrace:
[1] getindex
@ ./essentials.jl:917 [inlined]
[2] getindex
@ ./subarray.jl:343 [inlined]
[3] _getindex
@ ./abstractarray.jl:1341 [inlined]
[4] getindex
@ ./abstractarray.jl:1312 [inlined]
[5] getindex
@ ~/.julia/packages/NDTensors/Q9Zpu/src/lib/Expose/src/functions/abstractarray.jl:6 [inlined]
[6] getindex
@ ~/.julia/packages/NDTensors/Q9Zpu/src/dense/densetensor.jl:93 [inlined]
[7] permutedims!(R::NDTensors.DenseTensor{BigFloat, 3, Tuple{Int64, Int64, Int64}, NDTensors.Dense{BigFloat, SubArray{BigFloat, 1, Vector{BigFloat}, Tuple{UnitRange{Int64}}, true}}}, T::NDTensors.DenseTensor{BigFloat, 3, Tuple{Int64, Int64, Int64}, NDTensors.Dense{BigFloat, SubArray{BigFloat, 1, Vector{BigFloat}, Tuple{UnitRange{Int64}}, true}}}, perm::Tuple{Int64, Int64, Int64}, f::NDTensors.var"#170#173")
@ NDTensors ~/.julia/packages/NDTensors/Q9Zpu/src/dense/densetensor.jl:260
[8] permutedims!(R::NDTensors.BlockSparseTensor{BigFloat, 3, Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}}, NDTensors.BlockSparse{BigFloat, Vector{BigFloat}, 3}}, T::NDTensors.BlockSparseTensor{BigFloat, 3, Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}}, NDTensors.BlockSparse{BigFloat, Vector{BigFloat}, 3}}, perm::Tuple{Int64, Int64, Int64}, f::NDTensors.var"#170#173")
@ NDTensors ~/.julia/packages/NDTensors/Q9Zpu/src/blocksparse/blocksparsetensor.jl:830
[9] permutedims!
@ ~/.julia/packages/NDTensors/Q9Zpu/src/blocksparse/blocksparsetensor.jl:801 [inlined]
[10] permutedims(T::NDTensors.BlockSparseTensor{BigFloat, 3, Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}}, NDTensors.BlockSparse{BigFloat, Vector{BigFloat}, 3}}, perm::Tuple{Int64, Int64, Int64})
@ NDTensors ~/.julia/packages/NDTensors/Q9Zpu/src/blocksparse/blocksparsetensor.jl:439
[11] permutedims
@ ~/.julia/packages/ITensors/AOPBm/src/tensor_operations/permutations.jl:64 [inlined]
[12] _permute(as::NDTensors.NeverAlias, T::NDTensors.BlockSparseTensor{BigFloat, 3, Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}}, NDTensors.BlockSparse{BigFloat, Vector{BigFloat}, 3}}, new_inds::Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}})
@ ITensors ~/.julia/packages/ITensors/AOPBm/src/tensor_operations/permutations.jl:69
[13] permute(as::NDTensors.NeverAlias, T::ITensor, new_inds::Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}})
@ ITensors ~/.julia/packages/ITensors/AOPBm/src/tensor_operations/permutations.jl:73
[14] #permute#253
@ ~/.julia/packages/ITensors/AOPBm/src/tensor_operations/permutations.jl:54 [inlined]
[15] permute(T::ITensor, new_inds::Tuple{Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}, Index{Vector{Pair{QN, Int64}}}})
@ ITensors ~/.julia/packages/ITensors/AOPBm/src/tensor_operations/permutations.jl:38
[16] top-level scope
@ ~/research/2025/DMRG/test/test_bigfloat.jl:34
Description of bug
When permuting certain indices of ITensor, I find that for the sample code, as long as I change the type of elements in MPO/MPS from Float64 to BigFloat, the program fails.
I met this when doing DMRG with BigFloat, and the indices of MPO and MPS are needed to be permuted there. The minimal example was also reconstructed from there.
Minimal code demonstrating the bug or unexpected behavior
Minimal runnable code
Expected and actual output or behavior
I want to permute the indices of ITensor with QN, and the elements of it are BigFloat. However, the following error occurred when I ran the code above. I found that if I did not use the QN then the program will be fine, and if I use Float64 instead of BigFloat ( the commented out part in the example) there was not error too.
Besides, I have checked that using GenericLinearAlgebra does not make a difference.
Output of minimal runnable code
Version information
versioninfo():using Pkg; Pkg.status("ITensors"):