Hi Aditya,
By the way, you can input and format Latex directly into posts on this forum. The way to do it is to use dollar signs $ to surround your Latex:
so
$$
H = \sum_{i,\sigma} J c^\dagger_{i\sigma} c_{i+1,\sigma} …
$$
turns into
H = \sum_{i,\sigma} J c^\dagger_{i\sigma} c_{i+1,\sigma} ...
etc.
I assume the notation \bar{\sigma} means that if \sigma=\uparrow then \bar{\sigma}=\downarrow and vice versa?
Here is how you can input that Hamiltonian to the ITensor OpSum system to make an MPO for it:
using ITensors
let
N = 10
J = 1.0
δJ = 0.1
X = 0.5
s = siteinds("Electron",N; conserve_nf=true)
os = OpSum()
for i=1:N-1
os += -(J+δJ*(-1)^i),"Cdagup",i,"Cup",i+1
os += -(J+δJ*(-1)^i),"Cdagup",i+1,"Cup",i
os += -(J+δJ*(-1)^i),"Cdagdn",i,"Cdn",i+1
os += -(J+δJ*(-1)^i),"Cdagdn",i+1,"Cdn",i
os += -X*(J+δJ*(-1)^i),"Ndn",i,"Cdagup",i,"Cup",i+1
os += -X*(J+δJ*(-1)^i),"Ndn",i,"Cdagup",i+1,"Cup",i
os += -X*(J+δJ*(-1)^i),"Nup",i,"Cdagdn",i,"Cdn",i+1
os += -X*(J+δJ*(-1)^i),"Nup",i,"Cdagdn",i+1,"Cdn",i
os += -X*(J+δJ*(-1)^i),"Ndn",i+1,"Cdagup",i,"Cup",i+1
os += -X*(J+δJ*(-1)^i),"Ndn",i+1,"Cdagup",i+1,"Cup",i
os += -X*(J+δJ*(-1)^i),"Nup",i+1,"Cdagdn",i,"Cdn",i+1
os += -X*(J+δJ*(-1)^i),"Nup",i+1,"Cdagdn",i+1,"Cdn",i
end
H = MPO(os,s)
return
end
Please look closely over the code above to verify that it is defined correctly to the best of your understanding, and most importantly please check any DMRG or other calculations you do with it against known results or on small systems to debug it and check that it’s correct.
As you can see the main trick needed is to multiply out all the terms and then you can input products of operators using our OpSum system, then “compile” an OpSum into an actual MPO.
Hope that helps!