def is_quotient(M,sym,rank): symbol=GenusSymbol_global_ring(MatrixSpace(ZZ,rank,rank).one()) symbol._local_symbols=[Genus_Symbol_p_adic_ring(p,syms) for p,syms in sym.iteritems()] s = get_symbol_string(symbol) print s N = FiniteQuadraticModule(s) t = N.order()/M.order() if not Integer(t).is_square(): return False else: t = sqrt(t) for p in N.order().prime_factors(): if not N.signature(p) == M.signature(p): return False #if not N.signature() == M.signature(): # return False for G in N.subgroups(): if G.order() == t and G.is_isotropic(): Q = G.quotient() if Q.is_isomorphic(M): print Q return N.jordan_decomposition().genus_symbol() else: del(Q) del(N) return False
def is_quotient(M, sym, rank): symbol = GenusSymbol_global_ring(MatrixSpace(ZZ, rank, rank).one()) symbol._local_symbols = [ Genus_Symbol_p_adic_ring(p, syms) for p, syms in sym.iteritems() ] s = get_symbol_string(symbol) print s N = FiniteQuadraticModule(s) t = N.order() / M.order() if not Integer(t).is_square(): return False else: t = sqrt(t) for p in N.order().prime_factors(): if not N.signature(p) == M.signature(p): return False #if not N.signature() == M.signature(): # return False for G in N.subgroups(): if G.order() == t and G.is_isotropic(): Q = G.quotient() if Q.is_isomorphic(M): print Q return N.jordan_decomposition().genus_symbol() else: del (Q) del (N) return False
def weight_one_half_dim(FQM, use_reduction=True, proof=False, debug=0, local=True): N = Integer(FQM.level()) if not N % 4 == 0: return 0 m = Integer(N / Integer(4)) d = 0 for l in m.divisors(): if is_squarefree(m / l): if debug > 1: print "l = {0}".format(l) TM = FiniteQuadraticModule([2 * l], [-1 / Integer(4 * l)]) if local: dd = [0, 0] # eigenvalue 1, -1 multiplicity for p, n in lcm(FQM.level(), 4 * l).factor(): N = None TN = None J = FQM.jordan_decomposition() L = TM.jordan_decomposition() for j in xrange(1, n + 1): C = J.constituent(p**j)[0] D = L.constituent(p**j)[0] if debug > 1: print "C = {0}, D = {1}".format(C, D) if N == None and C.level() != 1: N = C elif C.level() != 1: N = N + C if TN == None and D.level() != 1: TN = D elif D.level() != 1: TN = TN + D dd1 = invariants_eps(N, TN, use_reduction, proof, debug) if debug > 1: print "dd1 = {}".format(dd1) if dd1 == [0, 0]: # the result is multiplicative # a single [0,0] as a local result # yields [0,0] in the end # and we're done here dd = [0, 0] break if dd == [0, 0]: # this is the first prime dd = dd1 else: # some basic arithmetic ;-) # 1 = 1*1 = (-1)(-1) # -1 = 1*(-1) = (-1)*1 ddtmp = copy(dd) ddtmp[0] = dd[0] * dd1[0] + dd[1] * dd1[1] ddtmp[1] = dd[0] * dd1[1] + dd[1] * dd1[0] dd = ddtmp if debug > 1: print "dd = {0}".format(dd) d += dd[0] else: d += invariants_eps(FQM, TM, use_reduction, proof, debug)[0] return d
def weight_one_half_dim(FQM, use_reduction = True, proof = False, debug = 0, local=True): N = Integer(FQM.level()) if not N % 4 == 0: return 0 m = Integer(N/Integer(4)) d = 0 for l in m.divisors(): if is_squarefree(m/l): if debug > 1: print "l = {0}".format(l) TM = FiniteQuadraticModule([2*l],[-1/Integer(4*l)]) if local: dd = [0,0] # eigenvalue 1, -1 multiplicity for p,n in lcm(FQM.level(),4*l).factor(): N = None TN = None J = FQM.jordan_decomposition() L = TM.jordan_decomposition() for j in xrange(1,n+1): C = J.constituent(p**j)[0] D = L.constituent(p**j)[0] if debug > 1: print "C = {0}, D = {1}".format(C,D) if N == None and C.level() != 1: N = C elif C.level() != 1: N = N + C if TN == None and D.level() != 1: TN = D elif D.level() != 1: TN = TN + D dd1 = invariants_eps(N, TN, use_reduction, proof, debug) if debug > 1: print "dd1 = {}".format(dd1) if dd1 == [0,0]: # the result is multiplicative # a single [0,0] as a local result # yields [0,0] in the end # and we're done here dd = [0,0] break if dd == [0,0]: # this is the first prime dd = dd1 else: # some basic arithmetic ;-) # 1 = 1*1 = (-1)(-1) # -1 = 1*(-1) = (-1)*1 ddtmp = copy(dd) ddtmp[0] = dd[0]*dd1[0] + dd[1]*dd1[1] ddtmp[1] = dd[0]*dd1[1] + dd[1]*dd1[0] dd = ddtmp if debug > 1: print "dd = {0}".format(dd) d += dd[0] else: d += invariants_eps(FQM, TM, use_reduction, proof, debug)[0] return d
def test_dimension_jacobi(N, k): from nils.jacobiforms.dimension_jac_forms import dimension_jac_cusp_forms N = Integer(N) dj = dimension_jac_cusp_forms(k + Integer(1) / Integer(2), N) M = FiniteQuadraticModule([2 * N], [1 / (4 * N)]) s = GenusSymbol(M.jordan_decomposition().genus_symbol()) dv = s.dimension_cusp_forms(k, reduction=True) if not dj == dv: print "Error: ", N, dj, dv return False return True
def test_dimension_jacobi(N, k): from nils.jacobiforms.dimension_jac_forms import dimension_jac_cusp_forms N = Integer(N) dj = dimension_jac_cusp_forms(k + Integer(1) / Integer(2), N) M = FiniteQuadraticModule([2 * N], [1 / (4 * N)]) s = GenusSymbol(M.jordan_decomposition().genus_symbol()) dv = s.dimension_cusp_forms(k, reduction=True) if not dj == dv: print "Error: ", N, dj, dv return False return True
def compute_simple_shimura_curves(path=''): l = load(path + '/lattices_aniso_1_notgamma0.sobj') simshim = [] aniso_shim_syms=[] for Q in l: M = FiniteQuadraticModule(Q.matrix()) s = GenusSymbol(M.jordan_decomposition().genus_symbol()) aniso_shim_syms.append(s) G = SimpleModulesGraph2n(1,None) G.compute_from_startpoints(aniso_shim_syms) simshim.extend(G._simple) return simshim
def compute_simple_shimura_curves(path=''): l = load(path + '/lattices_aniso_1_notgamma0.sobj') simshim = [] aniso_shim_syms = [] for Q in l: M = FiniteQuadraticModule(Q.matrix()) s = GenusSymbol(M.jordan_decomposition().genus_symbol()) aniso_shim_syms.append(s) G = SimpleModulesGraph2n(1, None) G.compute_from_startpoints(aniso_shim_syms) simshim.extend(G._simple) return simshim
def Bbf(M, m): # brute force algorithm if isinstance(M, str): M = FiniteQuadraticModule(M) rank = len(M.gens()) + 2 sign = M.signature() symbols = all_symbols(sign, rank, M.order() * m ** 2) B = list(is_quotient([(M, sym, rank) for sym in symbols])) B = filter(lambda x: x[1] != False, B) B = map(lambda x: x[1], B) modules = Set(B) modules_unique = list() for M in modules: seen = False for N in modules_unique: if N.is_isomorphic(M): seen = True if not seen: modules_unique.append(M) return [M.jordan_decomposition().genus_symbol() for M in modules_unique]
def Bbf(M, m): # brute force algorithm if isinstance(M, str): M = FiniteQuadraticModule(M) rank = len(M.gens()) + 2 sign = M.signature() symbols = all_symbols(sign, rank, M.order() * m**2) B = list(is_quotient([(M, sym, rank) for sym in symbols])) B = filter(lambda x: x[1] != False, B) B = map(lambda x: x[1], B) modules = Set(B) modules_unique = list() for M in modules: seen = False for N in modules_unique: if N.is_isomorphic(M): seen = True if not seen: modules_unique.append(M) return [M.jordan_decomposition().genus_symbol() for M in modules_unique]