Setting specific values for part of a block-sparse (QN conserving) MPS

Hi,

I’m wondering if there’s a way to set value (in this case, fixing occupation level and correlations) for a part of a larger system, with block-sparse tensors.

For example, if I have a 100-site Fermionic system, but I would like to set the occupation on site 99 and 100 to be 0.7, 0.3:

I can maybe do something like this:

N = 100
s = siteinds("Fermion", N; conserve_qns = true)

psi1  :: MPS = some_operation(s)  
# here, some_operation is done such that expect(psi1, "N")[99] = 1.0, and 
# expect(psi1, "N")[100] = 0.0, which is easy to do

psi2 = copy(psi1)
psi = add( sqrt(0.7) * psi1, sqrt(0.3) * psi2)

But 1) AFAIK adding two MPS already involves a lot of approximation/truncation, and it’s not guaranteed to give me the correct result. 2) I’m very limited in setting other observables, for example if I need to set \langle c_{99}^{\dagger}c_{100}\rangle = 0.1 then I don’t know how.

Doing

psi1.data[1].tensor.storage.data = [sqrt(0.7), sqrt(0.3)]

won’t work because it’s immutable.

Is this even doable? it would be nice if I can generate a block-sparse tensor and replace sites 99 and 100 from a correlation matrix (in this case C = [0.7, 0.1; 0.1, 0.3]), but I’m not sure how it can be done

Ok after some thinking it seems to me summing the state can be the way to go, but I can actually just define an operator:

a = \cos{\theta} c^{\dagger}_1 + e^{i\phi}\sin{\theta}c^{\dagger}_2

and act on the empty sites.

and the thing about correlation matrix doesn’t really make sense so feel free to close the topic

Just as a comment, if it’s helpful. For non-interacting (“Gaussian”) fermionic states, there are some pretty sophisticated ways to create MPS which have correlations that are given by a specified correlation matrix. And this would include the occupation values which are just the diagonal entries of the correlation matrix.

We even have a package that helps with this, called ITensorGaussianMPS and you can see the paper that inspired this package at this link:
https://arxiv.org/abs/1504.07701