Difference between svd and factorize_svd functions

Hello,

New user here. A CS major and first time tensor analysis user.

First of all, thank you to all the contributors of ITensors.

I have tons of questions but since it is really hard to fit it in a single post. I share you the first one.

My question is about the SVD function(s). Inside the API, there is one function called factorize_svd which does not have any documentation. At first, I thought it returns the same values as the svd function but it is not. Given the same input, the factorized_svd returns different values compared to standard svd; ex: Eigen values. Only the left singular values (U) are the same.

What is the difference between two ? When should I prefer one to other ? Could someone shed light on ?

B.R.

Hi B.R.,
Thanks for the kind words about ITensor!

Regarding the SVD, our interface for that is the function svd. The function factorize_svd is not exported by the ITensor module, so I wouldn’t call it part of the API. It’s just a bit of internal wrapper code called by another function named factorize.

The function svd is the one you should use to compute the SVD of an ITensor. It automatically reshapes an ITensor as a matrix, performs the SVD of this matrix (optionally with truncation of small singular values), then returns U, S, and V as ITensors.

Here is the documentation for svd with some examples.
https://itensor.github.io/ITensors.jl/stable/ITensorType.html#LinearAlgebra.svd-Tuple{ITensor,%20Vararg{Any}}

Also the ITensor Paper discusses it too with some diagrams showing the idea.

Hope that helps!