Hi all,
I am trying to do the contraction
where H is an MPO and C and C dagger are fermionic annihilation / creation operators. My problem is I have to the contraction in this order. I cannot make an MPO from single C or C dagger operators because that would not preserve particle number and I am using symmetry preserving MPOs.
Whenever I tr to diligently do the above contraction using the apply function, I have run into a myriad of different issues. For instnace, I am pretty sure the contraction H c_n requires c_n to act on the right side or unprimed side of H. However, whenever I try to do this I run into so many issues with indices and primes. I have tried many things but it just seems to become a complicated mess. Any help is appreciated. Here is my current code.
O1 = op("C",siteinds(H,i),1)
O2 = swapprime(op("Cdag",siteinds(H,j),2), 0 => 2)
println(O2)
println(siteinds(H,j))
tmp1 = apply(O2,H)
tmp1 = swapprime(tmp1, 2=>0)
tmp2 = apply(O1,tmp1)
value = tr(apply(Hdag, tmp2))
Right now I get the error: ERROR: In product, must have common indices with prime level 0.
This is frustrating because I dont know how else to multiply the operator on the right of my MPO, H.
It seems most of my trouble is figuring out how to right multiply an MPO