# Ideals of function fields: rational#

class sage.rings.function_field.ideal_rational.FunctionFieldIdealInfinite_rational(ring, gen)#

Fractional ideal of the maximal order of rational function field.

INPUT:

• `ring` – infinite maximal order

• `gen`– generator

Note that the infinite maximal order is a principal ideal domain.

EXAMPLES:

```sage: K.<x> = FunctionField(GF(2))
sage: Oinf = K.maximal_order_infinite()
sage: Oinf.ideal(x)
Ideal (x) of Maximal infinite order of Rational function field in x over Finite Field of size 2
```
gen()#

Return the generator of this principal ideal.

EXAMPLES:

```sage: # needs sage.rings.finite_rings
sage: K.<x> = FunctionField(GF(2))
sage: Oinf = K.maximal_order_infinite()
sage: I = Oinf.ideal((x+1)/(x^3+x), (x^2+1)/x^4)
sage: I.gen()
1/x^2
```
gens()#

Return the generator of this principal ideal.

EXAMPLES:

```sage: # needs sage.rings.finite_rings
sage: K.<x> = FunctionField(GF(2))
sage: Oinf = K.maximal_order_infinite()
sage: I = Oinf.ideal((x+1)/(x^3+x), (x^2+1)/x^4)
sage: I.gens()
(1/x^2,)
```
gens_over_base()#

Return the generator of this ideal as a rank one module over the infinite maximal order.

EXAMPLES:

```sage: # needs sage.rings.finite_rings
sage: K.<x> = FunctionField(GF(2))
sage: Oinf = K.maximal_order_infinite()
sage: I = Oinf.ideal((x+1)/(x^3+x), (x^2+1)/x^4)
sage: I.gens_over_base()
(1/x^2,)
```
is_prime()#

Return `True` if this ideal is a prime ideal.

EXAMPLES:

```sage: # needs sage.rings.finite_rings
sage: K.<x> = FunctionField(GF(2))
sage: Oinf = K.maximal_order_infinite()
sage: I = Oinf.ideal(x/(x^2 + 1))
sage: I.is_prime()
True
```
valuation(ideal)#

Return the valuation of `ideal` at this prime ideal.

INPUT:

• `ideal` – fractional ideal

EXAMPLES:

```sage: F.<x> = FunctionField(QQ)
sage: O = F.maximal_order_infinite()
sage: p = O.ideal(1/x)
sage: p.valuation(O.ideal(x/(x+1)))
0
sage: p.valuation(O.ideal(0))
+Infinity
```
class sage.rings.function_field.ideal_rational.FunctionFieldIdeal_rational(ring, gen)#

Fractional ideals of the maximal order of a rational function field.

INPUT:

• `ring` – the maximal order of the rational function field.

• `gen` – generator of the ideal, an element of the function field.

EXAMPLES:

```sage: K.<x> = FunctionField(QQ)
sage: O = K.maximal_order()
sage: I = O.ideal(1/(x^2+x)); I
Ideal (1/(x^2 + x)) of Maximal order of Rational function field in x over Rational Field
```
denominator()#

Return the denominator of this fractional ideal.

EXAMPLES:

```sage: F.<x> = FunctionField(QQ)
sage: O = F.maximal_order()
sage: I = O.ideal(x/(x^2+1))
sage: I.denominator()
x^2 + 1
```
gen()#

Return the unique generator of this ideal.

EXAMPLES:

```sage: # needs sage.rings.finite_rings
sage: K.<x> = FunctionField(GF(4))
sage: O = K.maximal_order()
sage: I = O.ideal(x^2 + x)
sage: I.gen()
x^2 + x
```
gens()#

Return the tuple of the unique generator of this ideal.

EXAMPLES:

```sage: # needs sage.rings.finite_rings
sage: K.<x> = FunctionField(GF(4))
sage: O = K.maximal_order()
sage: I = O.ideal(x^2 + x)
sage: I.gens()
(x^2 + x,)
```
gens_over_base()#

Return the generator of this ideal as a rank one module over the maximal order.

EXAMPLES:

```sage: # needs sage.rings.finite_rings
sage: K.<x> = FunctionField(GF(4))
sage: O = K.maximal_order()
sage: I = O.ideal(x^2 + x)
sage: I.gens_over_base()
(x^2 + x,)
```
is_prime()#

Return `True` if this is a prime ideal.

EXAMPLES:

```sage: K.<x> = FunctionField(QQ)
sage: O = K.maximal_order()
sage: I = O.ideal(x^3 + x^2)
sage: [f.is_prime() for f,m in I.factor()]                                  # needs sage.libs.pari
[True, True]
```
module()#

Return the module, that is the ideal viewed as a module over the ring.

EXAMPLES:

```sage: K.<x> = FunctionField(QQ)
sage: O = K.maximal_order()
sage: I = O.ideal(x^3 + x^2)
sage: I.module()                                                                                            # needs sage.modules
Free module of degree 1 and rank 1 over Maximal order of Rational
function field in x over Rational Field
Echelon basis matrix:
[x^3 + x^2]
sage: J = 0*I
sage: J.module()                                                                                            # needs sage.modules
Free module of degree 1 and rank 0 over Maximal order of Rational
function field in x over Rational Field
Echelon basis matrix:
[]
```
valuation(ideal)#

Return the valuation of the ideal at this prime ideal.

INPUT:

• `ideal` – fractional ideal

EXAMPLES:

```sage: F.<x> = FunctionField(QQ)
sage: O = F.maximal_order()
sage: I = O.ideal(x^2*(x^2+x+1)^3)
sage: [f.valuation(I) for f,_ in I.factor()]                                # needs sage.libs.pari
[2, 3]
```