0 votes
asked by (190 points)


This is not exactly a question but a minor detail I noticed in my calculations.

When calculating the norm of an ITensor, it reports the number after a square root. But when I calculate the norm after an inner product of two MPSs, there is no square root involved.

An example when the quantity being calculated is essentially the same, but in the two different ways mentioned above :

ITensor ord=0:
{norm=0.62 (Dense Cplx)}

innerC(psi,psi2) = (0.618955,8.67362e-16)
norm(innerC(psi,psi2)) = 0.383105

The numbers 0.62 and 0.38 are off by a square root.
Not sure if this needs resolution or I am missing something.


1 Answer

+1 vote
answered by (49k points)

Hi Aditya,
Yes, that is the reason for giving those functions the specific names that they have, where inner means an inner or dot product, so no square root, while norm involves a square root by definition. But please let me know if you were expecting something different.

Best regards,

commented by (190 points)
Hi Miles,

I think I was not clear enough in the description above. I was talking about the norm following an inner product. From the example above, I get the same complex number as output from two different pathways namely :  contraction of tensors leading to a zero order tensor and inner product of MPSs. The complex number output is the same i.e. 0.618955-0.000000i

But now when I take the norm of this output, it results in different numbers (0.62 and 0.38). I'd expect these to be the same because they both refer to the norm of the same complex number (represented in the form of a zero order tensor and a complex data type). I hope this clears the point.

commented by (49k points)
Hi, thanks for clarifying. I see what you are asking now and agree it’s weird.

So unfortunately what’s going on is that the output of innerC is a complex scalar, so the norm function getting called there is the one from the C++ std lib:

This function does not take the square foot after squaring the components, which I think is the incorrect use of the word norm, but is unfortunately a C++ thing and out of our hands.
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.