Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matrix rank should call echelon_form over *fraction field* #5014

Closed
williamstein opened this issue Jan 18, 2009 · 7 comments
Closed

matrix rank should call echelon_form over *fraction field* #5014

williamstein opened this issue Jan 18, 2009 · 7 comments

Comments

@williamstein
Copy link
Contributor


On Sun, Jan 18, 2009 at 6:49 AM, Paul Zimmermann <Paul.Zimmermann@loria.fr> wrote:
>       Hi,
>
> I hit the following:
>
> sage: P.<x> = PolynomialRing(GF(17))
> sage: m = Matrix(P,2,2)
> sage: m.randomize(); m
>
> [ 6*x^2 + 8*x + 12 10*x^2 + 4*x + 11]
> [8*x^2 + 12*x + 15  8*x^2 + 9*x + 16]
> sage: m.rank()
> ...
> NotImplementedError: echelon form over Univariate Polynomial Ring in x over Finite Field of size 17 not yet implemented
>
> Isn't that provided by either GP or Linbox?

Yes, by gp.  I have no idea if it is in Linbox.

sage: gp(m).matrank()
2
sage: pari(m).matrank()
boom -- matrank not wrapped

Somebody *could* implement this by wrapping pari's matrank then doing the conversion and calling it.  Of course, much better would be to do:

sage: m.change_ring(m.base_ring().fraction_field()).rank()
2

which already works. 

I am puzzled that rank doesn't first change base to the fraction field, *then* call echelon form -- it's stupid that it tries to call echelon form over the same base ring, since that is often much harder (e.g., it is Hermite form over ZZ).

William

CC: @orlitzky

Component: linear algebra

Author: Michael Orlitzky

Reviewer: Andrey Novoseltsev

Merged: sage-5.0.beta1

Issue created by migration from https://trac.sagemath.org/ticket/5014

@williamstein williamstein added this to the sage-4.8 milestone Jan 18, 2009
@williamstein williamstein self-assigned this Jan 18, 2009
@jasongrout
Copy link
Member

comment:1

See #3211 for a related ticket, sort of.

@sagetrac-dsm
Copy link
Mannequin

sagetrac-dsm mannequin commented May 23, 2011

comment:2

This seems to work now:


sage: version()
'Sage Version 4.6.2, Release Date: 2011-02-25'
sage: P.<x> = PolynomialRing(GF(17))
sage: m = Matrix(P,2,2)
sage: m.randomize()
sage: m
[     15*x^2 + 16*x  9*x^2 + 12*x + 12]
[13*x^2 + 16*x + 16   4*x^2 + 5*x + 12]
sage: m.rank()
2

@orlitzky
Copy link
Contributor

orlitzky commented Jan 8, 2012

Attachment: sage-trac_5014.patch.gz

Add a doctest computing the rank of one of these matrices.

@orlitzky
Copy link
Contributor

orlitzky commented Jan 8, 2012

Author: Michael Orlitzky

@orlitzky
Copy link
Contributor

orlitzky commented Jan 8, 2012

comment:3

This works now; I've added a doctest using the example in the description.

@novoselt
Copy link
Member

Reviewer: Andrey Novoseltsev

@jdemeyer
Copy link

Merged: sage-5.0.beta1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants