0 votes
asked by (120 points)
edited by

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

Please log in or register to answer this question.

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

...