#15348: "R.<a> =" syntactic sugar incorrect for EquationOrder
-------------------------------------+-------------------------------------
Reporter: emassop | Owner:
Type: defect | Status: positive_review
Priority: major | Milestone: sage-7.0
Component: number fields | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/jdemeyer/ticket/15348 | bae80ec1d10ab8d499f830016df8beddecdb404f
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Description changed by emassop:
Old description:
> After typing
> {{{
> sage: f = x^2+1
> sage: R.<i> = ZZ.extension(f)
> }}}
> I expect variable {{{i}}} to be the element of {{{R}}} named {{{'i'}}}.
> However, it is not. It is the element 1.
>
> This is due to the generators of an order in Sage being its //module//
> generators (as noted by {{{EquationOrder?}}}):
> {{{
> sage: R.gens()
> [1, i]
> }}}
>
> We fix this by redefining `_first_ngens()` (which is what the preparser
> uses to implement the `R.<x> =` syntax) to use `ring_generators()` if
> such an attribute exists.
New description:
After typing
{{{
sage: f = x^2+1
sage: R.<i> = ZZ.extension(f)
}}}
I expect variable {{{i}}} to be the element of {{{R}}} named {{{'i'}}}.
However, it is not. It is the element 1.
This is due to the generators of an order in Sage being its //module//
generators (as noted by {{{EquationOrder?}}}):
{{{
sage: R.gens()
[1, i]
}}}
We fix this by redefining `_first_ngens()` (which is what the preparser
uses to implement the `R.<x> =` syntax) to use `_defining_names()`, which
we override for orders.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/15348#comment:46>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.