+1 vote
asked by (280 points)

Hi Miles,

I am recently trying to implement Strictly single-site DMRG algorithm with subspace expansion as described in https://journals.aps.org/prb/abstract/10.1103/PhysRevB.91.155115 to speed up the DMRG.

In stead of doing density matrix correction after optimizing local tensor, they concatenate the local tensor with some tensor to increase the bond dimension. So I wonder what's the most efficient way to concatenate two tensor for both ITensor and IQTensor.

For example, suppose that I have two tensors of rank two defined as follows.

auto I = Index("I",5);
auto J = Index("J",8);
auto K = Index("K",2);

auto A = ITensor(I,J);
auto B = ITensor(I,K);

After concatenation, the output should also be a tensor of rank 2. One of the index is I and another index has dimension J.m() + K.m() = 8 + 2 = 10.
I tried to access each element of the two tensors and move them to a new tensor but it turns out to be inefficient.

Thanks,
Ze-Pei

1 Answer

+1 vote
answered by (70.1k points)

Hi Ze-Pei,
Good question. Unfortunately this feature is missing in ITensor currently. We have a practice of not adding features until there is a clear use case, but I think the case you describe definitely justifies adding this feature.

So if you can wait, I will try to add it as soon as I can. Hopefully within a week's time but we'll see.

For the ITensor class, adding this feature should not be extremely hard if you feel like digging into the internals yourself, although it will be faster for me to do it of course. Basically, I plan to allocate a new storage for the concatenated ITensor, then use a "TensorRef" object which is a lower-level type of non-owning tensor to refer to this storage. The TensorRef class supports "tensor slicing" which lets one select only a specific sub-block of the tensor. Then one can straightforwardly copy another tensor whose size matches that sub-block into the sub-block. In this way, one can copy each of the two tensors to be concatenated into the new tensor's storage.

Anyway that's the plan and I hope to finish it soon, at least for the ITensor class. For IQTensors it will be more technical, but should also be possible.

Best regards,
Miles

commented by (280 points)
Hi, Miles,

   Thank you so much for the help! I will also let you know if the strictly single-site DMRG algorithm works!

Regards,
Zepei
commented by (70.1k points)
Hi Zepei,
Sorry I haven't gotten to adding the concatenation feature yet. I've been meaning to but have had very little time over the last week and a half.

Miles
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

...