def check_newspaces_num_spaces(self): """ check that num_spaces matches the number of records in mf_newspaces with this level and weight and positive dimension """ # TIME about 2s # TODO: check that the number of char_orbits of level N and weight k is the same as the number of rows in mf_newspaces with this weight and level. The following doesn't work since num_spaces counts spaces with positive dimension # self.check_crosstable_count('char_dir_orbits', 'num_spaces', ['level', 'weight_parity'], ['modulus', 'parity'])) return self._run_crosstable(SQL("COUNT(*)"), 'mf_newspaces', 'num_spaces', ['level', 'weight'], extra=SQL(" AND t2.dim > 0"))
def check_field_poly_is_cyclotomic(self): """ if hecke_ring_cyclotomic_generator > 0, check that field_poly_is_cyclotomic is set in mf_newforms record. """ # TIME about 2s # could be done with _run_crosstable from mf_newforms query = SQL("SELECT t1.label FROM mf_hecke_nf t1, mf_newforms t2 WHERE NOT t2.field_poly_is_cyclotomic AND t1.hecke_ring_cyclotomic_generator > 0 AND t1.label = t2.label") return self._run_query(query=query)
def check_trace_bound1_from_dims(self): """ check that trace_bound = 1 if hecke_orbit_dims set and all dims distinct """ # TIME about 2s return self._run_query( SQL("hecke_orbit_dims IS NOT NULL AND hecke_orbit_dims = ARRAY(SELECT DISTINCT UNNEST(hecke_orbit_dims) ORDER BY 1) AND num_forms > 1 AND trace_bound != 1" ))
def check_trace_bound1(self): """ check that trace_bound = 1 if hecke_orbit_dims set and all dims distinct """ # TIME about 2s return self._run_query( SQL("hecke_orbit_dims!= ARRAY(SELECT DISTINCT UNNEST(hecke_orbit_dims) ORDER BY 1)" ), {'trace_bound': 1})
def check_parity_value(self): """ the value on -1 should agree with the parity for this char_orbit_index in char_dir_orbits """ # TIME about 500s return (self._run_crosstable(SQL("2*t2.values[1][2]"), 'char_dir_values', 'order', 'orbit_label', constraint={'parity': -1}, subselect_wrapper="ALL") + self._run_crosstable(SQL("t2.values[1][2]"), 'char_dir_values', 0, 'orbit_label', constraint={'parity': 1}, subselect_wrapper="ALL"))
def check_is_primitive(self): """ check that is_primitive is true if and only if modulus=conductor """ # TIME about 1s # Since we can't use constraint on modulus=conductor, we construct the constraint directly return self.check_iff({'is_primitive': True}, SQL("modulus = conductor"))
def check_sum_AL_dims(self): """ If AL_dims is set, check that AL_dims sum to dim """ # TIME 0.3 s query = SQL( r'SELECT label FROM mf_newspaces t1 WHERE t1.dim !=( SELECT SUM(s.d) FROM (SELECT ((jsonb_array_elements("AL_dims"))->>1)::int d FROM mf_newspaces t2 WHERE t2.label = t1.label) s ) AND "AL_dims" is not NULL' ) return self._run_query(query=query)
def check_lpoly(self): """ check that degree of lpoly is twice the dimension in mf_newforms for good primes check that linear coefficient of lpoly is -trace(a_p) and constant coefficient is 1 """ # TIME > 3600s query = SQL( "SELECT t1.label FROM (mf_newforms t1 INNER JOIN mf_hecke_lpolys t2 ON t1.hecke_orbit_code = t2.hecke_orbit_code) INNER JOIN mf_hecke_traces t3 ON t1.hecke_orbit_code = t3.hecke_orbit_code AND t2.p = t3.n WHERE ((MOD(t1.level, t2.p) != 0 AND array_length(t2.lpoly, 1) != 2*t1.dim+1) OR t2.lpoly[1] != 1 OR t2.lpoly[2] != -t3.trace_an)" ) return self._run_query(query=query)
def check_maxp(self): """ check that maxp is at least 997 """ return self._run_query(SQL('maxp < 997'))