Coverage for local/lib/python2.7/site-packages/sage/groups/semimonomial_transformations/semimonomial_transformation_group.py : 87%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
r""" Semimonomial transformation group
The semimonomial transformation group of degree `n` over a ring `R` is the semidirect product of the monomial transformation group of degree `n` (also known as the complete monomial group over the group of units `R^{\times}` of `R`) and the group of ring automorphisms.
The multiplication of two elements `(\phi, \pi, \alpha)(\psi, \sigma, \beta)` with
- `\phi, \psi \in {R^{\times}}^n`
- `\pi, \sigma \in S_n` (with the multiplication `\pi\sigma` done from left to right (like in GAP) -- that is, `(\pi\sigma)(i) = \sigma(\pi(i))` for all `i`.)
- `\alpha, \beta \in Aut(R)`
is defined by
.. MATH::
(\phi, \pi, \alpha)(\psi, \sigma, \beta) = (\phi \cdot \psi^{\pi, \alpha}, \pi\sigma, \alpha \circ \beta)
where `\psi^{\pi, \alpha} = (\alpha(\psi_{\pi(1)-1}), \ldots, \alpha(\psi_{\pi(n)-1}))` and the multiplication of vectors is defined elementwisely. (The indexing of vectors is `0`-based here, so `\psi = (\psi_0, \psi_1, \ldots, \psi_{n-1})`.)
.. TODO::
Up to now, this group is only implemented for finite fields because of the limited support of automorphisms for arbitrary rings.
AUTHORS:
- Thomas Feulner (2012-11-15): initial version
EXAMPLES::
sage: S = SemimonomialTransformationGroup(GF(4, 'a'), 4) sage: G = S.gens() sage: G[0]*G[1] ((a, 1, 1, 1); (1,2,3,4), Ring endomorphism of Finite Field in a of size 2^2 Defn: a |--> a)
TESTS::
sage: TestSuite(S).run() sage: TestSuite(S.an_element()).run() """
r""" A semimonomial transformation group over a ring.
The semimonomial transformation group of degree `n` over a ring `R` is the semidirect product of the monomial transformation group of degree `n` (also known as the complete monomial group over the group of units `R^{\times}` of `R`) and the group of ring automorphisms.
The multiplication of two elements `(\phi, \pi, \alpha)(\psi, \sigma, \beta)` with
- `\phi, \psi \in {R^{\times}}^n`
- `\pi, \sigma \in S_n` (with the multiplication `\pi\sigma` done from left to right (like in GAP) -- that is, `(\pi\sigma)(i) = \sigma(\pi(i))` for all `i`.)
- `\alpha, \beta \in Aut(R)`
is defined by
.. MATH::
(\phi, \pi, \alpha)(\psi, \sigma, \beta) = (\phi \cdot \psi^{\pi, \alpha}, \pi\sigma, \alpha \circ \beta)
where `\psi^{\pi, \alpha} = (\alpha(\psi_{\pi(1)-1}), \ldots, \alpha(\psi_{\pi(n)-1}))` and the multiplication of vectors is defined elementwisely. (The indexing of vectors is `0`-based here, so `\psi = (\psi_0, \psi_1, \ldots, \psi_{n-1})`.)
.. TODO::
Up to now, this group is only implemented for finite fields because of the limited support of automorphisms for arbitrary rings.
EXAMPLES::
sage: F.<a> = GF(9) sage: S = SemimonomialTransformationGroup(F, 4) sage: g = S(v = [2, a, 1, 2]) sage: h = S(perm = Permutation('(1,2,3,4)'), autom=F.hom([a**3])) sage: g*h ((2, a, 1, 2); (1,2,3,4), Ring endomorphism of Finite Field in a of size 3^2 Defn: a |--> 2*a + 1) sage: h*g ((2*a + 1, 1, 2, 2); (1,2,3,4), Ring endomorphism of Finite Field in a of size 3^2 Defn: a |--> 2*a + 1) sage: S(g) ((2, a, 1, 2); (), Ring endomorphism of Finite Field in a of size 3^2 Defn: a |--> a) sage: S(1) ((1, 1, 1, 1); (), Ring endomorphism of Finite Field in a of size 3^2 Defn: a |--> a) """
r""" Initialization.
INPUT:
- ``R`` -- a ring
- ``len`` -- the degree of the monomial group
OUTPUT:
- the complete semimonomial group
EXAMPLES::
sage: F.<a> = GF(9) sage: S = SemimonomialTransformationGroup(F, 4) """ raise NotImplementedError('the ring must be a field')
r""" Coerce ``arg1`` into this permutation group, if ``arg1`` is 0, then we will try to coerce ``(v, perm, autom)``.
INPUT:
- ``arg1`` (optional) -- either the integers 0, 1 or an element of ``self``
- ``v`` (optional) -- a vector of length ``self.degree()``
- ``perm`` (optional) -- a permutation of degree ``self.degree()``
- ``autom`` (optional) -- an automorphism of the ring
EXAMPLES::
sage: F.<a> = GF(9) sage: S = SemimonomialTransformationGroup(F, 4) sage: S(1) ((1, 1, 1, 1); (), Ring endomorphism of Finite Field in a of size 3^2 Defn: a |--> a) sage: g = S(v=[1,1,1,a]) sage: S(g) ((1, 1, 1, a); (), Ring endomorphism of Finite Field in a of size 3^2 Defn: a |--> a) sage: S(perm=Permutation('(1,2)(3,4)')) ((1, 1, 1, 1); (1,2)(3,4), Ring endomorphism of Finite Field in a of size 3^2 Defn: a |--> a) sage: S(autom=F.hom([a**3])) ((1, 1, 1, 1); (), Ring endomorphism of Finite Field in a of size 3^2 Defn: a |--> 2*a + 1) """
except TypeError: raise TypeError('the vector attribute %s '%v + 'should be iterable') raise ValueError('the length of the vector is %s,'%len(v) + ' should be %s'%self.degree()) raise ValueError('there is at least one element in the ' + 'list %s not lying in %s '%(v, R) + 'or which is not invertible') except TypeError: raise TypeError('the permutation attribute %s '%perm + 'could not be converted to a permutation') raise ValueError('the permutation length is %s,' %len(perm) + ' should be %s' %self.degree())
autom = End(R)(autom) except TypeError: raise TypeError('%s of type %s' %(autom, type(autom)) + ' is not coerceable to an automorphism') else: ' or an element of this group')
r""" Returns the underlying ring of ``self``.
EXAMPLES::
sage: F.<a> = GF(4) sage: SemimonomialTransformationGroup(F, 3).base_ring() is F True """
r""" Returns the degree of ``self``.
EXAMPLES::
sage: F.<a> = GF(4) sage: SemimonomialTransformationGroup(F, 3).degree() 3 """
r""" Returns an element of ``self``.
EXAMPLES::
sage: F.<a> = GF(4) sage: SemimonomialTransformationGroup(F, 3).an_element() # indirect doctest ((a, 1, 1); (1,3,2), Ring endomorphism of Finite Field in a of size 2^2 Defn: a |--> a + 1) """
else:
r""" EXAMPLES::
sage: F.<a> = GF(4) sage: S = SemimonomialTransformationGroup(F, 3) sage: 1 in S # indirect doctest True sage: a in S # indirect doctest False """
r""" Return a tuple of generators of ``self``.
EXAMPLES::
sage: F.<a> = GF(4) sage: SemimonomialTransformationGroup(F, 3).gens() [((a, 1, 1); (), Ring endomorphism of Finite Field in a of size 2^2 Defn: a |--> a), ((1, 1, 1); (1,2,3), Ring endomorphism of Finite Field in a of size 2^2 Defn: a |--> a), ((1, 1, 1); (1,2), Ring endomorphism of Finite Field in a of size 2^2 Defn: a |--> a), ((1, 1, 1); (), Ring endomorphism of Finite Field in a of size 2^2 Defn: a |--> a + 1)] """
r""" Returns the number of elements of ``self``.
EXAMPLES::
sage: F.<a> = GF(4) sage: SemimonomialTransformationGroup(F, 5).order() == (4-1)**5 * factorial(5) * 2 True """ else: multgroup_size = R.unit_group_order() autgroup_size = len([x for x in End(R) if x.is_injective()])
r""" If ``self`` is the semimonomial group of degree `n` over `R`, then there is the natural action on `R^n` and on matrices `R^{m \times n}` for arbitrary integers `m` from the left. See also: :class:`~sage.groups.semimonomial_transformations.semimonomial_transformation_group.SemimonomialActionVec` and :class:`~sage.groups.semimonomial_transformations.semimonomial_transformation_group.SemimonomialActionMat`
EXAMPLES::
sage: F.<a> = GF(4) sage: s = SemimonomialTransformationGroup(F, 3).an_element() sage: v = (F**3).0 sage: s*v # indirect doctest (0, 1, 0) sage: M = MatrixSpace(F, 3).one() sage: s*M # indirect doctest [ 0 1 0] [ 0 0 1] [a + 1 0 0] """
r""" Returns a string describing ``self``.
EXAMPLES::
sage: F.<a> = GF(4) sage: SemimonomialTransformationGroup(F, 3) # indirect doctest Semimonomial transformation group over Finite Field in a of size 2^2 of degree 3 """ ' of degree %s'%self.degree())
r""" Method for describing ``self`` in LaTeX.
EXAMPLES::
sage: F.<a> = GF(4) sage: latex(SemimonomialTransformationGroup(F, 3)) # indirect doctest \left(\Bold{F}_{2^{2}}^3\wr\langle (1,2,3), (1,2) \rangle \right) \rtimes \operatorname{Aut}(\Bold{F}_{2^{2}}) """ SymmetricGroup(self.degree())._latex_() + ' \\right) \\rtimes \operatorname{Aut}(' + ring_latex + ')')
r""" The natural action of the semimonomial group on vectors.
The action is defined by: `(\phi, \pi, \alpha)*(v_0, \ldots, v_{n-1}) := (\alpha(v_{\pi(1)-1}) \cdot \phi_0^{-1}, \ldots, \alpha(v_{\pi(n)-1}) \cdot \phi_{n-1}^{-1})`. (The indexing of vectors is `0`-based here, so `\psi = (\psi_0, \psi_1, \ldots, \psi_{n-1})`.) """ r""" Initialization.
EXAMPLES::
sage: F.<a> = GF(4) sage: s = SemimonomialTransformationGroup(F, 3).an_element() sage: v = (F**3).1 sage: s*v # indirect doctest (0, 0, 1) """ raise ValueError('%s is not a semimonomial group' % G) raise ValueError('%s is not equal to its ambient module' % V) raise ValueError('%s has a dimension different to the degree of %s' % (V, G)) raise ValueError('%s and %s have different base rings' % (V, G))
r""" Apply the semimonomial group element `a` to the vector `b`.
EXAMPLES::
sage: F.<a> = GF(4) sage: s = SemimonomialTransformationGroup(F, 3).an_element() sage: v = (F**3).1 sage: s*v # indirect doctest (0, 0, 1) """
r""" The action of :class:`~sage.groups.semimonomial_transformations.semimonomial_transformation_group.SemimonomialTransformationGroup` on matrices over the same ring whose number of columns is equal to the degree. See :class:`~sage.groups.semimonomial_transformations.semimonomial_transformation_group.SemimonomialActionVec` for the definition of the action on the row vectors of such a matrix. """ r""" Initialization.
EXAMPLES::
sage: F.<a> = GF(4) sage: s = SemimonomialTransformationGroup(F, 3).an_element() sage: M = MatrixSpace(F, 3).one() sage: s*M # indirect doctest [ 0 1 0] [ 0 0 1] [a + 1 0 0] """ raise ValueError('%s is not a semimonomial group' % G) raise ValueError('the number of columns of %s' % M + ' and the degree of %s are different' % G) raise ValueError('%s and %s have different base rings' % (M, G))
r""" Apply the semimonomial group element `a` to the matrix `b`.
EXAMPLES::
sage: F.<a> = GF(4) sage: s = SemimonomialTransformationGroup(F, 3).an_element() sage: M = MatrixSpace(F, 3).one() sage: s*M # indirect doctest [ 0 1 0] [ 0 0 1] [a + 1 0 0] """ |