FLINT3.7.0-dev

gr_mat_pow_ui, gr_mat_pow_si, gr_mat_pow_fmpz

Synopsis#include <flint/gr_mat.h>
int gr_mat_pow_ui(gr_mat_t res, const gr_mat_t mat, ulong e, gr_ctx_t ctx)source
int gr_mat_pow_si(gr_mat_t res, const gr_mat_t mat, slong e, gr_ctx_t ctx)source
int gr_mat_pow_fmpz(gr_mat_t res, const gr_mat_t mat, const fmpz_t e, gr_ctx_t ctx)source

Set res to A^e for a square matrix, by repeated squaring in the matrix ring (gr_generic_pow_ui, gr_generic_pow_fmpz); a negative exponent requires an invertible matrix. A^0 is the identity. Returns GR_DOMAIN if the matrices are not square of the same size.

Cite this page

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