def mel(state1, state2): term = 0 for sigma in [-1, 1]: for i in range(N): for j in range(N): if (i != j and abs(i - j) == 1): s2 = bg.clonestate(state2) s2.move(i, j, sigma) termtemp = bg.innerproduct(state1, s2) term += termtemp return term
def mel(state1, state2): # calculate the hopping to right term = 0 for sigma in [-1, 1]: for i in range(N): for j in range(N): if (i != j and abs(i - j) == 1): s2 = bg.clonestate(state2) s2.move(i, j, sigma) termtemp = bg.innerproduct(state1, s2) # print(termtemp) term += termtemp return term