---
title: "Non-trivial Properties"
canonical: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/non-trivial.html"
source: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/non-trivial.md"
part: "Matrices and Linear Algebra"
chapter: "Sparse Matrices"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Matrices and Linear Algebra", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/index-matrices-linear-algebra.md"}
  - {"title": "Sparse Matrices", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/index-sparse-matrices.md"}
prev: {"title": "Multiplying Vectors or Matrices by Sparse Matrices", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/multiply.md"}
next: {"title": "Determinant and Other Properties", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/determinant.md"}
intrinsics:
  - {"name": "Nullspace", "signature": "Nullspace(A): MtrxSprs -> ModTupRng"}
  - {"name": "Kernel", "signature": "Kernel(A): MtrxSprs -> ModTupRng, Map"}
  - {"name": "NullspaceMatrix", "signature": "NullspaceMatrix(A): MtrxSprs -> Mtrx"}
  - {"name": "KernelMatrix", "signature": "KernelMatrix(A): MtrxSprs -> Mtrx"}
  - {"name": "NullspaceOfTranspose", "signature": "NullspaceOfTranspose(A): MtrxSprs -> ModTupRng"}
  - {"name": "Rowspace", "signature": "Rowspace(A): MtrxSprs -> ModTupRng"}
  - {"name": "Rank", "signature": "Rank(A): MtrxSprs -> RngIntElt"}
---

# Non-trivial Properties

The following functions compute non-trivial properties of sparse matrices.

## Nullspace and Rowspace

The following functions compute nullspaces (solving equations of the form $V\cdot A=0$) or rowspaces of sparse matrices.

<a id="function-nullspace-mtrxsprs"></a>
### `Nullspace(A): MtrxSprs -> ModTupRng`

<a id="function-kernel-mtrxsprs"></a>
### `Kernel(A): MtrxSprs -> ModTupRng, Map`

Given an $m \times n$ sparse matrix $A$ over a ring $R$, return the nullspace of $A$ (or the kernel of $A$, considered as a linear transformation or map), which is the $R$-space consisting of all vectors $v$ of length $m$ such that $v\cdot A = 0$. Since the result will be given in the dense representation, both the nullity of $A$ and the number of rows of $A$ must both be reasonably small.

The algorithm first performs sparse elimination using Markowitz pivoting ([[DEJ84](https://docs.magma-maths.org/v2.30-1/references.md#cite-smatbook), Sec. 9.2]) to obtain a smaller dense matrix, then the nullspace algorithm for dense-representation matrices is applied to this matrix.

<a id="function-nullspacematrix-mtrxsprs"></a>
### `NullspaceMatrix(A): MtrxSprs -> Mtrx`

<a id="function-kernelmatrix-mtrxsprs"></a>
### `KernelMatrix(A): MtrxSprs -> Mtrx`

Given an $m \times n$ sparse matrix $A$ over a ring $R$, return a (dense-representation) basis matrix of the nullspace of $A$. This is a matrix $N$ having $m$ columns and the maximal number of independent rows subject to the condition that $N\cdot A = 0$. This function has the advantage that the nullspace is not returned as a $R$-space, so echelonization of the resulting nullspace may be avoided.

<a id="function-nullspaceoftranspose-mtrxsprs"></a>
### `NullspaceOfTranspose(A): MtrxSprs -> ModTupRng`

This function is equivalent to `Nullspace(Transpose(A))`, but will be more efficient in space for large matrices, since the transpose may not have to be explicitly constructed to compute the nullspace.

<a id="function-rowspace-mtrxsprs"></a>
### `Rowspace(A): MtrxSprs -> ModTupRng`

Given an $m \times n$ sparse matrix $A$ over a ring $R$, return the rowspace of $A$, which is the $R$-space generated by the rows of $A$. Since the result will be given in the dense representation, the rank and the number of columns of $A$ must both be reasonably small.

## Rank

<a id="function-rank-mtrxsprs"></a>
### `Rank(A): MtrxSprs -> RngIntElt`

Given an $m \times n$ sparse matrix $A$ over a ring $R$, return the rank of $A$. The algorithm first performs sparse elimination using Markowitz pivoting ([[DEJ84](https://docs.magma-maths.org/v2.30-1/references.md#cite-smatbook), Sec. 9.2]) to obtain a smaller dense matrix, then the rank algorithm for dense-representation matrices is applied to this matrix.
