Ejemplo n.º 1
0
    def __init__(self, primes):
        r"""
        Initialize the group of spinor operators

        TESTS::

            sage: from sage.quadratic_forms.genera.spinor_genus import *
            sage: S = SpinorOperators((2, 3, 7))
            sage: TestSuite(S).run()
        """
        if primes[0] != 2:
            raise ValueError("first prime must be 2")
        self._primes = tuple(ZZ(p) for p in primes)
        orders = len(self._primes)*[2] + [2]
        # 3, 5, unit_p1, unit_p2,...
        orders = tuple(orders)
        AbelianGroupGap.__init__(self, orders)
Ejemplo n.º 2
0
    def all_submodules(self):
        r"""
        Return a list of all submodules of ``self``.

        .. WARNING::

            This method creates all submodules in memory. The number of submodules
            grows rapidly with the number of generators. For example consider a
            vector space of dimension `n` over a finite field of prime order `p`.
            The number of subspaces is (very) roughly `p^{(n^2-n)/2}`.

        EXAMPLES::

            sage: D = IntegralLattice("D4").discriminant_group()
            sage: D.all_submodules()
            [Finite quadratic module over Integer Ring with invariants ()
              Gram matrix of the quadratic form with values in Q/2Z:
              [],
             Finite quadratic module over Integer Ring with invariants (2,)
              Gram matrix of the quadratic form with values in Q/2Z:
              [1],
             Finite quadratic module over Integer Ring with invariants (2,)
              Gram matrix of the quadratic form with values in Q/2Z:
              [1],
             Finite quadratic module over Integer Ring with invariants (2,)
              Gram matrix of the quadratic form with values in Q/2Z:
              [1],
             Finite quadratic module over Integer Ring with invariants (2, 2)
              Gram matrix of the quadratic form with values in Q/2Z:
              [  1 1/2]
              [1/2   1]]
        """
        from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap
        invs = self.invariants()
        # knows how to compute all subgroups
        A = AbelianGroupGap(invs)
        S = A.all_subgroups()
        # over ZZ submodules and subgroups are the same thing.
        submodules = []
        for sub in S:
            gen = [A(g).exponents() for g in sub.gens()]
            gen = [self.linear_combination_of_smith_form_gens(g) for g in gen]
            submodules.append(self.submodule(gen))
        return submodules
    def all_submodules(self):
        r"""
        Return a list of all submodules of ``self``.

        WARNING:

        This method creates all submodules in memory. The number of submodules
        grows rapidly with the number of generators. For example consider a
        vector space of dimension `n` over a finite field of prime order `p`.
        The number of subspaces is (very) roughly `p^{(n^2-n)/2}`.

        EXAMPLES::

            sage: D = IntegralLattice("D4").discriminant_group()
            sage: D.all_submodules()
            [Finite quadratic module over Integer Ring with invariants ()
              Gram matrix of the quadratic form with values in Q/2Z:
              [],
             Finite quadratic module over Integer Ring with invariants (2,)
              Gram matrix of the quadratic form with values in Q/2Z:
              [1],
             Finite quadratic module over Integer Ring with invariants (2,)
              Gram matrix of the quadratic form with values in Q/2Z:
              [1],
             Finite quadratic module over Integer Ring with invariants (2,)
              Gram matrix of the quadratic form with values in Q/2Z:
              [1],
             Finite quadratic module over Integer Ring with invariants (2, 2)
              Gram matrix of the quadratic form with values in Q/2Z:
              [  1 1/2]
              [1/2   1]]
        """
        from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap
        invs = self.invariants()
        # knows how to compute all subgroups
        A = AbelianGroupGap(invs)
        S = A.all_subgroups()
        # over ZZ submodules and subgroups are the same thing.
        submodules = []
        for sub in S:
            gen = [A(g).exponents() for g in sub.gens()]
            gen = [self.linear_combination_of_smith_form_gens(g) for g in gen]
            submodules.append(self.submodule(gen))
        return submodules
Ejemplo n.º 4
0
    def orthogonal_group(self, gens=None, check=False):
        r"""
        Orthogonal group of the associated torsion quadratic form.

        .. WARNING::

            This is can be smaller than the orthogonal group of the bilinear form.

        INPUT:

        - ``gens`` --  a list of generators, for instance square matrices,
                       something that acts on ``self``, or an automorphism
                       of the underlying abelian group
        - ``check`` -- perform additional checks on the generators

        EXAMPLES:

        You can provide generators to obtain a subgroup of the full orthogonal group::

            sage: D = TorsionQuadraticForm(matrix.identity(2)/2)
            sage: f = matrix(2,[0,1,1,0])
            sage: D.orthogonal_group(gens=[f]).order()
            2

        If no generators are given a slow brute force approach is used to calculate the full orthogonal group::

            sage: D = TorsionQuadraticForm(matrix.identity(3)/2)
            sage: OD = D.orthogonal_group()
            sage: OD.order()
            6
            sage: fd = D.hom([D.1,D.0,D.2])
            sage: OD(fd)
            [0 1 0]
            [1 0 0]
            [0 0 1]

        We compute the kernel of the action of the orthogonal group of `L` on the discriminant group.

            sage: L = IntegralLattice('A4')
            sage: O = L.orthogonal_group()
            sage: D = L.discriminant_group()
            sage: Obar = D.orthogonal_group(O.gens())
            sage: O.order()
            240
            sage: Obar.order()
            2
            sage: phi = O.hom(Obar.gens())
            sage: phi.kernel().order()
            120
        """
        from sage.groups.fqf_orthogonal import FqfOrthogonalGroup,_isom_fqf
        from sage.groups.abelian_gps.abelian_group_gap import AbelianGroupGap

        ambient = AbelianGroupGap(self.invariants()).aut()
        # slow brute force implementation
        if gens is None:
            try:
                gens = self._orthogonal_group_gens
            except AttributeError:
                gens = _isom_fqf(self)
                gens = tuple(ambient(g) for g in gens)
                self._orthogonal_group_gens = gens
        else:
            # see if there is an action
            try:
                gens = [matrix(x*g for x in self.smith_form_gens()) for g in gens]
            except TypeError:
                pass 
            # the ambient knows what to do with the generators
            gens = tuple(ambient(g) for g in gens)
        Oq =  FqfOrthogonalGroup(ambient, gens, self, check=check)
        return Oq