Ask Your Question
1

Applying RREF transformation of one matrix to another

asked 2022-10-29 22:48:53 +0200

yeetcode gravatar image

updated 2024-02-25 21:52:09 +0200

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 flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-10-31 19:38:32 +0200

Max Alekseyev gravatar image

Use echelon_form function with parameter transformation=True:

R, E = M.echelon_form(transformation=True)
assert E*M == R
edit flag offensive delete link more

Comments

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.)

yeetcode gravatar imageyeetcode ( 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...

Max Alekseyev gravatar imageMax Alekseyev ( 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.

yeetcode gravatar imageyeetcode ( 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,

Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 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.

Max Alekseyev gravatar imageMax Alekseyev ( 2024-02-26 14:06:56 +0200 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-10-29 22:48:53 +0200

Seen: 247 times

Last updated: Feb 25