On Saturday, December 24, 2016 at 11:20:32 PM UTC, Dima Pasechnik wrote:
>
>
>
> On Saturday, December 24, 2016 at 3:38:43 PM UTC, Enrique Artal wrote:
>>
>> I need to use a gap package which is not installed by sage, namely nq. I 
>> have been able to install it using wiki instructions and I can use it in a 
>> gap session inside sage: e.g., 
>>
>> LowerCentralFactors(FreeGroup(1),1);
>>
>> after the package has been loaded. In a sage session the following code 
>> works 
>>
>> gap_reset_workspace()
>> gap.LoadPackage('"nq"')
>> F0=gap.FreeGroup(1)
>> gap.LowerCentralFactors(F0,1)
>>
>> but not the following one
>>
>> gap.LowerCentralFactors(FreeGroup(1).gap(),1)
>>
>
> I'd suggest using libgap. rather than gap., in particular as Sage's 
> FreeGroup is implemented using libgap
> interface. So the last command needs to cross from GAP to libGAP 
> interface, and this might be flaky.
>

indeed, the following works (afer installing nq):

sage: libgap.LowerCentralFactors(FreeGroup(1),1)
[ [ 0 ] ]
sage: libgap.LoadPackage('nq') # single ' here!
true
sage: F0=libgap.FreeGroup(1)
sage: libgap. (F0,1)
[ [ 0 ] ]
sage: libgap.LowerCentralFactors(FreeGroup(1),1)
[ [ 0 ] ]
  
To make this work you will need to edit the file
SAGE_ROOT/src/sage/libs/gap/gap_functions.py
and add the line

  'LowerCentralFactors',

into the long list of GAP functions there. 
(And probably more functions from the package
need to be added to be callable this way)

we will need to automate this at some point...

Don't forget to run 'sage -b' for this change to take effect.

HTH
Dima


>
>  
>
>>
>> Thanks, Enrique
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to