I have an operator which is the summation of the annihilation operator of fermions and each term in the summation has a different coefficient.

= \sum a_{i}* c_{i, \up}

since we should consider the Jordan Wigner string, it is not possible to use the onsite function so I try to construct the MPO in the following way.

(i= 1: W =[Cu , JW]

1< i<L : W = [ [Id, 0] , [Cu , JW] ]

i=L : W =[ [Id , Cu] ] )

Code: Select all

```
def test_MPO():
deltax= 0.05 ; Kf = 0.0 ; J0= 5 ; K0 =0.0
gauss_coef = []
for j in range(L):
abc = (-((j-J0)**2) / (2.0 * deltax)) + 1j*K0*j*np.pi
gauss_coef.append(np.exp(abc))
s = SpinHalfFermionSite (cons_N="N", cons_Sz="Sz",filling=1.0)
for i in range(L):
W_grid = [[s.Id , None], [ (gauss_coef[i])* s.Cu , s.JW ]]
legW = npc.LegCharge.from_qflat(s.leg.chinfo, [ s.Cu.qtotal, s.JW.qtotal])
W = npc.grid_outer( W_grid, [legW, legW.conj()], grid_labels=['wL', 'wR'])
Ws = [W] * L
Ws[0] = W[-1:, :]
Ws[-1] = W[:, :1]
#for i in range(L):
#print('Ws[',i,']=' , Ws[i])
WP = mpo.MPO([s] * L, Ws, bc='finite', IdL=[0] * L + [None], IdR=[None] + [-1] * (L))
return( WP)
MM1 = test_MPO()
Excited = MM1.apply(phi, options={'compression_method':'SVD', 'trunc_params':{'svd_min': 1.0-10, 'trunc_cut': None, 'verbose': 0} })
print('updated state=',Excited)
```

And instead of an updated MPS I get this: updated state= TruncationError(eps=2.8725e-07, ov=0.9999994255)

Can you please let me know why I can not use the apply function in this case?

thanks