edited

Hi and thank you for the nice work on this library!

I would be very interested in using ITensor as a lower level symmetric tensor manipulation library, and I'm looking into wrapping parts of it in a higher level language to use together with existing code (mainly iPEPS).

The part that I would be most interested in is the translation from tensor to block-sparse matrix form and back. From what I can see it is possible to get the blocks out with something like

auto blocks = doTask(GetBlocks<T>{A.inds(),L,R},A.store());


However, it is unclear to me how to 'put the blocks back' after operations on them (either in a new tensor or in the original one). If I look at svd.cc as an example (from line 312), it seems the clue should be in

auto uind = stdx::make_array(B.i1,n);
auto pU = getBlock(Ustore,Uis,uind);
auto Uref = makeMatRef(pU,uI[B.i1].m(),L[n].m());
reduceCols(UU,L[n].m()); // just as an example
Uref &= UU;


And then use Ustore to construct a new tensor.

It would be very helpful if you could provide a little example of how to do such a thing, if possible.
Hopefully my question is clear enough, thank you in advance!

Best regards,
Boris