0 votes
asked by (250 points)


When I print a tensor in QDense format, the result is as follows:

A----size(): 136
A----offsets: Block: 0,0,0, Offset: 0
Block: 1,2,0, Offset: 12
Block: 1,0,1, Offset: 20
Block: 0,1,1, Offset: 68
Block: 2,2,1, Offset: 76
Block: 2,0,2, Offset: 88
Block: 1,1,2, Offset: 115
Block: 3,2,2, Offset: 127
Block: 3,0,3, Offset: 130
Block: 2,1,3, Offset: 133

The size of each dimension is: 10 x 5 x 10 (by reviewing the dim in Con.Lis/Con.Ris/Con.Nis). There will be 500 elements (10x5x10) and 136 dense elements (A.size()) in this 3-order tensor. I have three questions:

1) What is the block size in this case? For example, the number of elements between blocks (1,0,1) and (0,1,1) is 68 - 20 = 48. Also, how many blocks in this case?

2) How to map the index of block (4 x 3 x 4?) to the coordination (10 x 5 x 10) in the COO format?

3) Is the block size fixed for all blocks?

Thank you so much in advance for any comments!

commented by (70.1k points)
Hi, thanks for the question, but I am not sure I understand many of the things you are asking or am missing some details. First of all, what are the dimensions of the subspaces of the tensor indices of your tensor? I see that it is a 10 x 5 x 10 tensor, but how is the first Index of dimension 10 broken into different subspaces? (Is it 2+2+6 or 5+5, etc?) And similar for the other indices.

When you ask what is the block size in this case, which block are you asking about? The  blocks can have various sizes depending on which block.

What does COO format mean?

Yes, the block size is fixed for all blocks for a given set of tensor indices (QN Index objects). This is because these Index objects have a certain number of subspaces of a fixed size and these subspace sizes determine the block sizes. I’d be happy to answer officially in some more detail below.


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.