Ask Your Question

Revision history [back]

Here's a way:

n = 12
G = AdditiveAbelianGroup([n])
from collections import defaultdict
subgroup_gens = defaultdict(list)
for g in G:
mylabel = lambda H: LatexExpr('$' + '='.join('\\langle ' + str(g) + ' \\rangle' for g in subgroup_gens[H]) + '$')
Graph([(mylabel(H),mylabel(K)) for H in subgroup_gens.keys() for K in subgroup_gens.keys() if H != K and H.is_submodule(K)]).plot(figsize=6)

additive subgroups of Z/12Z