Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
""" Frobenius endomorphisms on p-adic fields """
#***************************************************************************** # Copyright (C) 2013 Xavier Caruso <xavier.caruso@normalesup.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, or # (at your option) any later version. # http://www.gnu.org/licenses/ #***************************************************************************** from __future__ import absolute_import
from sage.rings.integer cimport Integer
from sage.structure.element cimport Element from sage.structure.richcmp cimport (richcmp, rich_to_bool, richcmp_not_equal)
from sage.rings.morphism cimport RingHomomorphism
from sage.categories.morphism cimport Morphism
cdef class FrobeniusEndomorphism_padics(RingHomomorphism): """ A class implementing Frobenius endomorphisms on padic fields. """ def __init__ (self,domain,n=1): """ INPUT:
- ``domain`` -- an unramified padic field
- ``n`` -- an integer (default: 1)
.. NOTE::
`n` may be negative.
OUTPUT:
The `n`-th power of the absolute (arithmetic) Frobenius endomorphism on ``domain``
TESTS::
sage: from sage.rings.padics.morphism import FrobeniusEndomorphism_padics sage: K.<a> = Qq(5^3) sage: FrobeniusEndomorphism_padics(K) Frobenius endomorphism on Unramified Extension ... lifting a |--> a^5 on the residue field sage: FrobeniusEndomorphism_padics(K,2) Frobenius endomorphism on Unramified Extension ... lifting a |--> a^(5^2) on the residue field
sage: FrobeniusEndomorphism_padics(K,a) Traceback (most recent call last): ... TypeError: n (=a + O(5^20)) is not an integer
sage: K = Qp(5) sage: L.<pi> = K.extension(x^2 - 5) sage: FrobeniusEndomorphism_padics(L) Traceback (most recent call last): ... TypeError: The domain must be unramified
sage: FrobeniusEndomorphism_padics(QQ) Traceback (most recent call last): ... TypeError: The domain must be an instance of pAdicGeneric """
def _repr_(self): """ Return a string representation of this endomorphism.
EXAMPLES::
sage: K.<a> = Qq(5^3) sage: Frob = K.frobenius_endomorphism(); Frob Frobenius endomorphism on Unramified Extension ... lifting a |--> a^5 on the residue field
sage: Frob._repr_() 'Frobenius endomorphism on Unramified Extension ... lifting a |--> a^5 on the residue field' """ elif self._power == 1: else:
def _repr_short(self): """ Return a short string representation of this endomorphism.
EXAMPLES::
sage: K.<a> = Qq(5^3) sage: Frob = K.frobenius_endomorphism(); Frob Frobenius endomorphism on Unramified Extension ... lifting a |--> a^5 on the residue field
sage: Frob._repr_short() 'Frob' """ s = "Identity" elif self._power == 1: else: s = "Frob^%s" % self._power
cpdef Element _call_ (self, x): """ TESTS::
sage: K.<a> = Qq(5^3) sage: Frob = K.frobenius_endomorphism(); sage: Frob(a) == a.frobenius() True """
def order(self): """ Return the order of this endomorphism.
EXAMPLES::
sage: K.<a> = Qq(5^12) sage: Frob = K.frobenius_endomorphism() sage: Frob.order() 12 sage: (Frob^2).order() 6 sage: (Frob^9).order() 4 """ return Infinity else:
def power(self): """ Return the smallest integer `n` such that this endomorphism is the `n`-th power of the absolute (arithmetic) Frobenius.
EXAMPLES::
sage: K.<a> = Qq(5^12) sage: Frob = K.frobenius_endomorphism() sage: Frob.power() 1 sage: (Frob^9).power() 9 sage: (Frob^13).power() 1 """
def __pow__(self,n,modulus): """ Return the `n`-th iterate of this endomorphism.
EXAMPLES::
sage: K.<a> = Qq(5^12) sage: Frob = K.frobenius_endomorphism() sage: Frob^2 Frobenius endomorphism on Unramified Extension ... lifting a |--> a^(5^2) on the residue field
The result is simplified if possible::
sage: Frob^15 Frobenius endomorphism on Unramified Extension ... lifting a |--> a^(5^3) on the residue field sage: Frob^36 Identity endomorphism of Unramified Extension ... """
def _composition(self,right): """ Return self o right.
EXAMPLES::
sage: K.<a> = Qq(5^12) sage: f = K.frobenius_endomorphism(); f Frobenius endomorphism on Unramified Extension ... lifting a |--> a^5 on the residue field sage: g = K.frobenius_endomorphism(2); g Frobenius endomorphism on Unramified Extension ... lifting a |--> a^(5^2) on the residue field sage: f * g Frobenius endomorphism on Unramified Extension ... lifting a |--> a^(5^3) on the residue field
The result is simplified if possible::
sage: f = K.frobenius_endomorphism(9) sage: g = K.frobenius_endomorphism(10) sage: f * g Frobenius endomorphism on Unramified Extension ... lifting a |--> a^(5^7) on the residue field """ else: return RingHomomorphism._composition(self,right)
def is_injective(self): """ Return true since any power of the Frobenius endomorphism over an unramified padic field is always injective.
EXAMPLES::
sage: K.<a> = Qq(5^3) sage: Frob = K.frobenius_endomorphism() sage: Frob.is_injective() True """
def is_surjective(self): """ Return true since any power of the Frobenius endomorphism over an unramified padic field is always surjective.
EXAMPLES::
sage: K.<a> = Qq(5^3) sage: Frob = K.frobenius_endomorphism() sage: Frob.is_surjective() True """
def is_identity(self): """ Return true if this morphism is the identity morphism.
EXAMPLES::
sage: K.<a> = Qq(5^3) sage: Frob = K.frobenius_endomorphism() sage: Frob.is_identity() False sage: (Frob^3).is_identity() True """
def __hash__(self): """ Return a hash of this morphism.
It is the hash of ``(domain, codomain, ('Frob', power)`` where ``power`` is the smalles integer `n` such that this morphism acts by `x \mapsto x^(p^n)` on the residue field """ domain = self.domain() codomain = self.codomain() return hash((domain,codomain,('Frob',self._power)))
cpdef _richcmp_(left, right, int op): """ Compare left and right """ return rich_to_bool(op, 0) return richcmp_not_equal(l_domain, r_domain, op)
return richcmp_not_equal(l_codomain, r_codomain, op)
try: for x in l_domain.gens(): lx = left(x) rx = right(x) if lx != rx: return richcmp_not_equal(lx, rx, op) return rich_to_bool(op, 0) except (AttributeError, NotImplementedError): raise NotImplementedError |