FLINT3.7.0-dev

fmpz_mod_mat_mul, fmpz_mod_mat_sqr

Synopsis#include <flint/fmpz_mod_mat.h>
void fmpz_mod_mat_mul(fmpz_mod_mat_t C, const fmpz_mod_mat_t A, const fmpz_mod_mat_t B, const fmpz_mod_ctx_t ctx)source
void fmpz_mod_mat_sqr(fmpz_mod_mat_t B, const fmpz_mod_mat_t A, const fmpz_mod_ctx_t ctx)source

Set C = AB, respectively B = A^2 for square A. The number of columns of A must equal the number of rows of B.

The exact integer product is computed with fmpz_mat_mul (respectively fmpz_mat_sqr), which chooses between classical, Strassen, multimodular and BLAS-based algorithms and is multithreaded, and each entry is then reduced modulo n (Multiplying matrices over Z/nZ).

Guides#

Cite this page

The FLINT team, “fmpz_mod_mat_mul, fmpz_mod_mat_sqr (fmpz_mod_mat.h),” FLINT: Fast Library for Number Theory, documentation, version 3.7.0-dev, 2026. https://flintlib.org/doc/fmpz_mod_mat/fmpz_mod_mat_mul.html (generated 2026-10-20).