# Difference between svd and factorize\_svd functions

**URL:** <https://itensor.discourse.group/t/difference-between-svd-and-factorize-svd-functions/591>\
**Category:** ITensor Julia Questions\
**Tags:** julia\
**Created:** [January 12, 2023, 12:02pm UTC](https://itensor.discourse.group/t/difference-between-svd-and-factorize-svd-functions/591 "2023-01-12T12:02:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadir-gunel](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/kadir-gunel/32/194_2.png) [@kadir-gunel](https://itensor.discourse.group/u/kadir-gunel)\
**Post date:** [January 12, 2023, 12:02pm UTC](https://itensor.discourse.group/t/difference-between-svd-and-factorize-svd-functions/591/1 "2023-01-12T12:02:37Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![miles](https://yyz2.discourse-cdn.com/free1/user_avatar/itensor.discourse.group/miles/32/6_2.png) [@miles](https://itensor.discourse.group/u/miles)\
**Post date:** [January 12, 2023, 2:20pm UTC](https://itensor.discourse.group/t/difference-between-svd-and-factorize-svd-functions/591/2 "2023-01-12T14:20:45Z")

</div>

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}}](https://itensor.github.io/ITensors.jl/stable/ITensorType.html#LinearAlgebra.svd-Tuple%7BITensor,%20Vararg%7BAny%7D%7D)

Also the [ITensor Paper](https://www.scipost.org/SciPostPhysCodeb.4) discusses it too with some diagrams showing the idea.

Hope that helps!
