#19956: elements of finite field algebraic closure are not hashable
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-7.1
Component: finite rings | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/19956 | 4f4f231e4605f01f029fefd1889359df7fe88262
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by vdelecroix):
Replying to [comment:5 jdemeyer]:
> It would already be slightly more efficient to remove the branch and
double `hash` and do something like
> {{{
> return hash(x) + (F.degree() - 1) * 1009
> }}}
True for efficiency. But there will be collisions sooner. The reason is
that `map(hash, GF(q))` is `[0, 1, ..., q-1]`. Maybe it was a bad choice
for `GF(q)`? What about something like
{{{
return (hash(x) + deg * p1) ^ ((deg - 1) * p2)
}}}
I am not sure about the optimal size of `p1` and `p2`... But you are right
anyway, I should get rid of the branch!
--
Ticket URL: <http://trac.sagemath.org/ticket/19956#comment:6>
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.