On Sat, Aug 20, 2011 at 5:36 AM, Rob Beezer <goo...@beezer.cotse.net> wrote:
> I'm trying to compute some eigenspaces for matrices over number
> fields, mostly because I can, in order to build some doctests.
> Eigenspace routine uses the root_field() method on an irreducible
> factor of a characteristic polynomial to create a field containing
> eigenvalues.  Then the routine tries to grab the generator of that
> field, which seems to be non-existent.
>
> Here's as far as I've gone to isolate the problem.  This looks to me
> like the sequence of commands and constructions incurred by the
> eigenspace routine and the error message is similar, if not
> identical.  The polynomial is just a random one that I've captured for
> reproducible input.
>
> sage: F.<y> = NumberField(x^3+x+1)
> sage: z = polygen(F, 'z')
> sage: p = (16/3*y + 3/31)*z^2 + (-y^2 + 31)*z - 1/2*y^2 - 1
> sage: p.is_irreducible()
> True
> sage: M = NumberField(p, 'w')
> sage: M
> Number Field in w with defining polynomial
> (16/3*y + 3/31)*z^2 + (-y^2 + 31)*z - 1/2*y^2 - 1
> over its base field
> sage: M.gen(0)
>
> <BOOM, lots of PARI error messages>
>
> A bug?  Am I doing something wrong?  If not, is there a workaround?

Certainly there is a bug.  In fact M does have gens: you can assign
g=M.gens() and find that g is a tuple of length 2 whose elements are
of the correct type.  But somehow *displaying* then leads to the
error.  This is very odd since there are lots of examples of elements
of relative number fields in the doctests.l

I was pretty sure that  this is being caused by the fact that you
define M using a non-monic polynomial.  But replacing p by p.monic()
still raises an error. Even M.absolute_field() crashes.

All this probably works as expected when the coefficients of the
polynomials are integral.  But you clearly do not want that in your
case -- you want to be able to find the eigenvalues of a non-integral
matrix!  So I cannot see a workaround, sorry.

John



>
> Thanks,
> Rob
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to 
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to