#6391: libGAP! -- create a Cython library interface to gap
---------------------------+------------------------------------------------
Reporter: was | Owner: was
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-4.7
Component: interfaces | Keywords:
Author: | Upstream: N/A
Reviewer: | Merged:
Work_issues: |
---------------------------+------------------------------------------------
Comment(by vbraun):
Replying to [comment:9 was]:
> This log pretty much explains what/why/what next:
{{{
sage: import sage.libs.gap.gap as g
sage: a = g.libgap('10')
sage: a
10
sage: type(a)
<type 'sage.libs.gap.gap.GapElement'>
sage: a*a
100
sage: timeit('a*a')
625 loops, best of 3: 898 ns per loop
sage: b = gap('10')
sage: timeit('b*b')
125 loops, best of 3: 2.05 ms per loop
sage: a = g.libgap('0')
sage: a
0
sage: b = g.libgap('10')
sage: b/a
---------------------------------------------------------------------------
ValueError Traceback (most recent call
last)
/home/vbraun/opt/sage-4.7.alpha1/devel/sage-main/sage/libs/gap/<ipython
console> in <module>()
/home/vbraun/Sage/sage/local/lib/python2.6/site-
packages/sage/structure/element.so in
sage.structure.element.RingElement.__div__
(sage/structure/element.c:12696)()
/home/vbraun/Sage/sage/local/lib/python2.6/site-
packages/sage/libs/gap/gap.so in sage.libs.gap.gap.GapElement._div_
(sage/libs/gap/gap.c:4443)()
613 except RuntimeError, msg:
614 ClearError()
--> 615 raise ValueError, 'Gap: '+str(msg)
616
617
ValueError: Gap: Rational operations: <divisor> must not be zero
}}}
I'm currently adding code to access Gap containers, e.g.
{{{
sage: S4 = g.libgap('SymmetricGroup(4)')
sage: S4.List()
[ (), (1,4), (1,2,4), (1,3,4), (2,4), (1,4,2), (1,2), (1,3,4,2), (2,3,4),
(1,4,2,3), (1,2,3), (1,3)(2,4), (3,4), (1,4,3), (1,2,4,3), (1,3), (2,4,3),
(1,4,3,2), (1,2)(3,4), (1,3,2), (2,3), (1,4)(2,3), (1,2,3,4), (1,3,2,4) ]
sage: S4_elements = _
sage: type(S4_elements)
<type 'sage.libs.gap.gap.GapElement_List'>
sage: S4_elements[3]
(1,3,4)
sage: prod( g for g in S4_elements )
(1,3)(2,4)
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6391#comment:37>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.