예제 #1
0
 def create_key(self, k, p=None, prec_cap=None, base=None, \
                  character=None, adjuster=None, act_on_left=False, \
                  dettwist=None):
     k = ZZ(k)
     if base is None:
         if p is None:
             raise ValueError("Must specify a prime or a base ring.")
         if prec_cap is None:
             base = ZpCA(p)
         else:
             base = ZpCA(p, prec_cap)
     if prec_cap is None:
         prec_cap = base.precision_cap()
     elif prec_cap > base.precision_cap():
         raise ValueError("Insufficient precision in base ring (%s < %s)." %
                          (base.precision_cap(), prec_cap))
     if p is None:
         p = base.prime()
     elif p != base.prime():
         raise ValueError(
             "Prime p(=%s) must equal the prime of the base ring(=%s)" %
             (p, base.prime()))
     if adjuster is None:
         adjuster = _default_adjuster()
     if dettwist is not None:
         dettwist = ZZ(dettwist)
         if dettwist == 0:
             dettwist = None
     return (k, p, prec_cap, base, character, adjuster, act_on_left,
             dettwist)
예제 #2
0
 def create_key(self, k, p=None, prec_cap=None, base=None, \
                  character=None, adjuster=None, act_on_left=False, \
                  dettwist=None):
     k = ZZ(k)
     if base is None:
         if p is None:
             raise ValueError("Must specify a prime or a base ring.")
         if prec_cap is None:
             base = ZpCA(p)
         else:
             base = ZpCA(p, prec_cap)
     if prec_cap is None:
         prec_cap = base.precision_cap()
     elif prec_cap > base.precision_cap():
         raise ValueError("Insufficient precision in base ring (%s < %s)."%(base.precision_cap(), prec_cap))
     if p is None:
         p = base.prime()
     elif p != base.prime():
         raise ValueError("Prime p(=%s) must equal the prime of the base ring(=%s)"%(p, base.prime()))
     if adjuster is None:
         adjuster = _default_adjuster()
     if dettwist is not None:
         dettwist = ZZ(dettwist)
         if dettwist == 0: 
             dettwist = None
     return (k, p, prec_cap, base, character, adjuster, act_on_left, dettwist)
예제 #3
0
 def __init__(self, k, p=None, prec_cap=20, base=None, character=None, tuplegen=None, act_on_left=False):
     """
     - ``character`` --
       - None (default)
       - (chi, None)
       - (None, n) (n integral)
       - (chi, n)
       - lambda (for n half-integral use this form)
     """
     if p is not None:
         p = ZZ(p)
     if base is None:
         if p is None: raise ValueError("specify p or a base")
         base = ZpCA(p,prec_cap)
     elif isinstance(base, pAdicGeneric):
         if base.prime() != p: raise ValueError("p must be the same as the prime of base")
         if base.precision_cap() != prec_cap: raise ValueError("prec_cap must match the precision cap of base")
     elif prec_cap > k+1: # non-classical
         if p is None or not p.is_prime(): raise ValueError("p must be prime for non-classical weight")
     from sage.rings.padics.pow_computer import PowComputer_long
     # should eventually be the PowComputer on ZpCA once that uses longs.
     Dist, WeightKAction = get_dist_classes(p, prec_cap, base)
     self.Element = Dist
     if Dist is Dist_long:
         self.prime_pow = PowComputer_long(p, prec_cap, prec_cap, prec_cap, 0)
     Parent.__init__(self, base)
     self._k = k
     self._p = p
     self._prec_cap = prec_cap
     act = WeightKAction(self, character, tuplegen, act_on_left)
     self._act = act
     self._populate_coercion_lists_(action_list=[act])
예제 #4
0
    def __init__(self, k, p=None, prec_cap=None, base=None, symk=None, character=None, act_on_left=False): #what does symk do?
        
        """
        See ``DistributionsSpace`` for full documentation.
        """
        
        Parent.__init__(self,category=MSCoefficientModule)
        Element = DistributionElementPy #do we want elements to be DistributionElementPy or DistributionElementBase

        k = ZZ(k)
        if p is None:
            try:
                p = base.prime()
            except AttributeError:
                raise ValueError("You must specify a prime")
        else:
            p = ZZ(p)
        if base is None:
            if prec_cap is None:
                base = ZpCA(p)
            else:
                base = ZpCA(p, prec_cap)
        if prec_cap is None:
            try:
                prec_cap = base.precision_cap()
            except AttributeError:
                raise ValueError("You must specify a base or precision cap")
        return (k, p, prec_cap, base, character, tuplegen, act_on_left, symk)
