Segmentation Fault with Combiner

Hello,

I'm new to iTensor and wanted to simulate Lindblad dynamics but for that I need some method to exchange between MPS and MPO. This is simply combining indices so I tried using the Combiner method. However, even the most basic code http://itensor.org/docs.cgi?page=classes/combiner gives segmentation fault.

Could you help me?

P.S.: There are no errors while compiling

+1 vote

Hi, thanks for the bug report. We'd like to strive to make all of the sample code on the website compile, so this is helpful. But sometimes the codes on the site skip over a few steps, such as setting elements of tensors when initializing them, which can lead to errors.

I just updated the code on that page and it runs now. What I added was a line

randomize(T);


that sets the elements of the tensor T to be random elements. That allows the rest of the code to run correctly. The reason you were getting that error is that no elements of T had been set, so T had no storage. In the future we'll fix combiners to work even for this case.

One other note is that, if you get an error like a segmentation fault, please try compiling and running your code in "debug mode".
http://itensor.org/docs.cgi?page=formulas/debug_mode