+1 vote
asked by (280 points)

Hi,

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

The specific example is:

combine =
/--------------IQTensor--------------
r=3 div=QN() log(scale)=0
IQIndex(cmb,8,Link,854)
(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)

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

IQIndex(site=2,4,Site,268)
(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 -------
QCombiner
------------------------------------

and the other tensor is:

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

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

IQIndex(site=3,4,Site,172)
(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)

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

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

IQIndex(MPOIndex,38,Link,584)
(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)
(PiNus
1,7,Link,534) (Sz=2,Nf=-2)
(PiNds_1,7,Link,330) (Sz=0,Nf=-2)

IQIndex(site=2,4,Site,268)
(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".

Best,
Lars

commented by (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),
                         Index("L+",2),QN(+1));
    auto S = IQIndex("S",Index("S-",1),QN(-1),
                         Index("S+",1),QN(+1));
    auto R = IQIndex("R",Index("S-",1),QN(-1),
                         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.
Lars

1 Answer

0 votes
answered by (70.1k points)
selected by
 
Best answer

Fixed by a pull request: https://github.com/ITensor/ITensor/pull/119

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.

Categories

...