-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a GAP notebook example. #5
Conversation
Thanks! Some notes:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have added a few comments.
If this example is regarded as interesting, would it make sense to add also the text comments?
RubiksCubeGAP.ipynb
Outdated
} | ||
], | ||
"source": [ | ||
"f = @gap(\"FreeGroup(\\\"t\\\", \\\"l\\\", \\\"f\\\", \\\"r\\\", \\\"e\\\", \\\"b\\\")\")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
G.FreeGroup( g"t", g"l", g"f", g"r", g"e", g"b" )
is more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've actually changed that to triple quotes in the meantime, but illustrating the use of GAP strings (which I didn't know about) would be more interesting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yet another variant: G.FreeGroup(to_gap(["t", "l", "f", "r", "e", "b"]))
. All of these have pros and cons. In the end, it depends on taste.
RubiksCubeGAP.ipynb
Outdated
} | ||
], | ||
"source": [ | ||
"pre1 = G.PreImagesRepresentative(hom, GAP.call_gap_func(@gap(\"x -> x.1\"), z) )" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the moment, G.PreImagesRepresentative(hom, G.GeneratorsOfGroup(z)[1])
would look more natural.
The GAP syntax z.1
belongs to a special method only for groups, but if it would be regarded as interesting, one could make it available also in Julia. (I would not be in favor of this.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm. I've figured out in the meantime that GAP functions can actually be called directly, e.g @gap("x -> x + 1")(z)
; this might be illustrative, but I think your approach is more idiomatic. I'll think about that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can also just write pre1 = G.PreImagesRepresentative(hom, z.:1)
I can't judge myself whether this is useful for a wider audience; I simply picked the first large example on the GAP website and adapted it. I figured that even if it is not of interest for the examples on the OSCAR website (which I think is more about adding examples relevant to the overall TRR project), it can still serve educational purposes. I'll be happy to adapt the comments from the original code if people think this example is useful. I simply wanted to get something workable out first. |
I think it's useful, and adding the comments would be good. |
I've added descriptive text and added some more comments on the specifics of using this with GAP.jl. The notebook can be viewed here directly. |
@rbehrends Can you please update this, now that GAP.jl 0.4.0 is out (so e.g. |
Also you shouldn't need |
This is a very mechanical translation of the Rubik's Cube Example, meant to address issue #3. It currently still misses text annotations and has its share of ugliness.
I also noticed that the pre-image computations gave different results, but haven't yet looked into the underlying causes.