Is there online calculator for calculating a row echelon form of a matrix over $\mathbb{Z}_n$?

276 Views Asked by At

There are many great online calculators for calculating row-echelon forms of matrices, such as this one. But now I need to calculate the row-echelon form of some large matrices over $\mathbb{Z}_n$ (thus dividing a row by a non-zero integer may not be legal). Is there any software or website where I can calculate the row echelon form of a matrix over $\mathbb{Z}_n$? Ideally, if I can input the matrix and the value of $n$ and obtain the row echelon form, that would be great.

1

There are 1 best solutions below

3
On BEST ANSWER

This can be done in Sage quite easily, at least for $n$ prime (or, more generally, over integral domains). For such a simple calculation, the SageMath cell should be enough. The following code does the job (for a certain 2 by 3 matrix $A$ for $n=5$):

n=5
R=IntegerModRing(n)
M=MatrixSpace(R,2,3)
A=M([1,2,3, 3,2,1])
A.echelon_form()

You find the SageMathCell here:

https://sagecell.sagemath.org/

Edit: For composite $n$ you can make the computation over the integers and reduce the result modulo $n$:

n=4
R=ZZ
M=MatrixSpace(R,2,3)
A=M([1,2,3, 3,2,1])
B=A.echelon_form()
S=IntegerModRing(n)
B.change_ring(S)