Hello,

Kevin Buzzard <[email protected]> wrote:

> In my student's original code, he didn't even _need_ access to the
> variable name that he gave when running q_eigenform; he just needed to
> compute the valuation of a specific element of the number field he was
> creating, at a prime ideal he was about to create by factoring a
> rational prime number. If creating variable names for number fields is
> so fraught with difficulty, is there any way of avoiding this
> completely? My memory was that in magma you could just build a number
> field from a polynomial and if you didn't give it a variable name
> which was to correspond to a root of the polynomial then magma would
> just name it something like $.1 and not worry about it any more.

Creating number fields without a variable name is not possible in Sage.
There is nothing fundamentally against creating two number fields with
the same variable name; this _should_ not cause any problems.  However,
distinguishing two relative number fields with the same variable name is
apparently not done correctly when creating polynomial rings:

sage: k.<zeta10> = CyclotomicField(10)
sage: R.<x> = PolynomialRing(k)
sage: K.<alpha> = k.extension(x^2 + (zeta10 + 1)*x + zeta10^2 - 2*zeta10 + 1)
sage: L.<alpha> = k.extension(x^2 + (zeta10^3 + 1)*x - 2*zeta10^3 - zeta10 + 1)
sage: K is L
False
sage: K.absolute_polynomial() == L.absolute_polynomial()
True
sage: A = PolynomialRing(K, 'x')
sage: B = PolynomialRing(L, 'x')
sage: A is B
True

It looks like PolynomialRing constructor only compares the _absolute_
defining polynomials and the variable names of K and L, but this is not
enough since K and L have different _relative_ defining polynomials.
I suspect that this is the underlying problem in both the q_eigenform
bug and an older bug report about roots of polynomials over relative
number fields <http://trac.sagemath.org/ticket/18942>.

> This is the situation I think we're in here -- but in sage
> f.q_eigenform(10,'') and f.q_eigenform(10) both throw ValueErrors. I
> am now terrified to write any code containing loops and q_eigenform!
> Even running the same code twice in a session sounds to me to be
> dangerous.

Indeed, if it is indeed the case that this bug occurs whenever you have
two different relative number fields constructed in different ways but
with the same absolute defining polynomial and the same variable name,
then this situation is likely to come up when you run through a family
of Hecke eigenvalue fields.

Peter

-- 
You received this message because you are subscribed to the Google Groups 
"sage-nt" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
Visit this group at https://groups.google.com/group/sage-nt.
For more options, visit https://groups.google.com/d/optout.

Reply via email to