Get different results from svd when permuting the indices of tensor

Hello,

I found a counterintuitive problem in svd when I permuted the indices of the tensor. The code is as follows:

using ITensors

i = Index(3)
j = Index(4)
k = Index(5)

A = randomITensor(i,j,k)
B = permute(A, j, i, k)

UA, SA, VA = svd(A, i, j)
UB, SB, VB = svd(B, i, j)

@assert array(permute(UA, i, j, commonind(UA, SA))) โ‰ˆ array(permute(UB, i, j, commonind(UB, SB)))

Here I permuted the first two indices of tensor A to get the tensor B, then performed the svd with the first two indices as the left indices. Naively, I would expect that UA and UB would have the same matrix elements after I permute the indices of these two tensors again to have the same order. But the result is very counterintuitive, and they have different matrix elements. Do you know why? I checked that SA and SB have the same matrix elements, i.e., array(SA) โ‰ˆ array(SB) is true.

Good question, but I think this is just a byproduct of the fact that the SVD does not guarantee unique entries of the U and V matrices. For instance, U and V can have entries which differ by arbitrary signs for different input matrices, and even for nearly the same input matrix with slight variations. Also, though less likely, if some of the singular values are degenerate or nearly degenerate then the related singular vectors can become mixed in arbitrary ways.

In contrast, there are some matrix factorizations which can be made unique. For example, the QR decomposition can be made unique if one chooses the diagonal elements of R to always be positive.

Hi Miles,

Thanks for the reply. I got it.

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.