#19038: Better hash on FPGroups
---------------------------+------------------------
Reporter: nbruin | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.9
Component: algebra | Resolution:
Keywords: | Merged in:
Authors: | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
Dependencies: | Stopgaps:
---------------------------+------------------------
Comment (by nbruin):
One case Gap can handle is that of finite groups:
{{{
sage: G.<a,b>=FreeGroup()
sage: A5=G.quotient([a^3,b^3,(a/b/a/b)^2,(a^(-1)*b/a/b)^2])
}}}
and we're getting it wrong presently. (Perhaps if #19016 gets fixed, we
just won't have a hash at all)
{{{
sage: A5(a^3)==A5(1)
True
sage: hash(A5(a^3))==hash(A5(1))
False
}}}
We can improve the situation in the following way:
{{{
FamilyObj=libgap.function_factory("FamilyObj")
ElementsFamily=libgap.function_factory("ElementsFamily")
FPFaithHom=libgap.function_factory("FPFaithHom")
Image=libgap.function_factory("Image")
}}}
whith these definitions:
{{{
sage: f=FPFaithHom(ElementsFamily(FamilyObj(A5.gap())))
sage: newhash=lambda a: hash(Image(f,a.gap()))
sage: newhash(A5(a^3))==newhash(A5(1))
True
sage: import collections
sage: collections.Counter((u==v,newhash(u)==newhash(v) ) for (u,v) in (
(A5.random_element(),A5.random_element()) for j in range(6000)) )
Counter({(False, False): 5899, (True, True): 101})
}}}
Gap correctly find from this finite presentation that the group is A5 and
the map f is its standard permutation representation in Sym(6).
--
Ticket URL: <http://trac.sagemath.org/ticket/19038#comment:1>
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.