예제 #5
0
    def create_key(self, k, p=None, prec_cap=None, base=None, symk=None, character=None, tuplegen=None, act_on_left=False):
        """
        EXAMPLES::

            sage: from sage.modular.pollack_stevens.distributions import Distributions
            sage: Distributions(20, 3, 10)              # indirect doctest
            Space of 3-adic distributions with k=20 action and precision cap 10
            sage: TestSuite(Distributions).run()
        """
        k = ZZ(k)
        if tuplegen is None:
            tuplegen = _default_tuplegen()
        if p is None:
            try:
                p = base.prime()
            except AttributeError:
                raise ValueError("You must specify a prime")
        else:
            p = ZZ(p)
        if base is None:
            if prec_cap is None:
                base = ZpCA(p)
            else:
                base = ZpCA(p, prec_cap)
        if prec_cap is None:
            try:
                prec_cap = base.precision_cap()
            except AttributeError:
                raise ValueError("You must specify a base or precision cap")
        return (k, p, prec_cap, base, character, tuplegen, act_on_left, symk)
예제 #6
0
    def create_key(
        self,
        k,
        p=None,
        prec_cap=None,
        base=None,
        character=None,
        adjuster=None,
        act_on_left=False,
        dettwist=None,
        act_padic=False,
        implementation=None,
    ):
        """
        EXAMPLES::

            sage: from sage.modular.pollack_stevens.distributions import OverconvergentDistributions
            sage: OverconvergentDistributions(20, 3, 10)              # indirect doctest
            Space of 3-adic distributions with k=20 action and precision cap 10
            sage: TestSuite(OverconvergentDistributions).run()
        """
        k = ZZ(k)

        if p is None:
            try:
                p = base.prime()
            except AttributeError:
                raise ValueError("You must specify a prime")
        else:
            p = ZZ(p)

        if base is None:
            if prec_cap is None:
                base = ZpCA(p)
            else:
                base = ZpCA(p, prec_cap)

        if prec_cap is None:
            try:
                prec_cap = base.precision_cap()
            except AttributeError:
                raise ValueError("You must specify a base or precision cap")

        if adjuster is None:
            adjuster = _default_adjuster()

        if dettwist is not None:
            dettwist = ZZ(dettwist)
            if dettwist == 0:
                dettwist = None

        return (k, p, prec_cap, base, character, adjuster, act_on_left, dettwist, act_padic, implementation)
예제 #7
0
    def create_key(self,
                   k,
                   p=None,
                   prec_cap=None,
                   base=None,
                   character=None,
                   adjuster=None,
                   act_on_left=False,
                   dettwist=None,
                   act_padic=False,
                   implementation=None):
        """
        EXAMPLES::

            sage: from sage.modular.pollack_stevens.distributions import OverconvergentDistributions
            sage: OverconvergentDistributions(20, 3, 10)              # indirect doctest
            Space of 3-adic distributions with k=20 action and precision cap 10
            sage: TestSuite(OverconvergentDistributions).run()
        """
        k = ZZ(k)

        if p is None:
            try:
                p = base.prime()
            except AttributeError:
                raise ValueError("You must specify a prime")
        else:
            p = ZZ(p)

        if base is None:
            if prec_cap is None:
                base = ZpCA(p)
            else:
                base = ZpCA(p, prec_cap)

        if prec_cap is None:
            try:
                prec_cap = base.precision_cap()
            except AttributeError:
                raise ValueError("You must specify a base or precision cap")

        if adjuster is None:
            adjuster = _default_adjuster()

        if dettwist is not None:
            dettwist = ZZ(dettwist)
            if dettwist == 0:
                dettwist = None

        return (k, p, prec_cap, base, character, adjuster, act_on_left,
                dettwist, act_padic, implementation)
예제 #8
0
    def create_key(self, k, p=None, prec_cap=None, base=None, symk=None, character=None, tuplegen=None, act_on_left=False):
        """
        INPUT:

        - `k` -- nonnegative integer
        - `p` -- prime number or None
        - ``prec_cap`` -- positive integer or None
        - ``base`` -- ring or None
        - ``symk`` -- bool or None
        - ``character`` -- a dirichlet character or None
        - ``tuplegen`` -- None or callable that turns 2x2 matrices into a 4-tuple
        - ``act_on_left`` -- bool (default: False)

        EXAMPLES::

            sage: from sage.modular.pollack_stevens.distributions import Distributions, Symk
            sage: Distributions(20, 3, 10)              # indirect doctest
            Space of 3-adic distributions with k=20 action and precision cap 10
        """
        k = ZZ(k)
        if tuplegen is None:
            tuplegen = _default_tuplegen()
        if p is None:
            try:
                p = base.prime()
            except AttributeError:
                raise ValueError("You must specify a prime")
        else:
            p = ZZ(p)
        if base is None:
            if prec_cap is None:
                base = ZpCA(p)
            else:
                base = ZpCA(p, prec_cap)
        if prec_cap is None:
            try:
                prec_cap = base.precision_cap()
            except AttributeError:
                raise ValueError("You must specify a base or precision cap")
        return (k, p, prec_cap, base, character, tuplegen, act_on_left, symk)