Ask Your Question
2

How to test with whether a group is cyclic?

asked 6 years ago

Peter Heinig gravatar image

updated 5 years ago

FrédéricC 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'.

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
2

answered 6 years ago

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()
False
sage: G.gens()
[(1,2,3,4,5,6,7,8), (1,8)(2,7)(3,6)(4,5)]

Also

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

and

sage: AbelianGroup(1).is_cyclic()
True
Preview: (hide)
link
2

answered 6 years ago

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

sage: search_def('is_cyclic')
groups/abelian_gps/abelian_group.py:1037:    def is_cyclic(self):
groups/additive_abelian/additive_abelian_group.py:372:    def is_cyclic(self):
groups/perm_gps/permgroup.py:3482:    def is_cyclic(self):
plot/arc.py:221:            def is_cyclic_ordered(x1, x2, x3):
rings/finite_rings/integer_mod_ring.py:818:    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.

Preview: (hide)
link

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

Stats

Asked: 6 years ago

Seen: 1,476 times

Last updated: Mar 25 '18