Elements of function fields#

Sage provides arithmetic with elements of function fields.

EXAMPLES:

Arithmetic with rational functions:

sage: K.<t> = FunctionField(QQ)
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

Derivatives of elements in separable extensions:

sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]                                     # needs sage.rings.finite_rings
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)                                        # needs sage.rings.finite_rings sage.rings.function_field
sage: (y^3 + x).derivative()                                                        # needs sage.rings.finite_rings sage.rings.function_field
((x^2 + 1)/x^2)*y + (x^4 + x^3 + 1)/x^3

The divisor of an element of a global function field:

sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)                                        # needs sage.rings.function_field
sage: y.divisor()                                                                   # needs sage.rings.function_field
- Place (1/x, 1/x*y)
 - Place (x, x*y)
 + 2*Place (x + 1, x*y)

AUTHORS:

  • William Stein: initial version

  • Robert Bradshaw (2010-05-27): cythonize function field elements

  • Julian Rueth (2011-06-28, 2020-09-01): treat zero correctly; implement nth_root/is_nth_power

  • Maarten Derickx (2011-09-11): added doctests, fixed pickling

  • Kwankyu Lee (2017-04-30): added elements for global function fields

class sage.rings.function_field.element.FunctionFieldElement#

Bases: FieldElement

Abstract base class for function field elements.

EXAMPLES:

sage: t = FunctionField(QQ,'t').gen()
sage: isinstance(t, sage.rings.function_field.element.FunctionFieldElement)
True
characteristic_polynomial(*args, **kwds)#

Return the characteristic polynomial of the element. Give an optional input string to name the variable in the characteristic polynomial.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3); R.<z> = L[]                   # needs sage.rings.function_field
sage: M.<z> = L.extension(z^3 - y^2*z + x)                                  # needs sage.rings.function_field
sage: x.characteristic_polynomial('W')                                      # needs sage.modules
W - x
sage: y.characteristic_polynomial('W')                                      # needs sage.modules sage.rings.function_field
W^2 - x*W + 4*x^3
sage: z.characteristic_polynomial('W')                                      # needs sage.modules sage.rings.function_field
W^3 + (-x*y + 4*x^3)*W + x
charpoly(*args, **kwds)#

Return the characteristic polynomial of the element. Give an optional input string to name the variable in the characteristic polynomial.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3); R.<z> = L[]                   # needs sage.rings.function_field
sage: M.<z> = L.extension(z^3 - y^2*z + x)                                  # needs sage.rings.function_field
sage: x.characteristic_polynomial('W')                                      # needs sage.modules
W - x
sage: y.characteristic_polynomial('W')                                      # needs sage.modules sage.rings.function_field
W^2 - x*W + 4*x^3
sage: z.characteristic_polynomial('W')                                      # needs sage.modules sage.rings.function_field
W^3 + (-x*y + 4*x^3)*W + x
degree()#

Return the max degree between the denominator and numerator.

EXAMPLES:

sage: FF.<t> = FunctionField(QQ)
sage: f = (t^2 + 3) / (t^3 - 1/3); f
(t^2 + 3)/(t^3 - 1/3)
sage: f.degree()
3

sage: FF.<t> = FunctionField(QQ)
sage: f = (t+8); f
t + 8
sage: f.degree()
1
derivative()#

Return the derivative of the element.

The derivative is with respect to the generator of the base rational function field, over which the function field is a separable extension.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: f = (t + 1) / (t^2 - 1/3)
sage: f.derivative()                                                        # needs sage.modules
(-t^2 - 2*t - 1/3)/(t^4 - 2/3*t^2 + 1/9)

sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]                             # needs sage.rings.finite_rings
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)                                # needs sage.rings.finite_rings sage.rings.function_field
sage: (y^3 + x).derivative()                                                # needs sage.modules sage.rings.finite_rings sage.rings.function_field
((x^2 + 1)/x^2)*y + (x^4 + x^3 + 1)/x^3
differential()#

