#11895: Make p-adic numbers unhashable
-------------------------------------+-------------------------------------
Reporter: mmasdeu | Owner: roed
Type: defect | Status: needs_work
Priority: critical | Milestone: sage-6.4
Component: padics | Resolution:
Keywords: p-adic, hash | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues: one pickle from the
Branch: | pickle jar does not unpickle
u/saraedum/ticket/11895 | correctly
Dependencies: #11670, #15897, | Commit:
#15898, #15956, #16122, #16124, | 42afa4d47da18d38095cd54313731f856ae5f083
#16129, #16250, #16251, #16316, | Stopgaps:
#16317, #16318, #16321, #16339, |
#16341, #16342 |
-------------------------------------+-------------------------------------
Comment (by saraedum):
Replying to [comment:43 vbraun]:
> The ticket description mentions a problem when comparing `x==0`, but
that is incorrect. Comparison first coerces both sides to a common parent,
and if the rhs is a Python int then this will be the same padic ring as
`x`. So if `==` were to compare both sides including the precision we'd
still be fine. Of course when comparing two padics you coerce to the lower
precision, so the main issue remains.
I'm not sure I understand. Say you are in Qp with 2 digits of precision.
Then 0 coerces to `O(p^2)`. Setting `x=O(p)` gives `x != 0` when including
precisions in the comparison.
> Just making elements not hashable is also terrible, many algorithms use
sets and dicts. E.g. if the coefficient field is not hashable then you
can't compute groebner bases in polynomial rings, rendering it essentially
useless.
I agree that disabling hashing has its drawbacks but I do not see an
alternative. Judging from the doctests, not that many things break,
actually. But I guess that some algorithms have to be modified to support
unhashable elements if we want to use them with p-adic numbers.
--
Ticket URL: <http://trac.sagemath.org/ticket/11895#comment:44>
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/d/optout.