Hi Matt,

Thank you for you quick reply!

Are there any restrictions of using IQTensors in 'eigen'? Because I think there might be an another small bug in 'eigen' for the case of IQTensors, if my understanding of what the 'Tc' tensor is correct.

Is the aim to contract all the pairs of site indices from 'T', so you remain with the 2 link indices in 'Tc'? If this is correct, than I think one would get a "Mistmatched IQINdex arrows" error message in computing 'Tc', as the 'prime' function doesn't change the arrow directions of the indices in 'comb' and an extra 'dag' would be necessary.

In the following I copied a piece of my code and the output, with the error message that I get:

PrintData(Hbond);

auto colinds = std::vector<IQIndex>{};

for(auto& I : Hbond.inds())

{

if(I.primeLevel() == 0) colinds.push_back(I);

}

auto comb = combiner(std::move(colinds));

PrintData(comb);

PrintData(prime(comb));

PrintData(dag(prime(comb)));

auto Tc = dag(prime(comb)) * Hbond * comb;

PrintData(Tc);

auto Tc2 = prime(comb) * Hbond * comb;

PrintData(Tc2);

Output:

"Hbond =

/--------------IQTensor--------------

r=4 div=QN(0) log(scale)=2.15874

IQIndex("Boson site=",3,Site|668) <In>

("b0 2",1,Site|479) QN(0)

("b1 2",1,Site|699) QN(1)

("b2 2",1,Site|441) QN(2)

IQIndex("Boson site=",3,Site|668)' <Out>

("b0 2",1,Site|479)' QN(0)

("b1 2",1,Site|699)' QN(1)

("b2 2",1,Site|441)' QN(2)

IQIndex("Photon site",6,Site|148) <In>

("p0 1",1,Site|281) QN(0)

("p1 1",1,Site|197) QN(0)

("p2 1",1,Site|25) QN(0)

("p3 1",1,Site|488) QN(0)

("p4 1",1,Site|146) QN(0)

("p5 1",1,Site|315) QN(0)

IQIndex("Photon site",6,Site|148)' <Out>

("p0 1",1,Site|281)' QN(0)

("p1 1",1,Site|197)' QN(0)

("p2 1",1,Site|25)' QN(0)

("p3 1",1,Site|488)' QN(0)

("p4 1",1,Site|146)' QN(0)

("p5 1",1,Site|315)' QN(0)

|-- Data -------

QDense Cplx {108 blocks; data size 108}

...I skip the values...

\------------------------------------

comb =

/--------------IQTensor--------------

r=3 div=QN() log(scale)=0

IQIndex("cmb",18,Link|814) <In>

("c0",6,Link|603) QN(0)

("c1",6,Link|583) QN(1)

("c2",6,Link|899) QN(2)

IQIndex("Boson site=",3,Site|668) <Out>

("b0 2",1,Site|479) QN(0)

("b1 2",1,Site|699) QN(1)

("b2 2",1,Site|441) QN(2)

IQIndex("Photon site",6,Site|148) <Out>

("p0 1",1,Site|281) QN(0)

("p1 1",1,Site|197) QN(0)

("p2 1",1,Site|25) QN(0)

("p3 1",1,Site|488) QN(0)

("p4 1",1,Site|146) QN(0)

("p5 1",1,Site|315) QN(0)

|-- Data -------

QCombiner

\------------------------------------

prime(comb) =

/--------------IQTensor--------------

r=3 div=QN() log(scale)=0

IQIndex("cmb",18,Link|814)' <In>

("c0",6,Link|603)' QN(0)

("c1",6,Link|583)' QN(1)

("c2",6,Link|899)' QN(2)

IQIndex("Boson site=",3,Site|668)' <Out>

("b0 2",1,Site|479)' QN(0)

("b1 2",1,Site|699)' QN(1)

("b2 2",1,Site|441)' QN(2)

IQIndex("Photon site",6,Site|148)' <Out>

("p0 1",1,Site|281)' QN(0)

("p1 1",1,Site|197)' QN(0)

("p2 1",1,Site|25)' QN(0)

("p3 1",1,Site|488)' QN(0)

("p4 1",1,Site|146)' QN(0)

("p5 1",1,Site|315)' QN(0)