Return the differential \(dx\) where \(x\) is the element.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: f = 1 / t
sage: f.differential()                                                      # needs sage.modules
(-1/t^2) d(t)

sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]                             # needs sage.rings.finite_rings
sage: L.<y> = K.extension(Y^2 + Y + x +1/x)                                 # needs sage.rings.finite_rings sage.rings.function_field
sage: (y^3 + x).differential()                                              # needs sage.modules sage.rings.finite_rings sage.rings.function_field
(((x^2 + 1)/x^2)*y + (x^4 + x^3 + 1)/x^3) d(x)
divisor()#

Return the divisor of the element.

EXAMPLES:

sage: K.<x> = FunctionField(GF(2))
sage: f = 1/(x^3 + x^2 + x)
sage: f.divisor()                                                           # needs sage.libs.pari sage.modules
3*Place (1/x)
 - Place (x)
 - Place (x^2 + x + 1)
sage: K.<x> = FunctionField(GF(2)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)                                # needs sage.rings.function_field
sage: y.divisor()                                                           # needs sage.modules sage.rings.function_field
- Place (1/x, 1/x*y)
 - Place (x, x*y)
 + 2*Place (x + 1, x*y)
divisor_of_poles()#

Return the divisor of poles for the element.

EXAMPLES:

sage: K.<x> = FunctionField(GF(2))
sage: f = 1/(x^3 + x^2 + x)
sage: f.divisor_of_poles()                                                  # needs sage.libs.pari sage.modules
Place (x)
 + Place (x^2 + x + 1)
sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]                             # needs sage.rings.finite_rings
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)                                # needs sage.rings.finite_rings sage.rings.function_field
sage: (x/y).divisor_of_poles()                                              # needs sage.modules sage.rings.finite_rings sage.rings.function_field
Place (1/x, 1/x*y) + 2*Place (x + 1, x*y)
divisor_of_zeros()#

Return the divisor of zeros for the element.

EXAMPLES:

sage: K.<x> = FunctionField(GF(2))
sage: f = 1/(x^3 + x^2 + x)
sage: f.divisor_of_zeros()                                                  # needs sage.libs.pari sage.modules
3*Place (1/x)
sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]                             # needs sage.rings.finite_rings
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)                                # needs sage.rings.finite_rings sage.rings.function_field
sage: (x/y).divisor_of_zeros()                                              # needs sage.modules sage.rings.finite_rings sage.rings.function_field
3*Place (x, x*y)
evaluate(place)#

Return the value of the element at the place.

INPUT:

  • place – a function field place

OUTPUT:

If the element is in the valuation ring at the place, then an element in the residue field at the place is returned. Otherwise, ValueError is raised.

EXAMPLES:

sage: K.<t> = FunctionField(GF(5))
sage: p = K.place_infinite()
sage: f = 1/t^2 + 3
sage: f.evaluate(p)
3
sage: # needs sage.rings.finite_rings sage.rings.function_field
sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
sage: p, = L.places_infinite()
sage: p, = L.places_infinite()
sage: (y + x).evaluate(p)
Traceback (most recent call last):
...
ValueError: has a pole at the place
sage: (y/x + 1).evaluate(p)
1
higher_derivative(i, separating_element=None)#

Return the \(i\)-th derivative of the element with respect to the separating element.

INPUT:

  • i – nonnegative integer

  • separating_element – a separating element of the function field; the default is the generator of the rational function field

EXAMPLES:

sage: K.<t> = FunctionField(GF(2))
sage: f = t^2
sage: f.higher_derivative(2)                                                # needs sage.modules sage.rings.function_field
1
sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]                             # needs sage.rings.finite_rings
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)                                # needs sage.rings.finite_rings sage.rings.function_field
sage: (y^3 + x).higher_derivative(2)                                        # needs sage.modules sage.rings.finite_rings sage.rings.function_field
1/x^3*y + (x^6 + x^4 + x^3 + x^2 + x + 1)/x^5
is_integral()#

Determine if the element is integral over the maximal order of the base field.

