# Difference in convention while calculating norm

0 votes
asked

Hi,

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)}
0.618955-0.000000i

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.

Thanks
Aditya

## 1 Answer

+1 vote
answered by (70.1k 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,
Miles

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.

Thanks
Aditya
commented by (70.1k 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:
http://www.cplusplus.com/reference/complex/norm/

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.