Hi Miles, thank you for answering.
I try like the tutorial with this Code:
auto si = 0;
auto sj = 2;
psi.position(d_list2[si]);
auto psidag = dag(psi);
psidag.prime("Link");
auto li = leftLinkIndex(psi,d_list1[si]);
auto lj = rightLinkIndex(psi,d_list2[sj]);
auto op_up = op(sites,"Cup",d_list1[si]);
auto op_dup = op(sites,"Cdagup",d_list1[sj]);
auto op_dn = op(sites,"Cdn",d_list2[si]);
auto op_ddn = op(sites,"Cdagdn",d_list2[sj]);
auto C = prime(psi(d_list1[si]),li);
C *= op_up;
C *= prime(psidag(d_list1[si]),"Site");
Print(C);
cout<<"#######_1_####### k="<<d_list1[si]<<endl;
C *= psi(d_list1[si]+1);
C *= psidag(d_list1[si]+1);
Print(C);
cout<<"#######_2_####### k="<<d_list1[si]+1<<endl;
C *= psi(d_list2[si]);
C *= op_dn;
C *= psidag(d_list2[si]);
Print(C);
cout<<"#######_3_####### k="<<d_list2[si]<<endl;
for(int k=d_list2[si]+1; k<d_list1[sj]; k++)
{
C *= psi(k);
C *= psidag(k);
Print(C);
cout<<"#######_4_####### k="<<k<<endl;
}
C *= psi(d_list1[sj]);
C *= op_dup;
C *= psidag(d_list1[sj]);
Print(C);
cout<<"#######_5_####### k="<<d_list1[sj]<<endl;
C *= psi(d_list1[sj]+1);
C *= psidag(d_list1[sj]+1);
Print(C);
cout<<"#######_6_####### k="<<d_list1[sj]+1<<endl;
C *= prime(psi(d_list2[sj]),lj);
Print(C);
cout<<"#######_7.1_####### k="<<d_list2[sj]<<endl;
C *= op_ddn;
Print(C);
cout<<"#######_7.2_####### k="<<d_list2[sj]<<endl;
C *= prime(psidag(d_list2[sj]),"Site");
Print(C);
cout<<"#######_7.3_####### k="<<d_list2[sj]<<endl;
auto result = elt(C); //or eltC(C) if expecting complex
cout<<"Correlation Value: "<<result<<endl;
And I got this Output: “Wrong number of IndexVals passed to elt/eltC (expected 0, got 4)”
I tried a lot of different ways, do you see some failures in my code?
Tank you and BR
Gökmen
The last Outputs…
#######7.1####### k=13
C =
ITensor ord=7:
(dim=4|id=408|“n=3,Elec,Site”)’
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
(dim=4|id=408|“n=3,Elec,Site”)
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
(dim=4|id=438|“n=11,Elec,Site”)’
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
(dim=4|id=438|“n=11,Elec,Site”)
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
(dim=200|id=667|“l=12,Link”)’
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 3 QN({“Nf”,1,-1},{“Sz”,1})
3: 3 QN({“Nf”,1,-1},{“Sz”,-1})
4: 14 QN({“Nf”,2,-1},{“Sz”,0})
5: 6 QN({“Nf”,2,-1},{“Sz”,2})
6: 22 QN({“Nf”,3,-1},{“Sz”,1})
7: 6 QN({“Nf”,2,-1},{“Sz”,-2})
8: 22 QN({“Nf”,3,-1},{“Sz”,-1})
9: 30 QN({“Nf”,4,-1},{“Sz”,0})
10: 5 QN({“Nf”,3,-1},{“Sz”,3})
11: 16 QN({“Nf”,4,-1},{“Sz”,2})
12: 15 QN({“Nf”,5,-1},{“Sz”,1})
13: 5 QN({“Nf”,3,-1},{“Sz”,-3})
14: 15 QN({“Nf”,4,-1},{“Sz”,-2})
15: 15 QN({“Nf”,5,-1},{“Sz”,-1})
16: 7 QN({“Nf”,6,-1},{“Sz”,0})
17: 1 QN({“Nf”,4,-1},{“Sz”,4})
18: 2 QN({“Nf”,5,-1},{“Sz”,3})
19: 3 QN({“Nf”,6,-1},{“Sz”,2})
20: 1 QN({“Nf”,4,-1},{“Sz”,-4})
21: 4 QN({“Nf”,5,-1},{“Sz”,-3})
22: 2 QN({“Nf”,6,-1},{“Sz”,-2})
23: 1 QN({“Nf”,7,-1},{“Sz”,1})
24: 1 QN({“Nf”,7,-1},{“Sz”,-1})
(dim=200|id=328|“l=13,Link”)’
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 4 QN({“Nf”,1,-1},{“Sz”,1})
3: 4 QN({“Nf”,1,-1},{“Sz”,-1})
4: 16 QN({“Nf”,2,-1},{“Sz”,0})
5: 8 QN({“Nf”,2,-1},{“Sz”,2})
6: 27 QN({“Nf”,3,-1},{“Sz”,1})
7: 8 QN({“Nf”,2,-1},{“Sz”,-2})
8: 27 QN({“Nf”,3,-1},{“Sz”,-1})
9: 29 QN({“Nf”,4,-1},{“Sz”,0})
10: 5 QN({“Nf”,3,-1},{“Sz”,3})
11: 13 QN({“Nf”,4,-1},{“Sz”,2})
12: 13 QN({“Nf”,5,-1},{“Sz”,1})
13: 5 QN({“Nf”,3,-1},{“Sz”,-3})
14: 14 QN({“Nf”,4,-1},{“Sz”,-2})
15: 13 QN({“Nf”,5,-1},{“Sz”,-1})
16: 5 QN({“Nf”,6,-1},{“Sz”,0})
17: 1 QN({“Nf”,4,-1},{“Sz”,4})
18: 2 QN({“Nf”,5,-1},{“Sz”,3})
19: 1 QN({“Nf”,6,-1},{“Sz”,2})
20: 1 QN({“Nf”,4,-1},{“Sz”,-4})
21: 2 QN({“Nf”,5,-1},{“Sz”,-3})
22: 1 QN({“Nf”,6,-1},{“Sz”,-2})
(dim=4|id=1|“n=13,Elec,Site”)’
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
{norm=0.01 (QDense Real)}
#######7.2####### k=13
C =
ITensor ord=4:
(dim=4|id=408|“n=3,Elec,Site”)’
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
(dim=4|id=408|“n=3,Elec,Site”)
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
(dim=4|id=438|“n=11,Elec,Site”)’
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
(dim=4|id=438|“n=11,Elec,Site”)
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
{norm=0.00 (QDense Real)}
#######7.3####### k=13
inds() =
(dim=4|id=408|“n=3,Elec,Site”)’
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
(dim=4|id=408|“n=3,Elec,Site”)
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
(dim=4|id=438|“n=11,Elec,Site”)’
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
(dim=4|id=438|“n=11,Elec,Site”)
1: 1 QN({“Nf”,0,-1},{“Sz”,0})
2: 1 QN({“Nf”,1,-1},{“Sz”,1})
3: 1 QN({“Nf”,1,-1},{“Sz”,-1})
4: 1 QN({“Nf”,2,-1},{“Sz”,0})
From line 89, file itensor.cc
Wrong number of IndexVals passed to elt/eltC (expected 0, got 4)
Wrong number of IndexVals passed to elt/eltC (expected 0, got 4)