bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / sparse / linalg / _svdp / _svdp
function
scipy.sparse.linalg._svdp:_svdp
source: build-install/usr/lib/python3.14/site-packages/scipy/sparse/linalg/_svdp.py:65
Signature
def _svdp(A, k, which = LM, irl_mode = True, kmax = None, compute_u = True, compute_v = True, v0 = None, full_output = False, tol = 0, delta = None, eta = None, anorm = 0, cgs = False, elr = True, min_relgap = 0.002, shifts = None, maxiter = None, rng = None)Summary
Compute the singular value decomposition of a linear operator using PROPACK
Parameters
A: array_like, sparse matrix, or LinearOperatorOperator for which SVD will be computed. If
Ais a LinearOperator object, it must define bothmatvecandrmatvecmethods.k: intNumber of singular values/vectors to compute
which: {"LM", "SM"}Which singular triplets to compute: - 'LM': compute triplets corresponding to the
klargest singular values - 'SM': compute triplets corresponding to theksmallest singular valueswhich='SM'requiresirl_mode=True. Computes largest singular values by default.irl_mode: bool, optionalIf True, then compute SVD using IRL (implicitly restarted Lanczos) mode. Default is True.
kmax: int, optionalMaximal number of iterations / maximal dimension of the Krylov subspace. Default is
10 * k.compute_u: bool, optionalIf True (default) then compute left singular vectors, u.
compute_v: bool, optionalIf True (default) then compute right singular vectors,
v.tol: float, optionalThe desired relative accuracy for computed singular values. If not specified, it will be set based on machine precision.
v0: array_like, optionalStarting vector for iterations: must be of length
A.shape[0]. If not specified, PROPACK will generate a starting vector.full_output: bool, optionalIf True, then return sigma_bound. Default is False.
delta: float, optionalLevel of orthogonality to maintain between Lanczos vectors. Default is set based on machine precision.
eta: float, optionalOrthogonality cutoff. During reorthogonalization, vectors with component larger than
etaalong the Lanczos vector will be purged. Default is set based on machine precision.anorm: float, optionalEstimate of
||A||. Default is0.cgs: bool, optionalIf True, reorthogonalization is done using classical Gram-Schmidt. If False (default), it is done using modified Gram-Schmidt.
elr: bool, optionalIf True (default), then extended local orthogonality is enforced when obtaining singular vectors.
min_relgap: float, optionalThe smallest relative gap allowed between any shift in IRL mode. Default is
0.001. Accessed only ifirl_mode=True.shifts: int, optionalNumber of shifts per restart in IRL mode. Default is determined to satisfy
k <= min(kmax-shifts, m, n). Must be >= 0, but choosing 0 might lead to performance degradation. Accessed only ifirl_mode=True.maxiter: int, optionalMaximum number of restarts in IRL mode. Default is
1000. Accessed only ifirl_mode=True.rng: `numpy.random.Generator`, optionalPseudorandom number generator state. When
rngis None, a new numpy.random.Generator is created using entropy from the operating system. Types other than numpy.random.Generator are passed to numpy.random.default_rng to instantiate aGenerator.
Returns
u: ndarrayThe
klargest (which="LM") or smallest (which="SM") left singular vectors,shape == (A.shape[0], 3), returned only ifcompute_u=True.sigma: ndarrayThe top
ksingular values,shape == (k,)vt: ndarrayThe
klargest (which="LM") or smallest (which="SM") right singular vectors,shape == (3, A.shape[1]), returned only ifcompute_v=True.sigma_bound: ndarraythe error bounds on the singular values sigma, returned only if
full_output=True.
Aliases
scipy.sparse.linalg._svdp._svdp