Rings
We will now explore Rings in SageMath. There are a few rings that we have encountered in this project already, namely:
- IntegerModRing(n)
- ZZ the ring of integers
- QQ the ring of rational numbers
- RR the ring of real numbers
The results here are different since SageMath knows to treat these are elements of different rings. Here is another example.
Quotient Rings
We can also form quotient rings within SageMath, see the following example, where we form the quotient ring \[ \frac{\mathbb{Z}[x]}{x^5-3x+1} \]
Note that the indeterminant that we adjoint here is important, as it is how SageMath recognizes that a polynomial is an element of the Polynomial Ring.
Group Rings
One last thing that we will do with rings in SageMath, we will do some calculations within a group ring. Recall that if $R$ is a ring and $G$ is a group, then the group ring $R(G)$ is defined to be \[ R(G)=\left\{\sum_{g\in G}\alpha_gg:\alpha_g\in R\right\} \] That is, $R(G)$ is the set of all sums of elements of $G$ with coefficients in $R$. We demonstrate SageMath's ability to handle these in the following cell.
Here we have done the following calculation: \[ (2(123)+4(23)(14))(3(12)+9(1234))=6(23)+6(1324) \] in the group ring $\mathbb{Z}_{12}(S_4)$. In the above cell, enclosing the group elements with $RG(\dots)$ is necessary so SageMath knows that what we are writing is meant to be an element of the group ring we have defined, if we do not do this then we recieve an error that the ring elements and the group elements are not compatible with each other.
There are two other operations that are very important in Group Rings, these are the $*$ and $\hat{C}$. If $G(R)$ is a group ring, and $\alpha\in G(R)$, given by \[ \alpha=\sum_{g\in G}\alpha_gg,\quad \alpha_g\in R \] Then $\alpha^*$ is defined by \[ \alpha^*=\sum_{g\in G}\alpha_gg^{-1} \] If $C\subset G$, then $\hat{C}$ is defined by \[ \hat{C}=\sum_{g\in C}g \] We have code below that defines and demonstrates these functions.