Ok thanks, after I get the "manual" approach working I will try the AutoMPO approach.
Regarding the manual approach, I am uncertain how to get the correct priming on the operator indices. For instance, when I implemented the following (where psi is a ground state wavefunction ITensor):
Vector Cbow(N); // A vector of numbers
for(int j=1; j<= N; ++j)
Cbow(j-1) = (dag(prime(psi.A(j),Site,3))*prime(sites.op("Adagup",j),2)*prime(sites.op("F",j),1)*sites.op("Aup",j+1)*psi.A(j)).real();
println("bonding strength");
for(int j = 0; j < N; ++j)
printfln("%d %.10f",1+j,Cbow(j));
println();
I get the following output:
Tensor indices =
IQIndex(site=2,4,Site,51) <In>
(Emp 2,1,Site,811) (Sz=0,Nf=0)
(Up 2,1,Site,631) (Sz=1,Nf=1)
(Dn 2,1,Site,609) (Sz=-1,Nf=1)
(UpDn 2,1,Site,392) (Sz=0,Nf=2)
IQIndex(site=2,4,Site,51)' <Out>
(Emp 2,1,Site,811)' (Sz=0,Nf=0)
(Up 2,1,Site,631)' (Sz=1,Nf=1)
(Dn 2,1,Site,609)' (Sz=-1,Nf=1)
(UpDn 2,1,Site,392)' (Sz=0,Nf=2)
IQIndex(site=1,4,Site,867)' <In>
(Emp 1,1,Site,315)' (Sz=0,Nf=0)
(Up 1,1,Site,199)' (Sz=1,Nf=1)
(Dn 1,1,Site,83)' (Sz=-1,Nf=1)
(UpDn 1,1,Site,802)' (Sz=0,Nf=2)
IQIndex(site=1,4,Site,867) <Out>
(Emp 1,1,Site,315) (Sz=0,Nf=0)
(Up 1,1,Site,199) (Sz=1,Nf=1)
(Dn 1,1,Site,83) (Sz=-1,Nf=1)
(UpDn 1,1,Site,802) (Sz=0,Nf=2)
---------------------------------------------
Indices provided =
---------------------------------------------
From line 137, file /home/Jon/itensor/itensor/itensor_interface.ih
Wrong number of IndexVals passed to real/cplx (expected 4, got 0)
Wrong number of IndexVals passed to real/cplx (expected 4, got 0)
Aborted (core dumped)
Is this simply a problem of incorrectly priming the operators? How can I correctly prime the operators, and does the Site set of operators have a built-in priming capability?