You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
variance() throws SpaceMismatch for real-scalartype long-range InfiniteMPOHamiltonian #524
variance(::InfiniteMPS, ::InfiniteMPOHamiltonian) throws a SpaceMismatch when the Hamiltonian is real-scalartype and has a long-range (non-nearest-neighbour) term, while the state is complex-scalartype.
Reproduction
using MPSKit, TensorKit
using TensorKit: ℙ
g, D, L =4.0, 6, 3
H =force_planar(long_range_ising_infinite(Float64; g, L)) # or any real, long-range InfiniteMPOHamiltonian
ψ₀ =InfiniteMPS(fill(ℙ^2, L), fill(ℙ^D, L))
variance(ψ₀, H) # throws
(long_range_ising_infinite/force_planar are test helpers from test/setup/testsetup.jl; any real, long-range InfiniteMPOHamiltonian combined with a complex state should reproduce this.)
variance computes something like ⟨H²⟩ - ⟨H⟩² and ends up subtracting two InfiniteMPOHamiltonians: one built by squaring H (which ends up complex, presumably promoted through contraction with the complex environments/state) and one derived from H itself (real). The two InfiniteMPOHamiltonians' shared virtual leg (a SumSpace) end up with a different number of blocks (3 vs 2) once the long-range (1, L) coupling is included, so the elementwise +/- on their JordanMPOTensors hits a genuine structural SpaceMismatch, not just a scalartype-promotion issue.
This reproduces independent of find_groundstate/any optimization algorithm — it's purely in variance's own Hamiltonian arithmetic for long-range + real/complex-mismatched combinations.
Context
Found while adding long-range Hamiltonian coverage to test/groundstate/groundstate.jl in #493. The affected checks there are marked @test_broken referencing this issue.
Activity
Fold long-range Hamiltonian coverage into groundstate.jl model/algori…
Fix `variance` SpaceMismatch for mixed-scalartype `MPOHamiltonian`s (#…
Fix `variance` SpaceMismatch for mixed-scalartype `MPOHamiltonian`s (#…
Fix `variance` SpaceMismatch for mixed-scalartype `MPOHamiltonian`s (#…
Fold long-range Hamiltonian coverage into groundstate.jl model/algori…
Tests for Hamiltonian derivatives and long-range models (#493)