Example #1
0
 def test_group_by_reduced_forms_with_sgn(self):
     prec = 8
     bls = []
     for t, ls in PrecisionDeg2(prec).group_by_reduced_forms_with_sgn().iteritems():
         rdf_t, sgn_t = reduced_form_with_sign(t)
         for t1, sgn in ls:
             _, sgn_t1 = reduced_form_with_sign(t1)
             bls.append(sgn_t == sgn_t1 * sgn)
     self.assertTrue(all(bls))
Example #2
0
 def _hecke_eigen_needed_tuples(self, m):
     tpl = self._none_zero_tpl()
     p, i = factor(m)[0]
     if not (ZZ(m).is_prime_power() and 0 < i < 3):
         raise RuntimeError("m must be a prime or the square of a prime.")
     if i == 1:
         return uniq(reduced_form_with_sign(t)[0]
                     for t in self._hecke_tp_needed_tuples(p, tpl))
     if i == 2:
         l1 = self._hecke_eigen_needed_tuples(p)
         l = [reduced_form_with_sign(t)[0]
              for t in self._hecke_tp2_needed_tuples(p, tpl)]
         return uniq(l1 + l)
Example #3
0
 def __getitem__(self, idx):
     try:
         return self.fc_dct[idx]
     except KeyError:
         t, e = reduced_form_with_sign(idx)
         return self.fc_dct[t] * e ** (self.wt)  # level 1 specific