#20827: Use WithEqualityById for number fields
-------------------------------------+-------------------------------------
Reporter: pbruin | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-7.3
Component: number fields | Resolution:
Keywords: | Merged in:
Authors: Peter Bruin | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/pbruin/20827-NumberField_unique | 959237a9655a15daa1c667aee67a2e9a805e6ab1
Dependencies: #20826 | Stopgaps:
-------------------------------------+-------------------------------------
Changes (by pbruin):
* cc: saraedum, SimonKing (added)
Old description:
> Number fields currently have "partial unique representation": they are
> created by a `UniqueFactory`, but can still compare equal without being
> identical. The goal of this ticket is to make number fields inherit from
> `WithEqualityById`, so that they fully satisfy unique representation: the
> conditions of being identical, being equal and having the same defining
> data are all equivalent.
>
> Apart from this simplification, this fixes a known bug in pickling
> relative number fields, where the structure used to be lost (see
> comment:21:ticket:11670).
>
> One more user-visible change is that equality of number fields now
> depends on the variable name of the defining polynomial:
> {{{
> NumberField(polygen(QQ, 'x')^2 + 2, 'a') == NumberField(polygen(QQ,
> 'y')^2 + 2, 'a')
> }}}
> used to return `True`, after this ticket it returns `False`. In the
> future, the polynomial variable can perhaps be normalised (either to `x`
> or to the name of the generator of the number field), so that only one
> variable name is part of the defining data of a number field. The above
> number field could then simply be printed as `Number Field in a defined
> by a^2 + 2 = 0`.
New description:
Number fields currently have "partial unique representation": they are
created by a `UniqueFactory`, but can still compare equal without being
identical. The goal of this ticket is to make number fields inherit from
`WithEqualityById`, so that they fully satisfy unique representation: the
conditions of being identical, being equal and having the same defining
data are all equivalent. This can be viewed as a follow-up to #11670; see
also the comments there.
Apart from this simplification, this fixes a known bug in pickling
relative number fields, where the structure used to be lost (see
comment:21:ticket:11670).
One more user-visible change is that equality of number fields now depends
on the variable name of the defining polynomial:
{{{
NumberField(polygen(QQ, 'x')^2 + 2, 'a') == NumberField(polygen(QQ, 'y')^2
+ 2, 'a')
}}}
used to return `True`, after this ticket it returns `False`. In the
future, the polynomial variable can perhaps be normalised (either to `x`
or to the name of the generator of the number field), so that only one
variable name is part of the defining data of a number field. The above
number field could then simply be printed as `Number Field in a defined by
a^2 + 2 = 0`.
--
--
Ticket URL: <http://trac.sagemath.org/ticket/20827#comment:4>
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.