Is there a command in SAGE which is equivalent to GAP's "ShallowCopy" ?

asked 2019-11-20 10:19:52 -0500

Bern gravatar image

updated 2020-06-01 03:53:03 -0500

FrédéricC gravatar image

Dear SAGE forum,

I'd like to ask the following question:

Is there an equivalent in SAGE of GAP's "shallowcopy" ?

I'd like to associate to two times the same group two different character tables.

In GAP it is possible to do it as follows:


and to then construct a different character table for H.

When I try to do this in SAGE, I always get the error message that G (!) already has a character table, although I wanted to assign a different (as far as the ordering of the rows and columns are concerned) character table to H (!)

EDIT (20.11.2019):

Here is part of my sage code:


# Hier Einschub: CTBL wie in CTBLLib (falls vorhanden) wird nun gemacht:

def CTBL_Breuer_fert(X):
  StrDescr = gap.StructureDescription(X)
  if gap.IsString(gap.StructureDescription(X)):
    StrDescr = gap.StructureDescription(X)
    CTBL_Breuer = gap.CharacterTable(StrDescr)
    CTBL_Breuer_fertig = gap.CharacterTableWithStoredGroup(X,CTBL_Breuer)
    CTBL_Breuer_fertig = gap.CharacterTable(X)

CTBL_Breuer_fertig = CTBL_Breuer_fert(HHHH)

# Hier Ende des Einschubs

ccl = [gap.ConjugacyClass(GGGG,x) for x in MAGMA_ccls_GG_for_GAP]


MyRecordFile = open("GAP_Record.txt",'w')
print >> MyRecordFile, "bij:=",
print >> MyRecordFile, bij,
print >> MyRecordFile, ";"
print >> MyRecordFile, "myrecfunct:=function()"
print >> MyRecordFile, "local RECOR;"
print >> MyRecordFile, "RECOR:=rec(bijection:=bij);"
print >> MyRecordFile, "return RECOR;"
print >> MyRecordFile, "end;"


After this last line (with CTBL=...) the error occurs. When I delete the lines between "# Hier Einschub..." and "# Hier Ende des Einschubs ", then the code works.

I would be grateful for any help.

Thanks in advance.

edit retag flag offensive close merge delete



What exactly did you try in Sage?

Iguananaut gravatar imageIguananaut ( 2019-11-20 10:56:52 -0500 )edit

Thank you very much for your comment. I edited the question.

Bern gravatar imageBern ( 2019-11-20 13:09:18 -0500 )edit

By the way: The error message is as follows: RuntimeError: Gap produced error output Error, < G > has already a character table

Bern gravatar imageBern ( 2019-11-21 09:48:15 -0500 )edit

I'm not sure you're really asking the right question with "Does Sage have an equivalent to ShallowCopy?" When you're working almost entirely with GAP objects, only functions in GAP would know how to do operations that dig into the details of GAP objects, such as ShallowCopy. The question is why are you having this problem in Sage. I don't know the immediate answer, but looking for a "Sage equivalent to ShallowCopy" is definitely going to lead you down the wrong path.

Iguananaut gravatar imageIguananaut ( 2019-11-25 05:21:15 -0500 )edit

Anyways I can't reproduce your problem because you didn't specify what iso is. In StackOverflow parlance, please provide a Minimal, Complete, Verifiable Example of the problem.

Iguananaut gravatar imageIguananaut ( 2019-11-25 05:26:20 -0500 )edit