|-- Data -------

QCombiner

\------------------------------------

dag(prime(comb)) =

/--------------IQTensor--------------

r=3 div=QN() log(scale)=0

IQIndex("cmb",18,Link|814)' <Out>

("c0",6,Link|603)' QN(0)

("c1",6,Link|583)' QN(1)

("c2",6,Link|899)' QN(2)

IQIndex("Boson site=",3,Site|668)' <In>

("b0 2",1,Site|479)' QN(0)

("b1 2",1,Site|699)' QN(1)

("b2 2",1,Site|441)' QN(2)

IQIndex("Photon site",6,Site|148)' <In>

("p0 1",1,Site|281)' QN(0)

("p1 1",1,Site|197)' QN(0)

("p2 1",1,Site|25)' QN(0)

("p3 1",1,Site|488)' QN(0)

("p4 1",1,Site|146)' QN(0)

("p5 1",1,Site|315)' QN(0)

|-- Data -------

QCombiner

\------------------------------------

Tc =

/--------------IQTensor--------------

r=2 div=QN(0) log(scale)=2.15874

IQIndex("cmb",18,Link|814) <In>

("c0",6,Link|603) QN(0)

("c1",6,Link|583) QN(1)

("c2",6,Link|899) QN(2)

IQIndex("cmb",18,Link|814)' <Out>

("c0",6,Link|603)' QN(0)

("c1",6,Link|583)' QN(1)

("c2",6,Link|899)' QN(2)

|-- Data -------

QDense Cplx {3 blocks; data size 108}

...I skip the values...

\------------------------------------

----------------------------------------

IQIndexSet 1 =

IQIndex("cmb",18,Link|814)' <In>

("c0",6,Link|603)' QN(0)

("c1",6,Link|583)' QN(1)

("c2",6,Link|899)' QN(2)

IQIndex("Boson site=",3,Site|668)' <Out>

("b0 2",1,Site|479)' QN(0)

("b1 2",1,Site|699)' QN(1)

("b2 2",1,Site|441)' QN(2)

IQIndex("Photon site",6,Site|148)' <Out>

("p0 1",1,Site|281)' QN(0)

("p1 1",1,Site|197)' QN(0)

("p2 1",1,Site|25)' QN(0)

("p3 1",1,Site|488)' QN(0)

("p4 1",1,Site|146)' QN(0)

("p5 1",1,Site|315)' QN(0)

----------------------------------------

IQIndexSet 2 =

IQIndex("Boson site=",3,Site|668) <In>

("b0 2",1,Site|479) QN(0)

("b1 2",1,Site|699) QN(1)

("b2 2",1,Site|441) QN(2)

IQIndex("Boson site=",3,Site|668)' <Out>

("b0 2",1,Site|479)' QN(0)

("b1 2",1,Site|699)' QN(1)

("b2 2",1,Site|441)' QN(2)

IQIndex("Photon site",6,Site|148) <In>

("p0 1",1,Site|281) QN(0)

("p1 1",1,Site|197) QN(0)

("p2 1",1,Site|25) QN(0)

("p3 1",1,Site|488) QN(0)

("p4 1",1,Site|146) QN(0)

("p5 1",1,Site|315) QN(0)

IQIndex("Photon site",6,Site|148)' <Out>

("p0 1",1,Site|281)' QN(0)

("p1 1",1,Site|197)' QN(0)

("p2 1",1,Site|25)' QN(0)

("p3 1",1,Site|488)' QN(0)

("p4 1",1,Site|146)' QN(0)

("p5 1",1,Site|315)' QN(0)

----------------------------------------

Mismatched IQIndex from set 1 IQIndex("Boson site=",3,Site|668)' <Out>

("b0 2",1,Site|479)' QN(0)

("b1 2",1,Site|699)' QN(1)

("b2 2",1,Site|441)' QN(2)

Mismatched IQIndex from set 2 IQIndex("Boson site=",3,Site|668)' <Out>

("b0 2",1,Site|479)' QN(0)

("b1 2",1,Site|699)' QN(1)

("b2 2",1,Site|441)' QN(2)

Mismatched IQIndex arrows"

I mention that I use a custom SiteSet.

Best,

Catalin