I have obtained the operators \(b_{i}^{\dagger}; b_{i+1}\) using
Python: Select all
ops = ['Bd'] * model_params['L']
Python: Select all
opss=['B']*model_params['L']
And to find \(N_a\) I wrote
Python: Select all
def Na(psi):
K = 0.0
L = psi.L
for i in range(L - 1):
corr = psi.correlation_function("Bd", "B",
sites1=[i],
sites2=[i + 1])[0, 0]
K += corr
return K.real
K = Na(psi)