1

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?

Igor Sikora
  • 123
  • 4
  • I don't think there are many GAP.jl users out there. You will likely get better and quicker help via the OSCAR Slack, see https://www.oscar-system.org/community/ – Max Horn Jul 17 '23 at 10:02

2 Answers2

1

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.

  • Unfortunately, this is an answer from Julia/GAP: ERROR: Error thrown by GAP: Error, second argument must be ordinary character or character list at [deleted] called from ( ) called from read-eval loop at *defin*:0 – Igor Sikora Jul 14 '23 at 13:28
  • 1
    Welcome to Stack Overflow, daniya shyanne! All eight of your answers here since you joined 3 days ago appear likely to be entirely or partially written by AI (e.g., ChatGPT). Please be aware that [posting AI-generated content is not allowed here](//meta.stackoverflow.com/q/421831). If you used an AI tool to assist with any answer, I would encourage you to delete it. We do hope you'll stick around and be a valuable part of our community by posting *your own* quality content. Thanks! – NotTheDr01ds Jul 16 '23 at 00:17
  • 1
    **Readers should review this answer carefully and critically, as AI-generated information often contains fundamental errors and misinformation.** If you observe quality issues and/or have reason to believe that this answer was generated by AI, please leave feedback accordingly. – NotTheDr01ds Jul 16 '23 at 00:17
1

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.

Max Horn
  • 552
  • 4
  • 16