svd

tenpy.linalg.svd_robust.svd(a, full_matrices=True, compute_uv=True, overwrite_a=False, check_finite=True, lapack_driver='gesdd', warn=True)[source]

Wrapper around scipy.linalg.svd() with gesvd backup plan.

Tries to avoid raising an LinAlgError by using the lapack_driver gesvd, if gesdd failed.

Parameters not described below are as in scipy.linalg.svd()

Parameters:
  • overwrite_a (bool) – Ignored (i.e. set to False) if lapack_driver='gesdd'. Otherwise described in scipy.linalg.svd().

  • lapack_driver ({'gesdd', 'gesvd'}, optional) – Whether to use the more efficient divide-and-conquer approach ('gesdd') or general rectangular approach ('gesvd') to compute the SVD. MATLAB and Octave use the 'gesvd' approach. Default is 'gesdd'. If 'gesdd' fails, 'gesvd' is used as backup.

  • warn (bool) – Whether to create a warning when the SVD failed.

Returns:

U, S, Vh – As described in doc-string of scipy.linalg.svd().

Return type:

ndarray