cr.sparse.la.null_space¶
- cr.sparse.la.null_space(A, rcond=None)[source]¶
Constructs an orthonormal basis for the null space of A using SVD
- Parameters
A (jax.numpy.ndarray) – Input matrix of size (M, N) where M is the dimension of the ambient vector space and N is the number of vectors in A
rcond (float) – Relative condition number. Singular values
s
smaller thanrcond * max(s)
are considered zero. Default: floating point eps * max(M,N).
- Returns
- Returns a tuple consisting of
the right singular vectors of A
the effective rank of A
- Return type
To get the ONB for the null space of A, follow the two step process:
Z, r = null_space(A) Z = Z[:, r:]
The dimension of the effective null space is \(N - r\) where r is the rank of A.
Examples
>>> A = random.normal(key, (3, 5)) >>> Z, r = null_space(A) >>> Z = Z[:, r:] >>> Z.shape (5, 2) >>> print(jnp.allclose(A @ Z, 0)) True