Ask Your Question
1

How to get the left matrix that was used to obtain reduced row echelon form?

asked 2018-09-10 17:25:45 +0100

Jules gravatar image

Hi all.

I have a matrix A and would like to determine a matrix E such that E*A = R, where R is the reduced row echelon form of the matrix A. I just know the command R = A.rref(). But I don't know how to get E (my stupid solution is to compute the inverse of the pivot columns of A ...). Is there e.g. an argument such that A.rref() also outputs E?

Thanks a lot, Julian

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-10 18:31:53 +0100

slelievre gravatar image

You can use the echelon_form method with transformation=True.

Example:

sage: A = Matrix([[1, 2, 3], [3, 2, 1], [1, 1, 1]])
sage: A
[1 2 3]
[3 2 1]
[1 1 1]
sage: A.echelon_form(transformation=True)
(
[ 1  0 -1]  [ 0  1 -2]
[ 0  1  2]  [ 0 -1  3]
[ 0  0  0], [ 1  1 -4]
)
edit flag offensive delete link more

Comments

Thanks for your quick answer. However, it does not really what I would like to have :-/ Am I doing something wrong or does It not work if A is over GF(q). (gives A.echelon_form(transformation=True) always reduced row echelon form or just echelon form?)

Thanks :)

Jules gravatar imageJules ( 2018-09-11 16:22:27 +0100 )edit

There are two bugs in Sage regarding this:

  • The method for reduced row echelon form, rref, calls the method echelon_form, and is supposed to pass on the arguments it is given, such as transformation=True, but it does not.

  • The method echelon_form itself does not always honor the request to return the transformation (i.e., the argument transformation=True).

See

slelievre gravatar imageslelievre ( 2018-09-12 00:42:22 +0100 )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

Stats

Asked: 2018-09-10 17:25:45 +0100

Seen: 841 times

Last updated: Sep 10 '18