ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Sat, 18 Aug 2012 08:50:12 -0500Conversion between Gap3 and Gap4 elementshttp://ask.sagemath.org/question/9229/conversion-between-gap3-and-gap4-elements/I am using Sage 4.7 with Gap4 (4.4.12) and Gap3 (3.4.4) -- Required for the Chevie package. The issue I am having is with what Sage declares a Gap element. I would like to create an instance of a group in gap3 then use it in sage as a gap element, however since it is a gap3 element not a gap4 element there seems to be some confusion in how sage handles the object (I assume this is due to how Gap4 has been rebuilt -- as noted in the documentation). The question I have, is there any function or method which will convert a gap3 element into a gap4 element which can then be used by Sage?
(I'm fairly new to Gap/Sage so I apologize if my understanding is incorrect)Mon, 13 Aug 2012 07:42:11 -0500http://ask.sagemath.org/question/9229/conversion-between-gap3-and-gap4-elements/Answer by schrod121 for <p>I am using Sage 4.7 with Gap4 (4.4.12) and Gap3 (3.4.4) -- Required for the Chevie package. The issue I am having is with what Sage declares a Gap element. I would like to create an instance of a group in gap3 then use it in sage as a gap element, however since it is a gap3 element not a gap4 element there seems to be some confusion in how sage handles the object (I assume this is due to how Gap4 has been rebuilt -- as noted in the documentation). The question I have, is there any function or method which will convert a gap3 element into a gap4 element which can then be used by Sage?</p>
<p>(I'm fairly new to Gap/Sage so I apologize if my understanding is incorrect)</p>
http://ask.sagemath.org/question/9229/conversion-between-gap3-and-gap4-elements/?answer=13943#post-id-13943For future use to others, I have found a fix that works for my purposes (it isn't a true conversion). I was trying to generate a complex reflection group using gap3/chevie then do sage commands on that said group. The issue was that gap3 objects are not recognized by sage as appropriate objects for function input (where gap4 objects are).
How I got around this:
from sage.groups.perm_gps.pergroup_element import string_to_tuples
complexReflectGroup = gap3.ComplexReflectionGroup(2,2,2);
groupGenerators = [];
for generator in gap3.Generators(complexReflectGroup):
fullGenerators.append(string_to_tuples(str(generator)));
complexReflectGroup = PermutationGroup(groupGenerators);
With that code I can use my gap3 generated group with sage (through the conversion of the generators). I now can run sage commands on that group.
Sat, 18 Aug 2012 08:50:12 -0500http://ask.sagemath.org/question/9229/conversion-between-gap3-and-gap4-elements/?answer=13943#post-id-13943