0 votes
asked by (260 points)

Hello! It is well known that there is a phase ambiguity in SVD:
Is there anyone willing to explain how iTensor chooses this phase angle @@\phi@@ in the function svd and bondSVD (which includes a direction argument Fromleft or Fromright)? Is this special choice good for numerical stability? Thank you very much!

I tried an example:

// decompose AA into m1 and m2
auto i = Index("d",2,Link);
auto j = Index("d",2,Link);
auto a = Index("S=1/2 2",2,Site);
auto b = Index("S=1/2 3",2,Site);

ITensor AA(i,a,b,j);
AA.set(i(1),a(1),b(1),j(1), 0.706886 + 0.017676*Complex_i);
AA.set(i(2),a(2),b(2),j(2), 0.706886 + 0.017676*Complex_i);

// do SVD
ITensor U(i,a), S, V;
svd(AA, U, S, V, {"Cutoff",1E-5});
ITensor m1 = U;
ITensor m2 = S*V;

The result is

m1 = 
ITensor r=3: ("d",2,Link|372) ("S=1/2 2",2,Site|797) ("ul",2,Link|8)
{norm=1.41 (Dense Cplx)}
(1,1,1) 1.000000+0.000000i
(2,2,2) 1.000000+0.000000i

m2 = 
ITensor r=3: ("ul",2,Link|8) ("S=1/2 3",2,Site|286) ("d",2,Link|624)
{norm=1.00 (Dense Cplx)}
(1,1,1) 0.706886+0.017676i
(2,2,2) 0.706886+0.017676i

However, if I use the NumPy function numpy.linalg.svd (together with some numpy.reshape operations), the result will be (I have translated it into the iTensor format)

m1 = 
(1,1,1) -0.99968752-0.0249974i
(2,2,2) -0.99968752-0.0249974i

m2 = 
(1,1,1) -0.70710678+0.i
(2,2,2) -0.70710678+0.i

The difference is only a phase factor, as can be verified directly. It seems that they both want to make one of m1 and m2 be real (iTensor chooses m1, and NumPy chooses m2).

1 Answer

0 votes
answered by (14.1k points)
selected by
Best answer

Hi Steve,

As far as I know, there is no particular reason for the phase choice in ITensor, and it is something that could be chosen after the decomposition is performed. Right now, ITensor uses it's own implementation of the SVD (based on recursive eigendecompositions), but we would like to add options for users to choose to use LAPACK versions of the SVD. I believe that Numpy calls LAPACK routines (either *gesvd or *gesdd), so that may be the reason for the difference in the phase.

Note that for degenerate singular values, the gauge degree of freedom is actually an entire unitary rotation of the degenerate subspace, not just a simple phase degree of freedom, so in general there is no fixed convention and you will likely see different results in different numerical libraries.

If you are interested in a decomposition with a fixed phase (for some reason), note that a good option could be the polar decomposition, @@A = QP@@ where @@Q@@ is an isometry and @@P@@ is a positive Hermitian matrix (https://en.wikipedia.org/wiki/Polar_decomposition ). This can be very simply obtained from an SVD, @@A = U S V^{\dagger} = (U V^{\dagger}) (V S V^{\dagger})@@, so @@Q = U V^{\dagger}@@ and @@P = V S V^{\dagger}@@. Note that @@Q@@ is only an isometry if no truncation in the SVD is performed (and @@m > n@@ for @@m \times n@@ matrix @@A@@).


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.