NAM LAB · RESEARCH TOOLS

Fp Calculator

Exact arithmetic modulo p · enter matrices, choose operations, or combine expressions.

Input matrices

Enter integers or a/b. Paste a table from Excel; row and column indices start at 1.

Operation

Examples

Calculation history

Keep up to 20 results during this session. Select a result to view it again.

Chưa có phép tính.

NamLab · Matrices over Fp · Browser-based computation

Choose field Fp

Using p = 3. Matrices share the same field; integers and fractions are reduced modulo p during calculation.

Paste matrix

Paste Excel cells, or enter each row on a new line. Separate columns using tabs, spaces, commas or semicolons.

Syntax and operations

All field arithmetic is modulo p. Rank is an ordinary integer. A fraction a/b is valid only when b is nonzero modulo p.

ExpressionMeaning
A+B, A-B, A*B, 2AAddition, subtraction, multiplication and scalar multiplication
A^T, A^0, A^-3, -ATranspose, powers and matrix negation
I, eye(3), zero(2,3)Identity in the current context, size-3 identity, and zero matrix
det(A+B), inv(A), rank(A), trace(A)Determinant, inverse, rank and trace
adj(A), cofactor(A), ref(A), rref(A)Adjugate, cofactors and echelon forms
kron(A,B), had(A,B)Kronecker and elementwise products; ⊗ and ∘ also work
hcat(A,B), vcat(A,B)Horizontal and vertical concatenation
sub(A,1,2,2,3)Extract rows 1–2 and columns 2–3
droprow(A,2), dropcol(A,1)Delete row 2 or column 1

Matrix multiplication respects order. Inverses and negative powers require invertibility. Exponents must be integers; use parentheses for combined powers. Results are limited to 4,096 cells, with at most 25 matrices A–Z (I is reserved for the identity).

For p below 2⁶⁴, primality is verified deterministically. Larger p uses 32 randomized Miller–Rabin bases and is reported as a probable prime, not a proof.