Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Add places to global function fields
Browse files Browse the repository at this point in the history
  • Loading branch information
kwankyu committed Jan 17, 2019
1 parent 6abcb72 commit 97d3bc3
Show file tree
Hide file tree
Showing 8 changed files with 1,615 additions and 50 deletions.
2 changes: 2 additions & 0 deletions src/doc/en/reference/function_fields/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ a divisor, are available for global function fields.
sage/rings/function_field/element
sage/rings/function_field/order
sage/rings/function_field/ideal
sage/rings/function_field/place
sage/rings/function_field/valuation_ring
sage/rings/function_field/maps
sage/rings/function_field/constructor

Expand Down
59 changes: 50 additions & 9 deletions src/sage/rings/function_field/element.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Arithmetic with rational functions::
sage: f = t - 1
sage: g = t^2 - 3
sage: h = f^2/g^3
sage: h.valuation(t-1)
2
sage: h.valuation(t)
0
sage: h.valuation(t^2 - 3)
-3
AUTHORS:
Expand Down Expand Up @@ -67,7 +73,7 @@ def make_FunctionFieldElement(parent, element_class, representing_element):
sage: from sage.rings.function_field.element import make_FunctionFieldElement
sage: K.<x> = FunctionField(QQ)
sage: make_FunctionFieldElement(K, K._element_class, (x+1)/x)
sage: make_FunctionFieldElement(K, K.element_class, (x+1)/x)
(x + 1)/x
"""
return element_class(parent, representing_element, reduce=False)
Expand Down Expand Up @@ -792,27 +798,43 @@ cdef class FunctionFieldElement_rational(FunctionFieldElement):
"""
return self._x.denominator()

def valuation(self, v):
def valuation(self, place):
"""
Return the valuation of the element with respect to a prime element.
Return the valuation of the rational function at the place.
Rational function field places are associated with irreducible
polynomials.
INPUT:
- ``v`` -- a prime element of the function field
- ``place`` -- a place or an irreducible polynomial
EXAMPLES::
sage: K.<t> = FunctionField(QQ)
sage: f = (t-1)^2 * (t+1) / (t^2 - 1/3)^3
sage: f.valuation(t-1)
sage: f = (t - 1)^2*(t + 1)/(t^2 - 1/3)^3
sage: f.valuation(t - 1)
2
sage: f.valuation(t)
0
sage: f.valuation(t^2 - 1/3)
-3
sage: K.<x> = FunctionField(GF(2))
sage: p = K.places_finite()[0]
sage: (1/x^2).valuation(p)
-2
"""
R = self._parent._ring
return self._x.valuation(R(self._parent(v)._x))
from .place import FunctionFieldPlace

if not isinstance(place, FunctionFieldPlace):
# place is an irreducible polynomial
R = self._parent._ring
return self._x.valuation(R(self._parent(place)._x))

prime = place.prime_ideal()
ideal = prime.ring().ideal(self)
return prime.valuation(ideal)

def is_square(self):
"""
Expand Down Expand Up @@ -907,4 +929,23 @@ cdef class FunctionFieldElement_global(FunctionFieldElement_polymod):
"""
Elements of global function fields
"""
pass

def valuation(self, place):
"""
Return the valuation of the element at the place.
INPUT:
- ``place`` -- a place of the function field
EXAMPLES::
sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
sage: p = L.places_infinite()[0]
sage: y.valuation(p)
-1
"""
prime = place.prime_ideal()
ideal = prime.ring().ideal(self)
return prime.valuation(ideal)
Loading

0 comments on commit 97d3bc3

Please sign in to comment.