コード例 #1
0
ファイル: test_utils.py プロジェクト: edgarcosta/lmfdb
    def test_an_list(self):
        r"""
        Checking utility: an_list
        """
        # (1 - 2^{-s})^{-1} (1 - 3^{-s})^{-1}
        euler1 = lambda p: [1, -1] if p <= 3 else [1,0]
        t1 = an_list(euler1, upperbound=20)
        expect1 = [1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0]
        self.assertEqual(t1, expect1)

        # (1 + 2^{-s})^{-1} (1 + 3^{-s})^{-1}
        euler2 = lambda p: [1, 1] if p <= 3 else [1,0]
        t2 = an_list(euler2, upperbound=20)
        expect2 = [1, -1, -1, 1, 0, 1, 0, -1, 1, 0, 0, -1, 0, 0, 0, 1, 0, -1, 0, 0]
        self.assertEqual(t2, expect2)
コード例 #2
0
    def test_an_list(self):
        r"""
        Checking utility: an_list
        """
        # (1 - 2^{-s})^{-1} (1 - 3^{-s})^{-1}
        euler1 = lambda p: [1, -1] if p <= 3 else [1, 0]
        t1 = an_list(euler1, upperbound=20)
        expect1 = [1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0]
        self.assertEqual(t1, expect1)

        # (1 + 2^{-s})^{-1} (1 + 3^{-s})^{-1}
        euler2 = lambda p: [1, 1] if p <= 3 else [1, 0]
        t2 = an_list(euler2, upperbound=20)
        expect2 = [
            1, -1, -1, 1, 0, 1, 0, -1, 1, 0, 0, -1, 0, 0, 0, 1, 0, -1, 0, 0
        ]
        self.assertEqual(t2, expect2)
コード例 #3
0
ファイル: math_classes.py プロジェクト: tomgrubbmath/lmfdb
 def coefficients_list(self, upperbound=100):
     from lmfdb.utils import an_list
     return an_list(self.euler_polynomial,
                    upperbound=upperbound,
                    base_field=ComplexField())
コード例 #4
0
ファイル: symL.py プロジェクト: edgarcosta/lmfdb
 def an_list(self, upperbound=100000):
     from lmfdb.utils import an_list
     return an_list(self.eulerFactor, upperbound=upperbound,
                    base_field=sage.rings.all.RationalField())
コード例 #5
0
ファイル: math_classes.py プロジェクト: JRSijsling/lmfdb
 def coefficients_list(self, upperbound=100):
     from lmfdb.utils import an_list
     return an_list(lambda p: self.euler_polynomial(p), upperbound=upperbound, base_field=ComplexField())
コード例 #6
0
 def an_list(self, upperbound=100000):
     #from sage.rings.fast_arith import prime_range # imported but unused
     from lmfdb.utils import an_list
     return an_list(self.eulerFactor, upperbound=upperbound,
                    base_field=sage.rings.all.RationalField())
コード例 #7
0
ファイル: symL.py プロジェクト: LMFDB/lmfdb
 def an_list(self, upperbound=100000):
     #from sage.rings.fast_arith import prime_range # imported but unused
     from lmfdb.utils import an_list
     return an_list(self.eulerFactor, upperbound=upperbound,
                    base_field=sage.rings.all.RationalField())