scipy.linalg.
orth#
- scipy.linalg.orth(A, rcond=None)[source]#
Construct an orthonormal basis for the range of A using SVD
The documentation is written assuming array arguments are of specified “core” shapes. However, array argument(s) of this function may have additional “batch” dimensions prepended to the core shape. In this case, the array is treated as a batch of lower-dimensional slices; see Batched Linear Operations for details.
- Parameters:
- A(M, N) array_like
Input array
- rcondfloat, optional
Relative condition number. Singular values
ssmaller thanrcond * max(s)are considered zero. Default: floating point eps * max(M,N).
- Returns:
- Q(M, K) ndarray
Orthonormal basis for the range of A. K = effective rank of A, as determined by rcond
See also
svdSingular value decomposition of a matrix
null_spaceMatrix null space
Examples
>>> import numpy as np >>> from scipy.linalg import orth >>> A = np.array([[2, 0, 0], [0, 5, 0]]) # rank 2 array >>> orth(A) array([[0., 1.], [1., 0.]]) >>> orth(A.T) array([[0., 1.], [1., 0.], [0., 0.]])