FLINT3.7.0-dev

nmod_mat_similarity

Synopsis#include <flint/nmod_mat.h>
void nmod_mat_similarity(nmod_mat_t M, slong r, ulong d)source

Replaces the square matrix MM by P−1MPP^{-1} M P, where PP is the identity matrix with the entries in row rr and every column j∉{r−1,r}j \notin \{r-1, r\} replaced by dd. Requires d<nd < n.

Equivalently, dd times column rr is added to every column j∉{r−1,r}j \notin \{r - 1, r\}, and then dd times the sum of the rows j∉{r−1,r}j \notin \{r - 1, r\} is subtracted from row rr. Such transforms preserve the determinant and the characteristic and minimal polynomials.

Cite this page

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