ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 11 Nov 2021 17:15:36 +0100Implementing Subgroupshttps://ask.sagemath.org/question/59688/implementing-subgroups/I created my own implementation of a specific group, inheriting from Group, following the pattern in the tutorial here:
https://doc.sagemath.org/html/en/thematic_tutorials/coercion_and_categories.html
I can construct elements, multiply them and find inverses.
My group is infinite, but I know that any finitely generated subgroup is finite. I'd like to have something where I can do:
sage: G = myGroup()
sage: g_1,g_2,g3 = some elements of G
sage: G2 = G.subgroup([g1,g2])
sage: g3 in G2
True/False
sage: G2.order()
35
sage: G2.list_elements()
...
My question is, do I have to implement this all "from scratch", or can sage already do most if this if I've implemented the multiplication? How do I make it work with the category framework, so G1 is a group, and has a cannonical conversion to G? (if that is the right thing to want.)
paragonThu, 11 Nov 2021 17:15:36 +0100https://ask.sagemath.org/question/59688/