Applying an MPO to an MPS

Hi everyone,
I was applying an MPO to an MPS with quantum number conservation turned on, and I noticed that even though the MPO was only defined at sites n and n', the resultant MPS had values modified at sites neighboring n and n'. Below is a MWE i came up with

N = 10
sites = siteinds("S=1/2",N; conserve_qns=true)
state = [isodd(n) ? "Up" : "Dn" for n=1:N]
psi0 = randomMPS(sites,state; linkdims = 10)
os = OpSum()
os .+=  "S+" , 4, "S-" , 8
op1 = MPO(os, sites)
psinew = apply(op1,psi0; cutoff=1e-12)

E = expect(psi0,"Sz")
E1 = expect(psinew,"Sz")

If I plot E and E1, I can see that the expectation value for \langle S_z \rangle in the new state psinew changes values at every other site as well. But if I turn off quantum number conservation and do this same procedure, the MPO only modifies the \langle S_z \rangle at the sites in which it acts. Is this the expected behavior?
TIA!

Nice question – so you have kind of caught something a bit subtle here about the way randomMPS is implemented in ITensor, which we plan to improve soon.

The short answer to your question is that, because of some technical limitations which used to be present in some earlier versions, the randomMPS function in the QN-conserving case makes states which have strictly finite-range entanglement & correlations. So if you act on these with operators acting on two sites sufficiently far apart, you may not see any “spreading” of the influence of these operators (apart from just a local influence, as if you acted only one of them, but not the other, and averaged those changes classically).

We plan to unify the code for randomMPS for both the dense and QN cases, though, so that they make MPS with nearly the same type of properties.

Finally, to be picky about one thing you said, it’s not really correct to say that the MPO for an operator like `“S+”,4, “S-”, 8" is “not defined” at other sites besides n and n'. It is defined on all the sites, it’s just that it acts as the identity operator on the other sites. This is just a common abuse of notation in the quantum literature, that one typically omits operators which are just identities. In a very technical sense, we should really be writing operators like the above as

I_1 \otimes I_2 \otimes I_3 \otimes S^+_4 \otimes I_5 \otimes \cdots \otimes I_7 \otimes S^-_8 \otimes \cdots