I'm studying tJ model and using julia.

I want to calculate an overlap between the ground state |FP> obtained at maximum Sz sector with the ground state |GS> at minimum |Sz| sector (either 0 or 1/2). For simplicity, let's assume that the number of electrons, N, is even, so that we are comparing the ground states of Sz = N/2 and Sz = 0. The overlap can be written as @@< GS | (S^-)^{N/2} |FP>@@, where @@S^- = \sum_{i=1}^{Lx*Ly}S_i^-@@.

I want to conserve the quantum numbers "N" and "Sz", so I constructed sites as follows.

```
sites1 = siteinds("tJ", Lx; conserve_qns=true)
```

Then I computed ground state FP and GS at Sz = N/2 and Sz= 0 sector, respectively.

```
psi_init_maxSz = InitState_Sz(Lx, N, N/2 , sites1);
energy_FP, FP = dmrg(H, psi_init_maxSz, sweeps)
```

and

```
psi_init_minSz = InitState_Sz(Lx, N, (iseven(N) ? 0 : 1/2) , sites1);
energy_GS, GS = dmrg(H, psi_init_minSz, sweeps)
```

Now, since FP and GS are in different Sz sector, I removed QN conservation using dense() and constructed new sites 'sites2'.

```
FPstate_maxSz = dense(FP)
sites2 = siteinds(FPstate_maxSz)
GS_minSz = dense(GS)
```

Also, I built the following @@S^-@@ MPO.

```
function S_lowering(Lx,Ly, sites)
ampo = AutoMPO();
for i in 1:Lx*Ly
ampo += 1, "S-", i
end
return MPO(ampo, sites)
end
```

Finally, I performed the overlap calculation:

```
Slowering = S_lowering(Lx, 1, sites2);
for i in 1:div(N,2)
FPstate_maxSz = contract(Slowering, FPstate_maxSz)
end
overlap= abs(inner(GS_minSz, FPstate_maxSz))
```

However, the expression

```
FPstate_maxSz = contract(Slowering, FPstate_maxSz)
```

seems to cause infinite loop -- it doesn't stop so I have to force quit.

What is wrong with this and is there a better way to achieve my goal?

Thanks a lot in advance.