Elements of function fields: rational#

class sage.rings.function_field.element_rational.FunctionFieldElement_rational#

Bases: FunctionFieldElement

Elements of a rational function field.

EXAMPLES:

sage: K.<t> = FunctionField(QQ); K
Rational function field in t over Rational Field
sage: t^2 + 3/2*t
t^2 + 3/2*t
sage: FunctionField(QQ,'t').gen()^3
t^3
denominator()#

Return the denominator of the rational function.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: f = (t+1) / (t^2 - 1/3); f
(t + 1)/(t^2 - 1/3)
sage: f.denominator()
t^2 - 1/3
element()#

Return the underlying fraction field element that represents the element.

EXAMPLES:

sage: K.<t> = FunctionField(GF(7))
sage: t.element()
t
sage: type(t.element())                                                     # needs sage.rings.finite_rings
<... 'sage.rings.fraction_field_FpT.FpTElement'>

sage: K.<t> = FunctionField(GF(131101))                                     # needs sage.libs.pari
sage: t.element()
t
sage: type(t.element())
<... 'sage.rings.fraction_field_element.FractionFieldElement_1poly_field'>
factor()#

Factor the rational function.

EXAMPLES:

sage: # needs sage.libs.pari
sage: K.<t> = FunctionField(QQ)
sage: f = (t+1) / (t^2 - 1/3)
sage: f.factor()
(t + 1) * (t^2 - 1/3)^-1
sage: (7*f).factor()
(7) * (t + 1) * (t^2 - 1/3)^-1
sage: ((7*f).factor()).unit()
7
sage: (f^3).factor()
(t + 1)^3 * (t^2 - 1/3)^-3
inverse_mod(I)#

Return an inverse of the element modulo the integral ideal \(I\), if \(I\) and the element together generate the unit ideal.

EXAMPLES:

sage: K.<x> = FunctionField(QQ)
sage: O = K.maximal_order(); I = O.ideal(x^2 + 1)
sage: t = O(x + 1).inverse_mod(I); t
-1/2*x + 1/2
sage: (t*(x+1) - 1) in I
True
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\).

ALGORITHM:

If n is a power of the characteristic of the field and the constant base field is perfect, then this uses the algorithm described in Lemma 3 of [GiTr1996].

See also

nth_root()

EXAMPLES:

sage: # needs sage.rings.finite_rings
sage: K.<x> = FunctionField(GF(3))
sage: f = (x+1)/(x-1)
sage: f.is_nth_power(1)
True
sage: f.is_nth_power(3)                                                     # needs sage.modules
False
sage: (f^3).is_nth_power(3)
True
sage: (f^9).is_nth_power(-9)
True
is_square()#

Return whether the element is a square.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: t.is_square()
False
sage: (t^2/4).is_square()
True
sage: f = 9 * (t+1)^6 / (t^2 - 2*t + 1); f.is_square()
True

sage: K.<t> = FunctionField(GF(5))
sage: (-t^2).is_square()                                                    # needs sage.libs.pari
True
sage: (-t^2).sqrt()                                                         # needs sage.libs.pari
2*t
list()#

Return a list with just the element.

The list represents the element when the rational function field is viewed as a (one-dimensional) vector space over itself.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: t.list()
[t]
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 rational function field such that this element equals \(a^n\). Raises an error if no such element exists.

ALGORITHM:

If n is a power of the characteristic of the field and the constant base field is perfect, then this uses the algorithm described in Corollary 3 of [GiTr1996].

See also

is_nth_power()

EXAMPLES:

sage: # needs sage.rings.finite_rings
sage: K.<x> = FunctionField(GF(3))
sage: f = (x+1)/(x+2)
sage: f.nth_root(1)
(x + 1)/(x + 2)
sage: f.nth_root(3)
Traceback (most recent call last):
...
ValueError: element is not an n-th power
sage: (f^3).nth_root(3)
(x + 1)/(x + 2)
sage: (f^9).nth_root(-9)
(x + 2)/(x + 1)
numerator()#

Return the numerator of the rational function.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: f = (t+1) / (t^2 - 1/3); f
(t + 1)/(t^2 - 1/3)
sage: f.numerator()
t + 1
sqrt(all=False)#

Return the square root of the rational function.

EXAMPLES:

sage: K.<t> = FunctionField(QQ)
sage: f = t^2 - 2 + 1/t^2; f.sqrt()
(t^2 - 1)/t
sage: f = t^2; f.sqrt(all=True)
[t, -t]
valuation(place)#

Return the valuation of the rational function at the place.

Rational function field places are associated with irreducible polynomials.

INPUT:

  • 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)
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]                                              # needs sage.libs.pari
sage: (1/x^2).valuation(p)                                                  # needs sage.libs.pari
-2