def relation_matrix_wtk_g0(syms, sign, field, sparse): r""" Compute the matrix of relations. Despite the name, this is used for all spaces (not just for Gamma0). For a description of the algorithm, see the docstring for ``compute_presentation``. INPUT: - ``syms``: sage.modular.modsym.manin_symbols.ManinSymbolList object - ``sign``: integer (0, 1 or -1) - ``field``: the base field (non-field base rings not supported at present) - ``sparse``: (True or False) whether to use sparse arithmetic. Note that ManinSymbolList objects already have a specific weight, so there is no need for an extra ``weight`` parameter. OUTPUT: a pair (R, mod) where - R is a matrix as output by ``T_relation_matrix_wtk_g0`` - mod is a set of 2-term relations as output by ``sparse_2term_quotient`` EXAMPLE:: sage: L = sage.modular.modsym.manin_symbols.ManinSymbolList_gamma0(8,2) sage: A = sage.modular.modsym.relation_matrix.relation_matrix_wtk_g0(L, 0, GF(2), True); A ( [0 0 0 0 0 0 0 0 1 0 0 0] [0 0 0 0 0 0 0 0 1 1 1 0] [0 0 0 0 0 0 1 0 0 1 1 0] [0 0 0 0 0 0 1 0 0 0 0 0], [(1, 1), (1, 1), (8, 1), (10, 1), (6, 1), (11, 1), (6, 1), (9, 1), (8, 1), (9, 1), (10, 1), (11, 1)] ) sage: A[0].is_sparse() True """ rels = modS_relations(syms) if sign != 0: # Let rels = rels union I relations. rels.update(modI_relations(syms, sign)) if syms._apply_S_only_0pm1() and rings.is_RationalField(field): import relation_matrix_pyx mod = relation_matrix_pyx.sparse_2term_quotient_only_pm1( rels, len(syms)) else: mod = sparse_2term_quotient(rels, len(syms), field) R = T_relation_matrix_wtk_g0(syms, mod, field, sparse) return R, mod
def relation_matrix_wtk_g0(syms, sign, field, sparse): r""" Compute the matrix of relations. Despite the name, this is used for all spaces (not just for Gamma0). For a description of the algorithm, see the docstring for ``compute_presentation``. INPUT: - ``syms``: sage.modular.modsym.manin_symbols.ManinSymbolList object - ``sign``: integer (0, 1 or -1) - ``field``: the base field (non-field base rings not supported at present) - ``sparse``: (True or False) whether to use sparse arithmetic. Note that ManinSymbolList objects already have a specific weight, so there is no need for an extra ``weight`` parameter. OUTPUT: a pair (R, mod) where - R is a matrix as output by ``T_relation_matrix_wtk_g0`` - mod is a set of 2-term relations as output by ``sparse_2term_quotient`` EXAMPLE:: sage: L = sage.modular.modsym.manin_symbols.ManinSymbolList_gamma0(8,2) sage: A = sage.modular.modsym.relation_matrix.relation_matrix_wtk_g0(L, 0, GF(2), True); A ( [0 0 0 0 0 0 0 0 1 0 0 0] [0 0 0 0 0 0 0 0 1 1 1 0] [0 0 0 0 0 0 1 0 0 1 1 0] [0 0 0 0 0 0 1 0 0 0 0 0], [(1, 1), (1, 1), (8, 1), (10, 1), (6, 1), (11, 1), (6, 1), (9, 1), (8, 1), (9, 1), (10, 1), (11, 1)] ) sage: A[0].is_sparse() True """ rels = modS_relations(syms) if sign != 0: # Let rels = rels union I relations. rels.update(modI_relations(syms, sign)) if syms._apply_S_only_0pm1() and rings.is_RationalField(field): import relation_matrix_pyx mod = relation_matrix_pyx.sparse_2term_quotient_only_pm1(rels, len(syms)) else: mod = sparse_2term_quotient(rels, len(syms), field) R = T_relation_matrix_wtk_g0(syms, mod, field, sparse) return R, mod