We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Description of bug
When I attempt to take the correlation matrix of the two Paulis X and Y, I get an InexactError
Minimal code demonstrating the bug
L = 4 ss = ITensorMPS.siteinds("S=1/2",L) ψ = MPS([state("Up", s) for s in ss]) correlation_matrix(ψ, "Y", "Z")
Curiously the same thing happens if I do ψ *= im to force the eltype of ψ's tensors to be complex.
ψ *= im
Expected output or behavior
I expect im on the diagonal
im
Actual output or behavior
InexactError: Float64(0.0 + 1.0im)
InexactError: Float64(0.0 + 1.0im) Stacktrace: [1] Real @ ./complex.jl:44 [inlined] [2] convert @ ./number.jl:7 [inlined] [3] setindex! @ ./genericmemory.jl:243 [inlined] [4] unsafe_copyto!(dest::Memory{Float64}, doffs::Int64, src::Memory{ComplexF64}, soffs::Int64, n::Int64) @ Base ./genericmemory.jl:153 [5] unsafe_copyto! @ ./genericmemory.jl:133 [inlined] [6] _copyto_impl! @ ./array.jl:308 [inlined] [7] copyto! @ ./array.jl:294 [inlined] [8] copyto! @ ./array.jl:319 [inlined] [9] copyto_axcheck! @ ./abstractarray.jl:1167 [inlined] [10] Array @ ./array.jl:626 [inlined] [11] Array @ ./boot.jl:606 [inlined] ... @ ITensorMPS ~/.julia/packages/ITensorMPS/jyjxG/src/mps.jl:907 [23] correlation_matrix(psi::MPS, _Op1::String, _Op2::String) @ ITensorMPS ~/.julia/packages/ITensorMPS/jyjxG/src/mps.jl:739 [24] top-level scope @ ~/work/2024-11-SHADOW/src/MatrixProductShadows/jl_notebook_cell_df34fa98e69747e1a8f8a730347b8e2f_W3sZmlsZQ==.jl:7
Version information
versioninfo()
julia> versioninfo() Julia Version 1.11.2 Commit 5e9a32e7af2 (2024-12-01 20:02 UTC) Build Info: Official https://julialang.org/ release Platform Info: OS: macOS (arm64-apple-darwin24.0.0) CPU: 8 × Apple M3 WORD_SIZE: 64 LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2) Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores) Environment: JULIA_NUM_THREADS =
using Pkg; Pkg.status("ITensors")
julia> using Pkg; Pkg.status("ITensors") [9136182c] ITensors v0.7.11 julia> using Pkg; Pkg.status("ITensorMPS") [0d1a4710] ITensorMPS v0.3.3
The text was updated successfully, but these errors were encountered:
Duplicate of ITensor/ITensorMPS.jl#79 (that issue started out as just about expect but it is the same issue in correlation_matrix and expect), see also https://itensor.discourse.group/t/correlation-matrix-of-complex-operators/584.
expect
correlation_matrix
I'll close this in favor of ITensor/ITensorMPS.jl#79, also not that in the future MPS/MPO-related issues should be raised at https://github.com/ITensor/ITensorMPS.jl/issues.
Sorry, something went wrong.
got it---thank you!
No branches or pull requests
Description of bug
When I attempt to take the correlation matrix of the two Paulis X and Y, I get an InexactError
Minimal code demonstrating the bug
Minimal runnable code
Curiously the same thing happens if I do
ψ *= im
to force the eltype of ψ's tensors to be complex.Expected output or behavior
I expect
im
on the diagonalActual output or behavior
InexactError: Float64(0.0 + 1.0im)
Output of minimal runnable code
Version information
versioninfo()
:using Pkg; Pkg.status("ITensors")
:The text was updated successfully, but these errors were encountered: