Ask Your Question
1

echelon_form not giving reduced echelon form

asked 2016-11-30 15:37:37 +0100

sunqingyao gravatar image

According to the document(emphasis mine):

echelon_form(algorithm='default', cutoff=0, **kwds)

Return the echelon form of self.

OUTPUT:

The reduced row echelon form of self, as an immutable matrix.

Here is what I was doing:

sage: A = Matrix([[1,0,3,1,2],[-1,3,0,-1,1],[2,1,7,2,5],[4,2,14,0,6]])
sage: A.echelon_form()

[1 0 3 1 2]
[0 1 1 0 1]
[0 0 0 4 4]
[0 0 0 0 0]

While the result is in row echelon form, it's not in reduced row echelon form. What I expect is something like this:

[1 0 3 0 1]
[0 1 1 0 1]
[0 0 0 1 1]
[0 0 0 0 0]

Also, if this is merely a documentation bug, how can I get the reduced row echelon form of a matrix?

edit retag flag offensive close merge delete

Comments

1
kcrisman gravatar imagekcrisman ( 2016-11-30 17:01:57 +0100 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-11-30 16:34:17 +0100

nbruin gravatar image

For your matrix you have:

sage: A.parent()
Full MatrixSpace of 4 by 5 dense matrices over Integer Ring

so it's a matrix over the integers. There "echelon form" means "Hermite normal form", which is what you got (the transition matrix is an integer matrix with an inverse that is also an integer matrix in that case. That's why the row [0 0 0 4 4] doesn't get scaled)

If you're interested in reduced row echelon form over the rationals, you can get that:

sage: B=A.change_ring(QQ)
sage: B.echelon_form()
[1 0 3 0 1]
[0 1 1 0 1]
[0 0 0 1 1]
[0 0 0 0 0]
edit flag offensive delete link more

Comments

1

On the Stackoverflow one though the question is whether the "Hermite normal form" or whatever actually should be called a reduced form or not. Perhaps that is a subtle doc bug, even given our usual answer where the base ring matters? I just don't know whether there is a standard terminology in the non-field case for "reduced".

kcrisman gravatar imagekcrisman ( 2016-11-30 17:05:15 +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

1 follower

Stats

Asked: 2016-11-30 15:24:42 +0100

Seen: 2,770 times

Last updated: Nov 30 '16