I am currently changing a MATLAB code to python because I need to work in a python environment. But the result I get for calculating the singular values and vectors is different in value and size for MATLAB and python. For example, for a 5 by 5 identity matrix C:
In MATLAB,
U, S, T = svds(C, 5)
gives matrices with shapes: U - (15000, 5), S - (3, 5), T - (5, 1) whereas
In python,
U, S, T = scipy.sparse.linalg.svds(C, k=4)
gives matrices with shapes: U - (5, 5), S - (4, ), T - (4, 5)
The value of k in python has to be 4 because k must be less than the minimum of the shape of C. Is there any way I can get the same results as in Matlab? Any help is appreciated. Thank you in advance!