Calculator Inputs
Enter integers only. Separate values with spaces or commas. Each new line becomes a new row.
Example Data Table
| Field | Matrix A | Matrix B | Operation | Expected Output |
|---|---|---|---|---|
| GF(7) | 1 2 3 4 |
6 1 5 2 |
A + B | 0 3 1 6 |
| GF(7) | 1 2 3 4 |
6 1 5 2 |
A × B | 2 5 3 4 |
| GF(7) | 1 2 3 4 |
Not needed | det(A) | 5 |
| GF(7) | 1 2 3 4 |
Not needed | trace(A) | 5 |
Formula Used
Finite field reduction: Every entry is reduced with x mod p. Negative values are wrapped back into the range 0 to p - 1.
Addition and subtraction: Apply the operation entry by entry, then reduce each result modulo p.
Matrix multiplication: For each entry, compute c(i,j) = Σ a(i,k)b(k,j) mod p.
Determinant and inverse: Use row operations in modular arithmetic. Pivot values are divided by multiplying with their modular inverses.
Rank: Reduce the matrix to row echelon form over GF(p). The number of pivots gives the rank.
Power: Repeated squaring computes A^n mod p efficiently for large exponents.
How to Use This Calculator
- Select a prime modulus for the finite field.
- Choose the matrix operation you need.
- Enter Matrix A using one row per line.
- Enter Matrix B for binary operations.
- Provide a scalar or exponent when those options apply.
- Press Calculate Now to see the result above the form.
- Use the CSV and PDF buttons to export the result.
- Review the graph for a quick visual pattern check.
FAQs
1. What is a finite field matrix calculator?
It performs matrix operations where every value belongs to a finite field, usually GF(p). Results wrap around using modular arithmetic instead of standard real-number arithmetic.
2. Why must the modulus be prime?
A prime modulus creates a valid field GF(p). Every nonzero value then has a modular inverse, which is required for determinant, inverse, and row-reduction operations.
3. Can I enter negative numbers?
Yes. The calculator automatically converts negative values into their equivalent field representatives. For example, -1 becomes 6 in GF(7).
4. When is Matrix B required?
Matrix B is needed for addition, subtraction, and multiplication. Other operations use Matrix A only, so Matrix B can be left unchanged for those cases.
5. Why might the inverse fail?
An inverse exists only when the matrix is square and nonsingular in the chosen field. A zero determinant means the matrix has no inverse under that modulus.
6. What does the Plotly graph show?
For matrix outputs, the graph displays a heatmap of the result matrix. For scalar outputs, it compares the result value with the chosen modulus using a simple bar chart.
7. What format should matrix entries follow?
Use one row per line. Separate values with spaces, commas, or semicolons. Each row must contain the same number of entries.
8. Are exported CSV and PDF values already reduced?
Yes. Exported values match the displayed result exactly. Every entry has already been reduced into the selected finite field before export.