toqito.matrix_ops.null_space

Compute an orthonormal basis for the null space of a matrix.

Module Contents

toqito.matrix_ops.null_space.null_space(mat, tol=1e-08)[source]

Return an orthonormal basis for the kernel of mat [@WikiNullSpace].

The routine employs the singular value decomposition so that the columns of the returned matrix span the null space and are orthonormal with respect to the standard inner product.

Examples

Consider the matrix

[

A = begin{pmatrix} 1 & 1 & 0 \ 0 & 0 & 0 end{pmatrix}.

]

Its null space is spanned by the vectors ((1,-1,0)) and ((0,0,1)).

```python exec=”1” source=”above” import numpy as np from toqito.matrix_ops import null_space

A = np.array([[1, 1, 0], [0, 0, 0]], dtype=float) null_basis = null_space(A) print(null_basis) ```

Parameters:
  • mat (numpy.ndarray) – Matrix whose null space is sought.

  • tol (float) – Numerical tolerance that distinguishes zero singular values.

Returns:

A matrix whose columns form an orthonormal basis for the null space.

Return type:

numpy.ndarray