Elements of function fields: rational#
- class sage.rings.function_field.element_rational.FunctionFieldElement_rational[source]#
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
>>> from sage.all import * >>> K = FunctionField(QQ, names=('t',)); (t,) = K._first_ngens(1); K Rational function field in t over Rational Field >>> t**Integer(2) + Integer(3)/Integer(2)*t t^2 + 3/2*t >>> FunctionField(QQ,'t').gen()**Integer(3) t^3
- denominator()[source]#
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
>>> from sage.all import * >>> K = FunctionField(QQ, names=('t',)); (t,) = K._first_ngens(1) >>> f = (t+Integer(1)) / (t**Integer(2) - Integer(1)/Integer(3)); f (t + 1)/(t^2 - 1/3) >>> f.denominator() t^2 - 1/3
- element()[source]#
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.libs.ntl <... 'sage.rings.fraction_field_FpT.FpTElement'> sage: # needs sage.rings.finite_rings sage: K.<t> = FunctionField(GF(131101)) sage: t.element() t sage: type(t.element()) <... 'sage.rings.fraction_field_element.FractionFieldElement_1poly_field'>
>>> from sage.all import * >>> K = FunctionField(GF(Integer(7)), names=('t',)); (t,) = K._first_ngens(1) >>> t.element() t >>> type(t.element()) # needs sage.libs.ntl <... 'sage.rings.fraction_field_FpT.FpTElement'> >>> # needs sage.rings.finite_rings >>> K = FunctionField(GF(Integer(131101)), names=('t',)); (t,) = K._first_ngens(1) >>> t.element() t >>> type(t.element()) <... 'sage.rings.fraction_field_element.FractionFieldElement_1poly_field'>
- factor()[source]#
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
>>> from sage.all import * >>> # needs sage.libs.pari >>> K = FunctionField(QQ, names=('t',)); (t,) = K._first_ngens(1) >>> f = (t+Integer(1)) / (t**Integer(2) - Integer(1)/Integer(3)) >>> f.factor() (t + 1) * (t^2 - 1/3)^-1 >>> (Integer(7)*f).factor() (7) * (t + 1) * (t^2 - 1/3)^-1 >>> ((Integer(7)*f).factor()).unit() 7 >>> (f**Integer(3)).factor() (t + 1)^3 * (t^2 - 1/3)^-3
- inverse_mod(I)[source]#
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
>>> from sage.all import * >>> K = FunctionField(QQ, names=('x',)); (x,) = K._first_ngens(1) >>> O = K.maximal_order(); I = O.ideal(x**Integer(2) + Integer(1)) >>> t = O(x + Integer(1)).inverse_mod(I); t -1/2*x + 1/2 >>> (t*(x+Integer(1)) - Integer(1)) in I True
- is_nth_power(n)[source]#
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
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) # needs sage.modules True sage: (f^9).is_nth_power(-9) # needs sage.modules True
>>> from sage.all import * >>> # needs sage.rings.finite_rings >>> K = FunctionField(GF(Integer(3)), names=('x',)); (x,) = K._first_ngens(1) >>> f = (x+Integer(1))/(x-Integer(1)) >>> f.is_nth_power(Integer(1)) True >>> f.is_nth_power(Integer(3)) # needs sage.modules False >>> (f**Integer(3)).is_nth_power(Integer(3)) # needs sage.modules True >>> (f**Integer(9)).is_nth_power(-Integer(9)) # needs sage.modules True
- is_square()[source]#
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
>>> from sage.all import * >>> K = FunctionField(QQ, names=('t',)); (t,) = K._first_ngens(1) >>> t.is_square() False >>> (t**Integer(2)/Integer(4)).is_square() True >>> f = Integer(9) * (t+Integer(1))**Integer(6) / (t**Integer(2) - Integer(2)*t + Integer(1)); f.is_square() True >>> K = FunctionField(GF(Integer(5)), names=('t',)); (t,) = K._first_ngens(1) >>> (-t**Integer(2)).is_square() # needs sage.libs.pari True >>> (-t**Integer(2)).sqrt() # needs sage.libs.pari 2*t
- list()[source]#
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]
>>> from sage.all import * >>> K = FunctionField(QQ, names=('t',)); (t,) = K._first_ngens(1) >>> t.list() [t]
- nth_root(n)[source]#
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
EXAMPLES:
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) # needs sage.modules (x + 1)/(x + 2) sage: (f^9).nth_root(-9) # needs sage.modules (x + 2)/(x + 1)
>>> from sage.all import * >>> K = FunctionField(GF(Integer(3)), names=('x',)); (x,) = K._first_ngens(1) >>> f = (x+Integer(1))/(x+Integer(2)) >>> f.nth_root(Integer(1)) (x + 1)/(x + 2) >>> f.nth_root(Integer(3)) Traceback (most recent call last): ... ValueError: element is not an n-th power >>> (f**Integer(3)).nth_root(Integer(3)) # needs sage.modules (x + 1)/(x + 2) >>> (f**Integer(9)).nth_root(-Integer(9)) # needs sage.modules (x + 2)/(x + 1)
- numerator()[source]#
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
>>> from sage.all import * >>> K = FunctionField(QQ, names=('t',)); (t,) = K._first_ngens(1) >>> f = (t+Integer(1)) / (t**Integer(2) - Integer(1)/Integer(3)); f (t + 1)/(t^2 - 1/3) >>> f.numerator() t + 1
- sqrt(all=False)[source]#
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]
>>> from sage.all import * >>> K = FunctionField(QQ, names=('t',)); (t,) = K._first_ngens(1) >>> f = t**Integer(2) - Integer(2) + Integer(1)/t**Integer(2); f.sqrt() (t^2 - 1)/t >>> f = t**Integer(2); f.sqrt(all=True) [t, -t]
- valuation(place)[source]#
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
>>> from sage.all import * >>> K = FunctionField(QQ, names=('t',)); (t,) = K._first_ngens(1) >>> f = (t - Integer(1))**Integer(2)*(t + Integer(1))/(t**Integer(2) - Integer(1)/Integer(3))**Integer(3) >>> f.valuation(t - Integer(1)) 2 >>> f.valuation(t) 0 >>> f.valuation(t**Integer(2) - Integer(1)/Integer(3)) -3 >>> K = FunctionField(GF(Integer(2)), names=('x',)); (x,) = K._first_ngens(1) >>> p = K.places_finite()[Integer(0)] # needs sage.libs.pari >>> (Integer(1)/x**Integer(2)).valuation(p) # needs sage.libs.pari -2