コード例 #1
0
    def __init__(self,
                 parent,
                 matrix,
                 inhomogeneous,
                 is_zero=lambda p: False,
                 relations=[]):
        ## Checking the input of matrix and vector
        if (not SAGE_element.is_Matrix(matrix)):
            matrix = Matrix(matrix)

        if (not SAGE_element.is_Vector(inhomogeneous)):
            inhomogeneous = vector(inhomogeneous)

        if (isinstance(parent, Wrap_w_Sequence_Ring)):
            parent = parent.base()

        ## Building the parent of the matrix and the vector
        pmatrix = matrix.parent().base()
        pinhom = inhomogeneous.parent().base()

        ## Setting the variables for the matrix, the parent and the vector
        self.__parent = pushout(pmatrix, pinhom)
        self.__matrix = matrix.change_ring(self.__parent)
        self.__inhomogeneous = inhomogeneous.change_ring(self.__parent)

        ## Setting the parent for the solutions
        if (not pushout(parent, self.__parent) == parent):
            try:
                self.__matrix = self.__matrix.change_ring(parent)
                self.__inhomogeneous = self.__inhomogeneous.change_ring(parent)
                self.__parent = parent
            except:
                raise TypeError(
                    "The parent for the solutions must be an extension of the parent for the input"
                )
        self.__solution_parent = parent

        ## Setting other variables
        if (relations is None):
            relations = []
        self.__relations = [self.__parent(el) for el in relations]
        try:
            self.__gb = ideal(self.parent(), self.__relations).groebner_basis()
        except AttributeError:
            try:
                self.__gb = [ideal(self.parent(), self.__relations).gen()]
            except:
                self.__gb = [0]

        self.__is_zero = is_zero

        ## Creating the variables for the echelon form
        self.__echelon = None
        self.__transformation = None

        ## Creating the variables for the solutions
        self.__solution = None
        self.__syzygy = None
コード例 #2
0
ファイル: weight_one_half.py プロジェクト: s-opitz/sfqm
def invariants_eps(FQM, TM, use_reduction=True, proof=False, debug=0):
    r"""
    Computes the invariants of a direct summand in the decomposition for weight
    one-half modular forms. Such a summand is of the form
    \[
      \mathbb{C}[(\mathbb{Z}/2N\mathbb{Z}, -x^2/4N)]^\epsilon \otimes \mathbb{C}[M],
    \]
    where $M$ is a given finite quadratic module and $\epsilon$ acts on the first
    factor via $\mathfrak{e}_\mu \mapsto \mathfrak{e}_{-\mu}$.

    INPUT:
        - FQM: A given finite quadratic module, referred to as $M$ above
        - TM: A cyclic module of the form as given abve (the first factor)

    NOTE:
        We do not check that TM is of the stated form. The function is an auxiliary function
        usually only called by ``weight_one_half_dim``.

    EXAMPLES:
        NONE
    """
    eps = True
    if TM != None and FQM != None:
        TMM = TM + FQM
    elif TM != None:
        TMM = TM
    else:
        TMM = FQM
        eps = False
    debug2 = 0
    if debug > 1:
        print "FQM = {0}, TM = {1}, TMM = {2}".format(FQM, TM, TMM)
        debug2 = 1
    if debug > 2:
        debug2 = debug
    inv = invariants(TMM, use_reduction, proof=proof, debug=debug2)
    if debug > 1: print inv
    if type(inv) in [list, tuple]:
        V = inv[1]
    else:
        V = inv
    d = [0, 0]
    if V.dimension() != 0:
        el = list()
        M = Matrix(V.base_ring(), V.ambient_module().dimension())
        if eps:
            f = 1 if TMM.signature() % 4 == 0 else -1
            for v in inv[0]:
                #Get the coordinate of this isotropic element
                vv = v.c_list()
                #change the first coordinate to its negative (the eps-action)
                vv[0] = -vv[0]
                vv = TMM(vv, can_coords=True)
                #since the isotropic elements are taken up to the action of +-1, we need to check
                #if we have this element (vv) or its negative (-vv) in the list
                #we append the index of the match, together with a sign to the list `el`,
                #where the sign is -1 if -vv is in inv[0] and the signature is 2 mod 4
                #(i.e. the std generator of the center acts as -1)
                if inv[0].count(vv) > 0:
                    el.append((inv[0].index(vv), 1))
                else:
                    el.append((inv[0].index(-vv), f))
            #We create the entries of the matrix M
            #which acts as eps on the space spanned by the isotropic vectors (mod +-1)
            for i in range(len(el)):
                M[el[i][0], i] = el[i][1]
            #import pdb; pdb.set_trace()
            if debug > 1: print "M={0}, V={1}".format(M, V)
            try:
                KM = (M - M.parent().one()).kernel_on(V)
                if debug > 1: print "KM for ev 1 = {0}".format(KM)
                d[0] = KM.dimension()
                KM = (M + M.parent().one()).kernel_on(V)
                if debug > 1: print "KM for ev -1 = {0}".format(KM)
                d[1] = KM.dimension()
            except Exception as e:
                raise RuntimeError(
                    "Error occured for {0}, {1}".format(
                        FQM.jordan_decomposition().genus_symbol(), e), M, V)
        else:
            d = [V.dimension(), 0]
    if debug > 1: print d
    return d
