Important: to view this notebook properly you will need to execute the cell above, which assumes you have an Internet connection. It should already be selected, or place your cursor anywhere above to select. Then press the "Run" button in the menu bar above (the right-pointing arrowhead), or press Shift-Enter on your keyboard.
ParseError: KaTeX parse error: \newcommand{\lt} attempting to redefine \lt; use \renewcommand
Section4.7Sage
¶Cyclic groups are very important, so it is no surprise that they appear in many different forms in Sage. Each is slightly different, and no one implementation is ideal for an introduction, but together they can illustrate most of the important ideas. Here is a guide to the various ways to construct, and study, a cyclic group in Sage.
SubsectionInfinite Cyclic Groups
In Sage, the integers are constructed with ZZ
. To build the infinite cyclic group such as from Example 4.1, simply use 3*ZZ
. As an infinite set, there is not a whole lot you can do with this. You can test if integers are in this set, or not. You can also recall the generator with the .gen()
command.
SubsectionAdditive Cyclic Groups
The additive cyclic group can be built as a special case of a more general Sage construction. First we build and capture its generator. Throughout, pay close attention to the use of parentheses and square brackets for when you experiment on your own.
You can compute in this group, by using the generator, or by using new elements formed by coercing integers into the group, or by taking the result of operations on other elements. And we can compute the order of elements in this group. Notice that we can perform repeated additions with the shortcut of taking integer multiples of an element.
We can create, and then compute with, new elements of the group by coercing an integer (in a list of length ) into the group. You may get a DeprecationWarning
the first time you use this syntax to create a new element. The mysterious warning can be safely ignored.
It is possible to create cyclic subgroups, from an element designated to be the new generator. Unfortunately, to do this requires the .submodule()
method (which should be renamed in Sage).
The cyclic subgroup H
just created has more than one generator. We can test this by building a new subgroup and comparing the two subgroups.
Certainly the list of elements, and the common generator of (2)
lead us to belive that H
and K
are the same, but the comparison in the last line leaves no doubt.
SubsectionAbstract Multiplicative Cyclic Groups
Computations in the group are similar to before, only with different notation. Now products, with repeated products written as exponentiation.
Subgroups can be formed with a .subgroup()
command. But do not try to list the contents of a subgroup, it'll look strangely unfamiliar. Also, comparison of subgroups is not implemented.
One advantage of this implementation is the possibility to create all possible subgroups. Here we create the list of subgroups, extract one in particular (the third), and check its order.
SubsectionCyclic Permutation Groups
We will learn more about permutation groups in the next chapter. But we will mention here that it is easy to create cyclic groups as permutation groups, and a variety of methods are available for working with them, even if the actual elements get a bit cumbersome to work with. As before, notice that the notation and syntax is multiplicative.
We can create subgroups, check their orders, and list their elements.
It could help to visualize this group, and the subgroup, as rotations of a regular -gon with the vertices labeled with the integers through This is not the full group of symmetries, since it does not include reflections, just the rotations.
SubsectionCayley Tables
As groups, each of the examples above (groups and subgroups) have Cayley tables implemented. Since the groups are cyclic, and their subgroups are therefore cyclic, the Cayley tables should have a similar “cyclic” pattern. Note that the letters used in the default table are generic, and are not related to the letters used above for specific elements — they just match up with the group elements in the order given by .list()
.
If the real names of the elements are not too complicated, the table could be more informative using these names.
SubsectionComplex Roots of Unity
The finite cyclic subgroups of generated by a primitive th root of unity are implemented as a more general construction in Sage, known as a cyclotomic field. If you concentrate on just the multiplication of powers of a generator (and ignore the infinitely many other elements) then this is a finite cyclic group. Since this is not implemented directly in Sage as a group, per se, it is a bit harder to construct things like subgroups, but it is an excellent exercise to try. It is a nice example since the complex numbers are a concrete and familiar construction. Here are a few sample calculations to provide you with some exploratory tools. See the notes following the computations.
Notes:
zeta14
is the name of the generator used for the cyclotomic field, it is a primitive root of unity (a th root of unity in this case). We have captured it asw
.The syntax
CDF(w)
will convert the complex numberw
into the more familiar form with real and imaginary parts.The method
.abs()
will return the modulus of a complex number, as described in the text. For elements of this should always equalThe method
.arg()
will return the argument of a complex number, as described in the text. Every element of the cyclic group in this example should have an argument that is an integer multiple of TheN()
syntax converts the symbolic value ofpi
to a numerical approximation.sg
is a list of elements that form a cyclic subgroup of order 7, composed of the first 7 powers ofb = w^2
. So, for example, the last comparison multiplies the fifth power ofb
with the sixth power ofb
, which would be the eleventh power ofb
. But sinceb
has order 7, this reduces to the fourth power.If you know a subset of an infinite group forms a subgroup, then you can produce its Cayley table by specifying the list of elements you want to use. Here we ask for a multiplication table, since that is the relevant operation.