Exemplo n.º 1
0
def global_genus_symbol(self):
    """
    Returns the genus of a two times a quadratic form over ZZ.  These
    are defined by a collection of local genus symbols (a la Chapter
    15 of Conway-Sloane), and a signature.

    EXAMPLES::

        sage: Q = DiagonalQuadraticForm(ZZ, [1,2,3,4])
        sage: Q.global_genus_symbol()
        Genus of [2 0 0 0]
        [0 4 0 0]
        [0 0 6 0]
        [0 0 0 8]

    ::

        sage: Q = QuadraticForm(ZZ, 4, range(10))
        sage: Q.global_genus_symbol()
        Genus of [ 0  1  2  3]
        [ 1  8  5  6]
        [ 2  5 14  8]
        [ 3  6  8 18]

    """
    ## Check that the form is defined over ZZ
    if not self.base_ring() == IntegerRing():
        raise TypeError, "Oops!  The quadratic form is not defined over the integers."

    ## Return the result
    try:
        return Genus(self.Hessian_matrix())
    except Exception:
        raise TypeError, "Oops!  There is a problem computing the genus symbols for this form."
    def genus(self):
        r"""
        Return the genus of this lattice.

        EXAMPLES::

            sage: L = IntegralLattice("U")
            sage: L.genus()
            Genus of
            [0 1]
            [1 0]
            Genus symbol at 2:    1^2
        """
        from sage.quadratic_forms.genera.genus import Genus
        return Genus(self.gram_matrix())
Exemplo n.º 3
0
    def genus(self):
        r"""
        Return the genus of this lattice.

        EXAMPLES::

            sage: from sage.modules.free_quadratic_module_integer_symmetric import IntegralLattice
            sage: L = IntegralLattice(Matrix(ZZ,2,2,[0,1,1,0]))
            sage: L.genus()
            Genus of
            [0 1]
            [1 0]
            Genus symbol at 2:    1^2
        """
        from sage.quadratic_forms.genera.genus import Genus
        return Genus(self.gram_matrix())
Exemplo n.º 4
0
def global_genus_symbol(self):
    r"""
    Return the genus of two times a quadratic form over `\ZZ`.

    These are defined by a collection of local genus symbols (a la
    Chapter 15 of Conway-Sloane [CS1999]_), and a signature.

    EXAMPLES::

        sage: Q = DiagonalQuadraticForm(ZZ, [1,2,3,4])
        sage: Q.global_genus_symbol()
        Genus of
        [2 0 0 0]
        [0 4 0 0]
        [0 0 6 0]
        [0 0 0 8]
        Signature:  (4, 0)
        Genus symbol at 2:    [2^-2 4^1 8^1]_6
        Genus symbol at 3:     1^3 3^-1

    ::

        sage: Q = QuadraticForm(ZZ, 4, range(10))
        sage: Q.global_genus_symbol()
        Genus of
        [ 0  1  2  3]
        [ 1  8  5  6]
        [ 2  5 14  8]
        [ 3  6  8 18]
        Signature:  (3, 1)
        Genus symbol at 2:    1^-4
        Genus symbol at 563:     1^3 563^-1
    """
    if self.base_ring() is not ZZ:
        raise TypeError("the quadratic form is not defined over the integers")
    return Genus(self.Hessian_matrix())