Ask Your Question

How to test with whether a group is cyclic?

asked 2018-03-23 13:07:01 -0500

Peter Heinig gravatar image

Does Sage offer a 'native' way to test whether a group is cyclic?

Remarks. Needless to say, Sage offers commands like 'is_abelian()' or 'is_finite()', but wherever I look, nothing like 'is_cyclic'.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2018-03-25 10:38:09 -0500

As @dan_fulea says, it depends on the class of the group:

sage: search_def('is_cyclic')
groups/abelian_gps/    def is_cyclic(self):
groups/additive_abelian/    def is_cyclic(self):
groups/perm_gps/    def is_cyclic(self):
plot/            def is_cyclic_ordered(x1, x2, x3):
rings/finite_rings/    def multiplicative_group_is_cyclic(self):

The command search_def searches for the given string as part of the definition of a function or method, so you can see that is_cyclic is defined for abelian groups, additive abelian groups, and permutation groups.

edit flag offensive delete link more

answered 2018-03-23 13:53:03 -0500

dan_fulea gravatar image

Please declare an explicit group, the class of it is important. For instance:

sage: G = DihedralGroup(8)
sage: G.is_cyclic()
sage: G.gens()
[(1,2,3,4,5,6,7,8), (1,8)(2,7)(3,6)(4,5)]


sage: G = SymmetricGroup(3)
sage: for H in G.subgroups():
....:     print "gens=%s order=%s abelian=%s cyclic=%s" % (H.gens(), H.order(), H.is_abelian(), H.is_cyclic())
gens=[()] order=1 abelian=True cyclic=True
gens=[(2,3)] order=2 abelian=True cyclic=True
gens=[(1,2)] order=2 abelian=True cyclic=True
gens=[(1,3)] order=2 abelian=True cyclic=True
gens=[(1,2,3)] order=3 abelian=True cyclic=True
gens=[(2,3), (1,2,3)] order=6 abelian=False cyclic=False


sage: AbelianGroup(1).is_cyclic()
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-03-23 13:07:01 -0500

Seen: 49 times

Last updated: Mar 25