No transformation matrix returns from m.echelon_form(transformation=True)

71 views
Skip to first unread message

Kwankyu Lee

unread,
Feb 6, 2020, 12:29:16 AM2/6/20
to sage-devel
Hi,

It surprised me to find that my expectation fails:

sage: m = matrix(GF(5), 3, [1,2,3,4,5,6,7,8,9])
sage: m
[1 2 3]
[4 0 1]
[2 3 4]
sage: m.echelon_form(transformation=True)
[1 0 4]
[0 1 2]
[0 0 0]
sage: m = matrix(QQ, 3, [1,2,3,4,5,6,7,8,9])
sage: m.echelon_form(transformation=True)
[ 1  0 -1]
[ 0  1  2]
[ 0  0  0]

No transformation matrix is returned. The docstring of echelon_form() says

   * "transformation" -- boolean. Whether to also return the
     transformation matrix. Some matrix backends do not provide this
     information, in which case this option is ignored.

So the chosen algorithm by default does not produce a transformation matrix! Then how can I get one?

On the other hand, I get, as expected

sage: m = matrix(GF(5), 3, [1,2,3,4,5,6,7,8,9])
sage: m
[1 2 3]
[4 0 1]
[2 3 4]
sage: m.hermite_form(transformation=True)
(
[1 2 3]  [1 0 0]
[0 2 4]  [1 1 0]
[0 0 0], [1 3 1]
)

I think the correct behavior of echelon_form(transformation=True) is to choose a backend algorithm that actually produce a transformation matrix and provide one, instead of ignoring the user's expectation. Right?

Kwankyu Lee

unread,
Feb 6, 2020, 2:54:56 AM2/6/20
to sage-devel
I solved the first question:

sage: me = m.extended_echelon_form()
sage: p = me.submatrix(0,3)
sage: p * m

Vincent Delecroix

unread,
Feb 9, 2020, 1:18:05 AM2/9/20
to sage-...@googlegroups.com
Le 06/02/2020 à 06:29, Kwankyu Lee a écrit :
> I think the correct behavior of echelon_form(transformation=True) is to
> choose a backend algorithm that actually produce a transformation matrix
> and provide one, instead of ignoring the user's expectation. Right?

I completely agree. The specification of the "transformation" keyword
is extremely bad.

And if a user chooses a wrong combination of "backend" and
"transformation" an error should be raised.

Kwankyu Lee

unread,
Feb 10, 2020, 7:39:28 PM2/10/20
to sage-devel
Reply all
Reply to author
Forward
0 new messages