This repository was archived by the owner on Nov 7, 2024. It is now read-only.

Description
Hi,
Currently the following code will throw an error:
from tensornetwork.backends.numpy.decompositions import svd_decomposition
import numpy as np
foo = np.random.rand(2,2,2,1)
svd_decomposition(np,foo,2,max_singular_values=30)
The reason is that np.linalg.svd returns the full U, V^\dagger matrices by default (unlike pytorch and TF which return the reduced SVD by default). Hence when only max_singular_values is specified and it is larger than min(rank(U),rank(V^\dagger)), svd_decompostion will try to reshape one of the matrices to the wrong shape (U in this case).
I will create a PR to fix this.