Dear ITensor team,
Thanks for your reply and thanks for the wonderful library about TensorNetwork. Recently, I want to calculate spin four point correlation function e.g. <S^{x}{I}S^{y}{I+1}S^{x}{j}S^{y}{j+1}>.
I am using the latest version of ITensor c++ and i find some documents about how to calculate 2-pt correlation function
I try to coding (just show in the below), but the result is wrong.
op_i = op(sites,“Sx”,i);
auto op_i1 = op(sites,“Sy”,i+1);
op_j = op(sites,“Sx”,j);
auto op_j1 = op(sites,“Sy”,j+1);
//ground state
psi_gs = psi;
psi_gs.position(i);
psi_gsdag = dag(psi_gs);
psi_gsdag.prime(“Link”);
li_1 = leftLinkIndex(psi_gs,i);
auto Cg = prime(psi_gs(i),li_1)*op_i;
Cg *= prime(psi_gsdag(i),“Site”);
Cg *= psi_gs(i+1)*op_i1;
Cg *= prime(psi_gsdag(i+1),“Site”);
for(int k=i+2; k<j;++k)
{
Cg *= psi_gs(k);
Cg *= psi_gsdag(k);
}
Cg *= psi_gs(j)*op_j;
Cg *= prime(psi_gsdag(j),“Site”);
lj = rightLinkIndex(psi_gs,j+1);
Cg *= prime(psi_gs(j+1),lj)*op_j1;
Cg *= prime(psi_gsdag(j+1),“Site”);
auto resultg = eltC(Cg);
Thanks a lot in advance !
Best regards,
Sugar