Ask Your Question

Revision history [back]

Create group with custom set and operator

Hi, I know that we can use Sage to create an instance of a predefined group like so:

H = DihedralGroup(6)

But instead of using a predefined group, can I also create a group instance having a predefined set (for example a set of natural numbers) and a custom binary operator (such as multiplication modulo N) ?

What I'm looking for is something like this:

G = new Group({1, 2, 3, 4}, (a, b) -> a * b mod 10)

And then generate the group table for G.

If someone could provide me with an code example it'd be great, I wasn't able to derive it from the docs I read.