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?