Segmentation fault when using combiner

+1 vote
asked May 3, 2017 by lfrahm (280 points)


I'm getting a segmentation fault when using a combiner in a contraction.

The specific example is:

combine =
r=3 div=QN() log(scale)=0
(c0,1,Link,390) (Sz=-1,Nf=1)
(c1,2,Link,985) (Sz=0,Nf=2)
(c2,1,Link,906) (Sz=1,Nf=3)
(c3,1,Link,69) (Sz=-2,Nf=2)
(c4,2,Link,545) (Sz=-1,Nf=3)
(c5,1,Link,386) (Sz=0,Nf=4)

(d2,1,Link,997) (Sz=-1,Nf=1)
(d3,1,Link,486) (Sz=0,Nf=2)

(Emp 2,1,Site,200) (Sz=0,Nf=0)
(Up 2,1,Site,598) (Sz=1,Nf=1)
(Dn 2,1,Site,552) (Sz=-1,Nf=1)
(UpDn 2,1,Site,867) (Sz=0,Nf=2)

|-- Data -------

and the other tensor is:

drho =
r=7 div=(Sz=-1,Nf=21) log(scale)=5.58209
(d2,1,Link,997) (Sz=-1,Nf=1)
(d3,1,Link,486) (Sz=0,Nf=2)

(l3,1,Link,471) (Sz=0,Nf=4)

(Emp 3,1,Site,898) (Sz=0,Nf=0)
(Up 3,1,Site,547) (Sz=1,Nf=1)
(Dn 3,1,Site,602) (Sz=-1,Nf=1)
(UpDn 3,1,Site,151) (Sz=0,Nf=2)

(d2,1,Link,997) (Sz=-1,Nf=1)
(d3,1,Link,486) (Sz=0,Nf=2)

(l1,1,Link,932) (Sz=0,Nf=8)

(1st i=1,3,Link,248) (Sz=1,Nf=-1)
(cst i=1,2,Link,101) (Sz=-1,Nf=-1)
(cdagup i=1,2,Link,773) (Sz=-1,Nf=1)
(cdagdn i=1,2,Link,670) (Sz=1,Nf=1)
(3rd i=1,8,Link,749) (Sz=0,Nf=0)
(RiNus1,7,Link,17) (Sz=2,Nf=0)
1,7,Link,534) (Sz=2,Nf=-2)
(PiNds_1,7,Link,330) (Sz=0,Nf=-2)

(Emp 2,1,Site,200) (Sz=0,Nf=0)
(Up 2,1,Site,598) (Sz=1,Nf=1)
(Dn 2,1,Site,552) (Sz=-1,Nf=1)
(UpDn 2,1,Site,867) (Sz=0,Nf=2)

|-- Data -------
QDense Real {7 blocks; data size 45}
(d3,1,Link,486) (l3,1,Link,471) (UpDn 3,1,Site,151) (d3,1,Link,486) (l1,1,Link,932) (PiNus1,7,Link,534) (Up 2,1,Site,598)
(2,1,4,2,1,31,2) -1.8727
(d3,1,Link,486) (l3,1,Link,471) (UpDn 3,1,Site,151) (d3,1,Link,486) (l1,1,Link,932) (PiNds
1,7,Link,330) (Dn 2,1,Site,552)
(2,1,4,2,1,38,3) 2.21107
(d3,1,Link,486) (l3,1,Link,471) (UpDn 3,1,Site,151) (d3,1,Link,486) (l1,1,Link,932) (1st i=1,3,Link,248) (UpDn 2,1,Site,867)
(2,1,4,2,1,1,4) 265.153
(2,1,4,2,1,2,4) -15.364
(d3,1,Link,486) (l3,1,Link,471) (UpDn 3,1,Site,151) (d2,1,Link,997) (l1,1,Link,932) (PiNds_1,7,Link,330) (UpDn 2,1,Site,867)
(2,1,4,1,1,38,4) -2.51961


if I do drho = combine * drho, I get

Signal: Segmentation fault (11)
Signal code: Address not mapped (1)
Failing at address: 0x8

I hope anyone can help me.

Btw: This happens in the "deltaRho" method of the class "LocalOp" when using a noise term in "fitApplyMPO".


commented May 5, 2017 by lfrahm (280 points)
I was able to reproduce this error with the following code:

    auto L = IQIndex("L",Index("L-",2),QN(-1),
                         Index("L0",4),QN( 0),
    auto S = IQIndex("S",Index("S-",1),QN(-1),
    auto R = IQIndex("R",Index("S-",1),QN(-1),

    //Create a zero IQTensor
    auto A = IQTensor(L,S,R);

    auto B = randomTensor(QN(0),dag(L),S, R);

    IQTensor C;
    C = combiner(S, R);
    auto newT = C*B;
    std::stringstream data;
    write(data, C);
    std::cout << data << std::endl;
    IQTensor c2;
    read(data, c2);

    auto newT2 = c2*B;

Hope this helps.

1 Answer

0 votes
answered May 8, 2017 by miles (19,870 points)
selected May 9, 2017 by lfrahm
Best answer

Fixed by a pull request:

Thanks, Lars, for submitting this patch.

Welcome to ITensor Support Q&A, where you can ask questions and receive answers from other members of the community.

Formatting Tips:
  • To format code, indent by four spaces
  • To format inline LaTeX, surround it by @@ on both sides
  • To format LaTeX on its own line, surround it by $$ above and below
  • For LaTeX, it may be necessary to backslash-escape underscore characters to obtain proper formatting. So for example writing \sum\_i to represent a sum over i.
If you cannot register due to firewall issues (e.g. you cannot see the capcha box) please email Miles Stoudenmire to ask for an account.

To report ITensor bugs, please use the issue tracker.