コード例 #3
0
ファイル: weight_one_half.py プロジェクト: s-opitz/sfqm
def invariants_eps(FQM, TM, use_reduction = True, proof = False, debug = 0):
    r"""
    Computes the invariants of a direct summand in the decomposition for weight
    one-half modular forms. Such a summand is of the form
    \[
      \mathbb{C}[(\mathbb{Z}/2N\mathbb{Z}, -x^2/4N)]^\epsilon \otimes \mathbb{C}[M],
    \]
    where $M$ is a given finite quadratic module and $\epsilon$ acts on the first
    factor via $\mathfrak{e}_\mu \mapsto \mathfrak{e}_{-\mu}$.

    INPUT:
        - FQM: A given finite quadratic module, referred to as $M$ above
        - TM: A cyclic module of the form as given abve (the first factor)

    NOTE:
        We do not check that TM is of the stated form. The function is an auxiliary function
        usually only called by ``weight_one_half_dim``.

    EXAMPLES:
        NONE
    """
    eps = True
    if TM != None and FQM != None:
        TMM = TM+FQM
    elif TM != None:
        TMM = TM
    else:
        TMM = FQM
        eps = False
    debug2 = 0
    if debug > 1:
        print "FQM = {0}, TM = {1}, TMM = {2}".format(FQM, TM, TMM)
        debug2 = 1
    if debug > 2:
        debug2=debug
    inv = invariants(TMM, use_reduction, proof=proof, debug=debug2)
    if debug > 1: print inv
    if type(inv) in [list,tuple]:
        V = inv[1]
    else:
        V = inv
    d = [0,0]
    if V.dimension() != 0:
        el = list()
        M = Matrix(V.base_ring(), V.ambient_module().dimension())
        if eps:
            f = 1 if TMM.signature() % 4 == 0 else -1
            for v in inv[0]:
                #Get the coordinate of this isotropic element
                vv = v.c_list()
                #change the first coordinate to its negative (the eps-action)
                vv[0] = -vv[0]
                vv = TMM(vv,can_coords=True)
                #since the isotropic elements are taken up to the action of +-1, we need to check
                #if we have this element (vv) or its negative (-vv) in the list
                #we append the index of the match, together with a sign to the list `el`,
                #where the sign is -1 if -vv is in inv[0] and the signature is 2 mod 4
                #(i.e. the std generator of the center acts as -1)
                if inv[0].count(vv) > 0:
                    el.append((inv[0].index(vv),1))
                else:
                    el.append((inv[0].index(-vv),f))
            #We create the entries of the matrix M
            #which acts as eps on the space spanned by the isotropic vectors (mod +-1)
            for i in range(len(el)):
                M[el[i][0],i] = el[i][1]
            #import pdb; pdb.set_trace()
            if debug > 1: print "M={0}, V={1}".format(M, V)
            try:
                KM = (M-M.parent().one()).kernel_on(V)
                if debug > 1: print "KM for ev 1 = {0}".format(KM)
                d[0] = KM.dimension()
                KM = (M+M.parent().one()).kernel_on(V)
                if debug > 1: print "KM for ev -1 = {0}".format(KM)
                d[1] = KM.dimension()
            except Exception as e:
                raise RuntimeError("Error occured for {0}, {1}".format(FQM.jordan_decomposition().genus_symbol(), e), M, V)
        else:
            d = [V.dimension(), 0]
    if debug > 1: print d
    return d
コード例 #4
0
ファイル: weight_one_half.py プロジェクト: bubonic/psage
def invariants_eps(FQM, TM, use_reduction = True, proof = False, debug = 0):
    r"""
    Computes the invariants of a direct summand in the decomposition for weight
    one-half modular forms. Such a summand is of the form
    \[
      \mathbb{C}[(\mathbb{Z}/2N\mathbb{Z}, -x^2/4N)]^\epsilon \otimes \mathbb{C}[M],
    \]
    where $M$ is a given finite quadratic module and $\epsilon$ acts on the first
    factor via $\mathfrak{e}_\mu \mapsto \mathfrak{e}_{-\mu}$.

    INPUT:
        - FQM: A given finite quadratic module, referred to as $M$ above
        - TM: A cyclic module of the form as given abve (the first factor)

    NOTE:
        We do not check that TM is of the stated form. The function is an auxiliary function
        usually only called by ``weight_one_half_dim``.

    EXAMPLES:
        NONE
    """
    eps = True
    if TM != None and FQM != None:
        TMM = TM+FQM
    elif TM != None:
        TMM = TM
    else:
        TMM = FQM
        eps = False
    if debug > 1: print "FQM = {0}, TM = {1}, TMM = {2}".format(FQM, TM, TMM)
    if debug > 2:
        debug2=debug
    else:
        debug2=0
    inv = invariants(TMM, use_reduction, proof, debug2)
    if debug > 1: print inv
    if type(inv) in [list,tuple]:
        V = inv[1]
    else:
        V = inv
    d = [0,0]
    if V.dimension() != 0:
        el = list()
        M = Matrix(V.base_ring(), V.ambient_module().dimension())
        if eps:
            f = 1 if TMM.signature() % 4 == 0 else -1
            for v in inv[0]:
                vv = v.c_list()
                vv[0] = -vv[0]
                vv = TMM(vv,can_coords=True)
                if inv[0].count(vv) > 0:
                    el.append((inv[0].index(vv),1))
                else:
                    el.append((inv[0].index(-vv),f))
            for i in range(len(el)):
                M[el[i][0],i] = el[i][1]
            if debug > 1: print "M={0}, V={1}".format(M, V)
            try:
                KM = (M-M.parent().one()).kernel_on(V)
                if debug > 1: print "KM for ev 1 = {0}".format(KM)
                d[0] = KM.dimension()
                KM = (M+M.parent().one()).kernel_on(V)
                if debug > 1: print "KM for ev -1 = {0}".format(KM)
                d[1] = KM.dimension()
            except:
                raise RuntimeError("Error occured for {0}".format(FQM.jordan_decomposition().genus_symbol()), M, V)
        else:
            d = [V.dimension(), 0]
    if debug > 1: print d
    return d