First time here? Check out the FAQ!

Ask Your Question
1

echelon_form not giving reduced echelon form

asked 8 years ago

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?

Preview: (hide)

Comments

1
kcrisman gravatar imagekcrisman ( 8 years ago )

1 Answer

Sort by » oldest newest most voted
2

answered 8 years ago

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]
Preview: (hide)
link

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 ( 8 years ago )

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: 8 years ago

Seen: 3,037 times

Last updated: Nov 30 '16