EXAMPLES:

sage: # needs sage.modules sage.rings.function_field
sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: y.is_integral()
True
sage: (y/x).is_integral()
True
sage: (y/x)^2 - (y/x) + 4*x
0
sage: (y/x^2).is_integral()
False
sage: (y/x).minimal_polynomial('W')
W^2 - W + 4*x
is_nth_power(n)#

Return whether this element is an n-th power in the rational function field.

INPUT:

  • n – an integer

OUTPUT:

Returns True if there is an element \(a\) in the function field such that this element equals \(a^n\).

See also

nth_root()

EXAMPLES:

sage: K.<x> = FunctionField(GF(3))
sage: f = (x+1)/(x-1)
sage: f.is_nth_power(2)
False
matrix(base=None)#

Return the matrix of multiplication by this element, interpreting this element as an element of a vector space over base.

INPUT:

  • base – a function field (default: None), if None, then the matrix is formed over the base field of this function field.

EXAMPLES:

A rational function field:

sage: K.<t> = FunctionField(QQ)
sage: t.matrix()                                                            # needs sage.modules
[t]
sage: (1/(t+1)).matrix()                                                    # needs sage.modules
[1/(t + 1)]

Now an example in a nontrivial extension of a rational function field:

sage: # needs sage.modules sage.rings.function_field
sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: y.matrix()
[     0      1]
[-4*x^3      x]
sage: y.matrix().charpoly('Z')
Z^2 - x*Z + 4*x^3

An example in a relative extension, where neither function field is rational:

sage: # needs sage.modules sage.rings.function_field
sage: K.<x> = FunctionField(QQ)
sage: R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)
sage: M.<T> = L[]
sage: Z.<alpha> = L.extension(T^3 - y^2*T + x)
sage: alpha.matrix()
[          0           1           0]
[          0           0           1]
[         -x x*y - 4*x^3           0]
sage: alpha.matrix(K)
[           0            0            1            0            0            0]
[           0            0            0            1            0            0]
[           0            0            0            0            1            0]
[           0            0            0            0            0            1]
[          -x            0       -4*x^3            x            0            0]
[           0           -x       -4*x^4 -4*x^3 + x^2            0            0]
sage: alpha.matrix(Z)
[alpha]

We show that this matrix does indeed work as expected when making a vector space from a function field:

sage: # needs sage.modules sage.rings.function_field
sage: K.<x> = FunctionField(QQ)
sage: R.<y> = K[]
sage: L.<y> = K.extension(y^5 - (x^3 + 2*x*y + 1/x))
sage: V, from_V, to_V = L.vector_space()
sage: y5 = to_V(y^5); y5
((x^4 + 1)/x, 2*x, 0, 0, 0)
sage: y4y = to_V(y^4) * y.matrix(); y4y
((x^4 + 1)/x, 2*x, 0, 0, 0)
sage: y5 == y4y
True
minimal_polynomial(*args, **kwds)#

Return the minimal polynomial of the element. Give an optional input string to name the variable in the characteristic polynomial.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3); R.<z> = L[]                   # needs sage.rings.function_field
sage: M.<z> = L.extension(z^3 - y^2*z + x)                                  # needs sage.rings.function_field
sage: x.minimal_polynomial('W')                                             # needs sage.modules
W - x
sage: y.minimal_polynomial('W')                                             # needs sage.modules sage.rings.function_field
W^2 - x*W + 4*x^3
sage: z.minimal_polynomial('W')                                             # needs sage.modules sage.rings.function_field
W^3 + (-x*y + 4*x^3)*W + x
minpoly(*args, **kwds)#

Return the minimal polynomial of the element. Give an optional input string to name the variable in the characteristic polynomial.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3); R.<z> = L[]                   # needs sage.rings.function_field
sage: M.<z> = L.extension(z^3 - y^2*z + x)                                  # needs sage.rings.function_field
sage: x.minimal_polynomial('W')                                             # needs sage.modules
W - x
sage: y.minimal_polynomial('W')                                             # needs sage.modules sage.rings.function_field
W^2 - x*W + 4*x^3
sage: z.minimal_polynomial('W')                                             # needs sage.modules sage.rings.function_field
W^3 + (-x*y + 4*x^3)*W + x
norm()#

