#15027: Inconsistent primitive_root_of_unity for number fields
-------------------------------------+--------------------------
Reporter: cremona | Owner: cremona
Type: defect | Status: needs_work
Priority: major | Milestone: sage-5.12
Component: number fields | Resolution:
Keywords: number field unit | Merged in:
Authors: John Cremona | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
-------------------------------------+--------------------------
Changes (by fwclarke):
* status: needs_review => needs_work
Comment:
Here's a strange thing. If I apply the patch (to 5.11), build and test,
everything is fine. But if I restart Sage and type
{{{
sage: K =Â QuadraticField(-3)
sage: K.primitive_root_of_unity()1/2*a + 1/2
}}}
I get
{{{
1/2*a + 1/2
}}}
rather than the
{{{
-1/2*a + 1/2
}}}
in the doctest.
Now if edit the doctest to read
{{{
sage: K = QuadraticField(-3, 'b')
sage: K.primitive_root_of_unity()
-1/2*b + 1/2
sage: UK = K.unit_group()
sage: K.primitive_root_of_unity()
-1/2*b + 1/2
}}}
rebuild and test I get
{{{
Failed example:
K.primitive_root_of_unity()
Expected:
-1/2*b + 1/2
Got:
1/2*b + 1/2
}}}
The reason that there is no failure when the generator has the default
name `'a'` is caused by the fact that the unit group of this field has
already been computed in a doctest for the `S_units` method. Thus as
written the doctest is not testing that the problem has been fixed, since
both instances of `K.primitive_root_of_unity()` use the same code.
--
Ticket URL: <http://trac.sagemath.org/ticket/15027#comment:8>
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 http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/groups/opt_out.