Ask Your Question
2

How to test with whether a group is cyclic?

asked 2018-03-23 19:07:01 +0200

Peter Heinig gravatar image

updated 2019-08-26 21:13:23 +0200

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'.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
2

answered 2018-03-25 17:38:09 +0200

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.

edit flag offensive delete link more
2

answered 2018-03-23 19:53:03 +0200

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
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

Stats

Asked: 2018-03-23 19:07:01 +0200

Seen: 1,267 times

Last updated: Mar 25 '18