Return the norm of the element.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)                                # needs sage.rings.function_field
sage: y.norm()                                                              # needs sage.modules sage.rings.function_field
4*x^3

The norm is relative:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3); R.<z> = L[]                   # needs sage.rings.function_field
sage: M.<z> = L.extension(z^3 - y^2*z + x)                                  # needs sage.rings.function_field
sage: z.norm()                                                              # needs sage.modules sage.rings.function_field
-x
sage: z.norm().parent()                                                     # needs sage.modules sage.rings.function_field
Function field in y defined by y^2 - x*y + 4*x^3
nth_root(n)#

Return an n-th root of this element in the function field.

INPUT:

  • n – an integer

OUTPUT:

Returns an element a in the function field such that this element equals \(a^n\). Raises an error if no such element exists.

See also

is_nth_power()

EXAMPLES:

sage: K.<x> = FunctionField(GF(3))
sage: R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x)                                          # needs sage.rings.function_field
sage: L(y^27).nth_root(27)                                                  # needs sage.rings.function_field
y
poles()#

Return the list of the poles of the element.

EXAMPLES:

sage: K.<x> = FunctionField(GF(2))
sage: f = 1/(x^3 + x^2 + x)
sage: f.poles()                                                             # needs sage.libs.pari sage.modules
[Place (x), Place (x^2 + x + 1)]
sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]                             # needs sage.rings.finite_rings
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)                                # needs sage.rings.finite_rings sage.rings.function_field
sage: (x/y).poles()                                                         # needs sage.modules sage.rings.finite_rings sage.rings.function_field
[Place (1/x, 1/x*y), Place (x + 1, x*y)]
trace()#

Return the trace of the element.

EXAMPLES:

sage: K.<x> = FunctionField(QQ); R.<y> = K[]
sage: L.<y> = K.extension(y^2 - x*y + 4*x^3)                                # needs sage.rings.function_field
sage: y.trace()                                                             # needs sage.modules sage.rings.function_field
x
valuation(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)                                # needs sage.rings.function_field
sage: p = L.places_infinite()[0]                                            # needs sage.modules sage.rings.function_field
sage: y.valuation(p)                                                        # needs sage.modules sage.rings.function_field
-1
sage: # needs sage.rings.function_field
sage: K.<x> = FunctionField(QQ); _.<Y> = K[]
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)
sage: O = L.maximal_order()
sage: p = O.ideal(x - 1).place()
sage: y.valuation(p)
0
zeros()#

Return the list of the zeros of the element.

EXAMPLES:

sage: K.<x> = FunctionField(GF(2))
sage: f = 1/(x^3 + x^2 + x)
sage: f.zeros()                                                             # needs sage.libs.pari sage.modules
[Place (1/x)]
sage: K.<x> = FunctionField(GF(4)); _.<Y> = K[]                             # needs sage.rings.finite_rings
sage: L.<y> = K.extension(Y^2 + Y + x + 1/x)                                # needs sage.rings.finite_rings sage.rings.function_field
sage: (x/y).zeros()                                                         # needs sage.modules sage.rings.finite_rings sage.rings.function_field
[Place (x, x*y)]
sage.rings.function_field.element.is_FunctionFieldElement(x)#

Return True if x is any type of function field element.

EXAMPLES:

sage: t = FunctionField(QQ,'t').gen()
sage: sage.rings.function_field.element.is_FunctionFieldElement(t)
True
sage: sage.rings.function_field.element.is_FunctionFieldElement(0)
False
sage.rings.function_field.element.make_FunctionFieldElement(parent, element_class, representing_element)#

Used for unpickling FunctionFieldElement objects (and subclasses).

EXAMPLES:

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)
(x + 1)/x