# Applying RREF transformation of one matrix to another

Given a matrix M, let M' be the matrix created by M.rref(). Let E be a matrix made from composing the elementary row operations which took M to M.rref(). In particular, E satisfies M.rref() = EM.

I now wish to compute E (actually, EA, for any matrix A of the right dimension). Does Sagemath offer anything which allows me to bypass manually computing E?

edit retag close merge delete

Sort by ยป oldest newest most voted

Use echelon_form function with parameter transformation=True:

R, E = M.echelon_form(transformation=True)
assert E*M == R

more

Thanks! But when I tried the above:

1. It didn't really give me the RREF
2. The transformation = True parameter seems to not do anything once I start working on finite fields.

On an unrelated note, where may I learn the typesetting features on this platform? (Code boxes, LaTeX, etc.)

( 2022-11-11 22:18:53 +0200 )edit

Please provide examples of what you expect and what you get. Typesetting here supports Markdown syntax - see https://daringfireball.net/projects/m...

( 2022-11-12 02:45:04 +0200 )edit

Thanks!

I wrote in the notebook:

 M = Matrix([[1,2,3],[4,5,6],[7,8,9]]) M.rref(transformation = True) M.echelon_form(transformation = True) 

The first one only returns the RREF despite passing the transformation parameter. The second one does return an echelon form and the transformation matrix is provided, the way I wanted. However, the echelon form is not row reduced.

( 2022-11-21 20:20:34 +0200 )edit

On an unrelated note, where may I learn the typesetting features on this platform? (Code boxes, LaTeX, etc.)

This site uses Mathjax, which may display typeset math from LaTeX code bracketed by $s (inline) or $\$s (displayed). It has some limitations (e. g. doesn't support cases or (some) arrays) and some bugs (e. g. needs \\, in place of \,).

HTH,

( 2024-02-26 10:36:06 +0200 )edit

@yeetcode: you can reduce the form yourself by dividing each its row and the row of transformation matrix by the corresponding diagonal elements.

( 2024-02-26 14:06:56 +0200 )edit