A problem with IrreducibleRepresentationsDixon in Julia

47 Views Asked by At

I have a question on using GAP in Julia in Jupyter notebook. I am trying to run the following sequence in Julia:

using GAP 
const g =GAP.Globals
G = g.SmallGroup(4,2)
R = g.IrreducibleRepresentationsDixon(G:unitary)

and every time I am obtaining the same outcome:

UndefVarError: `unitary` not defined

Stacktrace:
 [1] top-level scope
   @ In[44]:1

On the other hand, when I perform

using GAP 
const g =GAP.Globals
GAP.evalstr("G:=SmallGroup(4,2);;IrreducibleRepresentationsDixon(G:unitary);")

I get what is needed:

GAP: [ [ f1, f2 ] -> [ [ [ 1 ] ], [ [ 1 ] ] ], [ f1, f2 ] -> [ [ [ -1 ] ], [ [ 1 ] ] ], [ f1, f2 ] -> [ [ [ 1 ] ], [ [ -1 ] ] ], [ f1, f2 ] -> [ [ [ -1 ] ], [ [ -1 ] ] ] ]

However, I don't want to use the evalstr() method, but rather have a GAP group in Julia and find its unitary representations using the command given above. How can I do this?

2

There are 2 best solutions below

0
Max Horn On BEST ANSWER

You should not blindly copy GAP syntax to Julia; while they look superficially similar, they are different. Indeed, in GAP the colon is used to separate "options" from arguments. There is no direct analogue for GAP options in Julia, although they superficially resemble keyword arguments. They actually have quite different semantics, but for convenience, we still map Julia kwargs in GAP.jl to GAP options. So this input should work:

using GAP
const g = GAP.Globals
G = g.SmallGroup(4,2)
R = g.IrreducibleRepresentationsDixon(G; unitary = true)

This is also describer in the GAP.jl manual here -- admittedly not the easiest place to find it. There probably should be an intro section discussing this explicitly.

3
daniya shyanne On

The colon preceding "unitary" in the statement g.IrreducibleRepresentationsDixon(G:unitary) is generating confusion inside the Julia compiler, since colons in Julia are utilized for diverse purposes, like crafting ranges, announcing types, or signifying symbols.

In GAP, the colon syntax is employed to indicate options for functions. Nonetheless, Julia's interface for GAP may not support this syntax outright. Instead, you might need to pass options to GAP functions in a manner that conforms with Julia's conventions.

To circumnavigate this, you can attempt passing the option as a Julia Dict:

using GAP
const g = GAP.Globals
G = g.SmallGroup(4,2)
R = g.IrreducibleRepresentationsDixon(G, Dict(:unitary => true))

This leverages a Julia Dict to set the unitary option to true, which should then be passed on to the GAP function.