FLINT3.7.0-dev

fmpz_mat_nullspace

Synopsis#include <flint/fmpz_mat.h>
slong fmpz_mat_nullspace(fmpz_mat_t res, const fmpz_mat_t mat)source

Sets the first n−rn - r columns of res to a basis of the right nullspace of the m×nm \times n matrix mat over Q\mathbb{Q}, where rr is the rank, and returns n−rn - r. The other columns of res are set to zero. res must be n×nn \times n.

The basis is read off from fmpz_mat_rref: for each non-pivot column ff the basis vector has −den-\mathit{den} in position ff and the entries of column ff of the scaled echelon form in the pivot positions. The vectors are integral but in general neither primitive nor a basis of the integer kernel lattice {x∈Zn:Ax=0}\{x \in \mathbb{Z}^n : Ax = 0\}; for that, compute the Hermite normal form with transformation of ATA^T or use LLL.

Guides#

Cite this page

The FLINT team, “fmpz_mat_nullspace (fmpz_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz_mat/fmpz_mat_nullspace.html (generated 2026-11-02).