#18158: wrap more libgap objects as `GapElement_List`
-------------------------------------+-------------------------------------
Reporter: vdelecroix | Owner:
Type: defect | Status: needs_review
Priority: major | Milestone: sage-7.2
Component: interfaces | Resolution:
Keywords: | Merged in:
Authors: Vincent Delecroix | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
u/vdelecroix/18158 | dbf8aeac7bdcb1c458711b9c4d2f57a6d4fbac1c
Dependencies: | Stopgaps:
-------------------------------------+-------------------------------------
Old description:
> Some objects in GAP are not PList but does support indexation.
> {{{
> gap> gens := GeneratorsOfGroup(SL(2,GF(5)));;
> gap> m := gens[1];;
> gap> m[1];
> [ Z(5), 0*Z(5) ]
> gap> m[2];
> [ 0*Z(5), Z(5)^3 ]
> }}}
> Sage currently fails to recognize them as lists
> {{{
> sage: gens = libgap.GeneratorsOfGroup(SL(2,GF(5)))
> sage: m = gens[0]
> sage: m[0]
> Traceback (most recent call last):
> ...
> TypeError: 'sage.libs.gap.element.GapElement' object has no attribute
> '__getitem__'
> }}}
>
> In this branch:
>
> - We change the way gap lists are detected and hence more objects are
> now wrapped as `GapElement_List`. In particular we make possible the
> access to elements in the above example.
>
> - we move the methods `vector` and `matrix` to `GapElement_List`
New description:
Some objects in GAP are not PList but does support indexation.
{{{
gap> S := SymmetricGroup(5);;
gap> irr := Irr(S);;
gap> irr[3][1];
5
}}}
or
{{{
gap> gens := GeneratorsOfGroup(SL(2,GF(5)));;
gap> m := gens[1];;
gap> m[1];
[ Z(5), 0*Z(5) ]
gap> m[2];
[ 0*Z(5), Z(5)^3 ]
}}}
And Sage currently fails to recognize them as lists
{{{
sage: S = libgap.SymmetricGroup(5)
sage: irr = S.Irr()[3]
sage: irr[0]
Traceback (most recent call last):
...
TypeError: 'sage.libs.gap.element.GapElement' object has no attribute
'__getitem__'
sage: gens = libgap.GeneratorsOfGroup(SL(2,GF(5)))
sage: m = gens[0]
sage: m[0]
Traceback (most recent call last):
...
TypeError: 'sage.libs.gap.element.GapElement' object has no attribute
'__getitem__'
}}}
In this branch:
- We change the way gap lists are detected and hence more objects are now
wrapped as `GapElement_List`. In particular we make possible the access to
elements in the above example.
- we move the methods `vector` and `matrix` to `GapElement_List`
--
Comment (by vdelecroix):
Is the description helpful enough? I can revamp the commits if you like.
--
Ticket URL: <http://trac.sagemath.org/ticket/18158#comment:18>
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.