+2 votes
asked by (180 points)

I am trying to implement a simple version of iTebd. I defined a class which involves tensors Gamma with three indexes and tensors Lambda, which are real diagonal and contain the Schmidt eigenvalues. I have one of these tensors for each site in the elementary cell.

In order to exploit the advantage of having Lambda diagonal, I defined them using diagTensor.

In performing products of these tensors, I encountered the situation where I needed to change the indexes of one Lambda tensor. Therefore I performed the contraction with the sparse tensor delta.

However, I was surprised by the runtime error that I got when performing this contraction:

libc++abi.dylib: terminating with uncaught exception of type itensor::ITError: doTask not defined for task Contract and storage types DiagReal DiagReal

It seems that the product between two diagonal tensors is not implemented. Why is it so?

1 Answer

+1 vote
answered by (70.1k points)

Hi, good question about this. The answer of why it's not implemented is that I didn't yet see an important use case for it and I thought it better to have it throw an error instead, to make sure users weren't accidentally multiplying together tensors they didn't mean to.

But the cases you mention are good uses. So I think I should define them, especially since I think internally the contractions can be done very efficiently due to the simple sparse structure.

So I'll add it to my list of priorities to get into ITensor. Please write back here or email me if a few weeks go by and I haven't added it, or if you need it for a particularly urgent reason.

Finally, if you are feeling motivated, you can try implementing this feature yourself. The diagonal sparse ITensors are implemented by the Diag storage class in itensor/itdata/diag.h. What is needed is a definition of the function doTask(Contract, Diag, Diag). It could be a bit tricky though because one might want to handle the case of two indices and the case of all diag values being the same separately. But the other methods defined there are mostly fairly straightforward to follow as examples I think.


asked Apr 12, 2018 by (220 points) Eigenvalues of partially transposed tensor
commented by (310 points)
Hi Miles! Any chance this will be part of ITensor soon? I have also found a potential use case for it and would really appreciate the added functionality!
commented by (70.1k points)
Hi, so I was being a bit too optimistic about my time when I wrote the post above. The most likely time when we could add this feature would be by some time later this year, maybe by end of summer. Though hopefully we will get a chance to do it sooner. We are working on two new versions of ITensor, and there are many other different features that people are requesting we prioritize. (And the amount of time I'm getting to spend on development is rather constrained over the next two months.)

Best regards,
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.