Open
Description
Description of bug
Using complex operator on real MPS in expect
is throwing InexactError. I think the issue is coming from a function adapt
which may be trying to convert the operator to a real-valued operator, which is possibly incorrect logic for that code since contraction of a complex operator with a real MPS is allowed.
Minimal code demonstrating the bug or unexpected behavior
Minimal runnable code
N = 10
s = siteinds("S=1/2",N)
psi = randomMPS(s,linkdims=4)
vals = expect(psi,"Sy")
Version information
- Output from
versioninfo()
:
julia> versioninfo()
Julia Version 1.8.2
Commit 36034abf260 (2022-09-29 15:21 UTC)
Platform Info:
OS: macOS (arm64-apple-darwin21.3.0)
CPU: 10 × Apple M1 Max
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, apple-m1)
Threads: 1 on 8 virtual cores
Environment:
JULIA_DIR = /Applications/Julia-1.8.app/Contents/Resources/julia
- Output from
using Pkg; Pkg.status("ITensors")
:
julia> using Pkg; Pkg.status("ITensors")
Status `~/.julia/environments/v1.8/Project.toml`
[9136182c] ITensors v0.3.20 `~/.julia/dev/ITensors`