Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

multiplicative_subgroups returns only lists of generators, rather than proper group objects. This is, in my opinion, unfortunate. You can work it around with a bit of code. This function returns the list of elements spanned by a list G of generators

def list_elts(G):
    exps = [xrange(g.multiplicative_order()) for g in G]
    return [prod(g^e for g, e in zip(G, exp)) for exp in CartesianProduct(*exps)]

So, you may call

sage: R = Zmod(20)
sage: map(list_elts, R.multiplicative_subgroups())
[[1, 17, 9, 13, 11, 7, 19, 3],
 [1, 11, 9, 19],
 [1, 3, 9, 7],
 [1, 11],
 [1, 19],
 [1, 17, 9, 13],
 [1, 9],
 [1]]