---
title: "Divisors in OM representation"
canonical: "https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/divisors-in-om-representation.html"
source: "https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/divisors-in-om-representation.md"
part: "Global Fields"
chapter: "Algebraic Function Fields"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Global Fields", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/index-global-fields.md"}
  - {"title": "Algebraic Function Fields", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/index-algebraic-function-fields.md"}
prev: {"title": "Ideal Operations", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/ideal-op.md"}
next: {"title": "Bibliography", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/AlgebraicFunctionFields/bibliography.md"}
intrinsics:
  - {"name": "OMDivisor", "signature": "OMDivisor(If, Ii): OMIdl, OMIdl -> OMDiv"}
  - {"name": "OMDivisor", "signature": "OMDivisor(I): OMIdl -> OMDiv"}
  - {"name": "OMDivisor", "signature": "OMDivisor(z): FldFunElt -> OMDiv"}
  - {"name": "PoleDivisor", "signature": "PoleDivisor(a): FldFunElt -> OMDiv"}
  - {"name": "ZeroDivisor", "signature": "ZeroDivisor(a): FldFunElt -> OMDiv"}
  - {"name": "OMDivisorOfDegreeOne", "signature": "OMDivisorOfDegreeOne(F): FldFun -> OMDiv"}
  - {"name": "ReferenceDivisor", "signature": "ReferenceDivisor(F): FldFun -> OMDiv"}
  - {"name": "OMDivisor", "signature": "OMDivisor(D): DivFunElt -> OMDiv"}
  - {"name": "*", "signature": "k * D: RngIntElt, OMDiv -> OMDiv"}
  - {"name": "+", "signature": "D1 + D2: OMDiv, OMDiv -> OMDiv"}
  - {"name": "-", "signature": "D1 - D2: OMDiv, OMDiv -> OMDiv"}
  - {"name": "GCD", "signature": "GCD(D1, D2): OMDiv, OMDiv -> OMDiv"}
  - {"name": "Gcd", "signature": "Gcd(D1, D2): OMDiv, OMDiv -> OMDiv"}
  - {"name": "GreatestCommonDivisor", "signature": "GreatestCommonDivisor(D1, D2): OMDiv, OMDiv -> OMDiv"}
  - {"name": "IsEffective", "signature": "IsEffective(D): OMDiv -> BoolElt"}
  - {"name": "IsPositive", "signature": "IsPositive(D): OMDiv -> BoolElt"}
  - {"name": "IsPrincipal", "signature": "IsPrincipal(D): OMDiv -> BoolElt"}
  - {"name": "eq", "signature": "D1 eq D2: OMDiv, OMDiv -> BoolElt"}
  - {"name": "Divisor", "signature": "Divisor(D): OMDiv -> DivFunElt"}
  - {"name": "Valuation", "signature": "Valuation(D, P): OMDiv, OMIdl -> RngIntElt"}
  - {"name": "Support", "signature": "Support(D): OMDiv -> [OMIdl], [RngIntElt]"}
  - {"name": "Height", "signature": "Height(D): OMDiv -> RngIntElt"}
  - {"name": "CanonicalHeight", "signature": "CanonicalHeight(D): OMDiv -> RngIntElt"}
  - {"name": "Degree", "signature": "Degree(D): OMDiv -> RngIntElt"}
  - {"name": "Basis", "signature": "Basis(D): OMDiv -> SeqEnum"}
  - {"name": "Dimension", "signature": "Dimension(D): OMDiv -> RngIntElt"}
  - {"name": "ReducedBasis", "signature": "ReducedBasis(D): OMDiv -> SeqEnum"}
  - {"name": "SemiReducedBasis", "signature": "SemiReducedBasis(D): OMDiv -> SeqEnum"}
  - {"name": "SuccessiveMinima", "signature": "SuccessiveMinima(D): OMDiv -> SeqEnum"}
  - {"name": "ApproximatedSuccessiveMinima", "signature": "ApproximatedSuccessiveMinima(D): OMDiv -> SeqEnum"}
examples:
  - "ex-42c816"
  - "ex-31985e"
  - "ex-c8e530"
  - "ex-e8bf40"
---

# Divisors in OM representation

OM representations of ideals can be used to construct divisors without computing maximal orders which are required for the divisors of type `DivFunElt`.

For detailed information please see [[Bau14](https://docs.magma-maths.org/v2.30-1/references.md#cite-bauch-thesis), [Bau16b](https://docs.magma-maths.org/v2.30-1/references.md#cite-bauch2016lattices)].

## Constructing Divisors in OM representation

<a id="function-omdivisor-omidl-omidl"></a>
### `OMDivisor(If, Ii): OMIdl, OMIdl -> OMDiv`

Given an ideal $If$ in OM representation whose function field is marked as finite and an ideal $Ii$ in OM representation whose function field is marked as infinite, return the divisor in OM representation whose support is the places associated to the prime ideals which divide either $If$ or $Ii$ with coefficients the negative of valuation of $If$ and $Ii$ at the prime ideals.

<a id="function-omdivisor-omidl"></a>
### `OMDivisor(I): OMIdl -> OMDiv`

Given an ideal $I$ in OM representation return the divisor in OM representation whose support is the places associated to the prime ideals which divide $I$ with coefficients the negative of the valuation of $I$ at the prime ideals.

<a id="function-omdivisor-fldfunelt"></a>
### `OMDivisor(z): FldFunElt -> OMDiv`

Given a non zero element $z$ of a function field, return the principal divisor $\sum_P v_P(z) P$ in OM representation.

<a id="function-poledivisor-fldfunelt"></a>
### `PoleDivisor(a): FldFunElt -> OMDiv`

Given a non zero element $a$ of a function field, return the divisor $\sum_{v_P(a)<0} -v_P(a) P$ in OM representation.

<a id="function-zerodivisor-fldfunelt"></a>
### `ZeroDivisor(a): FldFunElt -> OMDiv`

Given a non zero element $a$ of a function field, return the divisor $\sum_{v_P(a)>0} v_P(a) P$ in OM representation.

<a id="function-omdivisorofdegreeone-fldfun"></a>
### `OMDivisorOfDegreeOne(F): FldFun -> OMDiv`

Given a global function field $F$ returns a divisor of $F$ having degree 1.

<a id="function-referencedivisor-fldfun"></a>
### `ReferenceDivisor(F): FldFun -> OMDiv`

Given a function field $F$, return, if set, the divisor $B$ in OM representation used to reduce a divisor $D$ of $F$ to $\tilde D$ such $D = \tilde D+kB + (a)$.

<a id="function-omdivisor-divfunelt"></a>
### `OMDivisor(D): DivFunElt -> OMDiv`

Given a divisor $D$ of a function field of type `DivFunElt` compute an OM representation of $D$.

<a id="example-ex-42c816"></a>
### `Example: Constructing Divisors in OM Representation (ex-42c816)`

```magma
> Fq := GF(13);
> A<t> := PolynomialRing(Fq);
> Ax<x> := PolynomialRing(A);
> f := x^5+(t+1)^16*x^4+ x^2+t^3*x+t^6;
> F := FunctionField(f);
> Montes(F,t);
> Ifin := F`PrimeIdeals[t,1];
> D := OMDivisor(Ifin);
> D;
Free repr. of divisor:  -1*P(t,1)
----------------------------------------
Ideal repr. of divisor:
Finite ideal = P(t,1)
Infinite ideal =
----------------------------------------

> Iinf := PrimesAtInfinity(F)[1];
> D := OMDivisor(Ifin,Iinf);
> D;
Free repr. of divisor:  -1*P(t,1)+( -1*P(1/t,1) )
----------------------------------------
Ideal repr. of divisor:
Finite ideal = P(t,1)
Infinite ideal = P(t,1)
----------------------------------------
> D := OMDivisor(F.1);
> D;
Principal divisor generated by: 12/t^6*$.1^4 + (12*t^16 + 10*t^15 + 10*t^14 +
12*t^13 + 12*t^3 + 10*t^2 + 10*t + 12)/t^6*$.1^3 + 12/t^6*$.1 + 12/t^3
----------------------------------------
Free repr. of divisor:  3*P(t,1)+ 3*P(t,2)+( 5*P(1/t,1)+ 5*P(1/t,2)+
-16*P(1/t,3) )
----------------------------------------
Ideal repr. of divisor:
Finite ideal = P(t,1)^-3*P(t,2)^-3
Infinite ideal = P(t,1)^-5*P(t,2)^-5*P(t,3)^16
----------------------------------------

> E := PoleDivisor(F.1);
> E;
Free repr. of divisor:  16*P(1/t,3)
----------------------------------------
Ideal repr. of divisor:
Finite ideal =
Infinite ideal = P(t,3)^-16
----------------------------------------

> C := ZeroDivisor(F.1);
> C;
Free repr. of divisor:  3*P(t,1)+ 3*P(t,2)+( 5*P(1/t,1)+ 5*P(1/t,2) )
----------------------------------------
Ideal repr. of divisor:
Finite ideal = P(t,1)^-3*P(t,2)^-3
Infinite ideal = P(t,1)^-5*P(t,2)^-5
----------------------------------------

> E  := Divisor(F.1);
> D  := OMDivisor(E);
> D;
Free repr. of divisor:  3*P(t,1)+ 3*P(t,2)+( 5*P(1/t,1)+ 5*P(1/t,2)+
-16*P(1/t,3) )
----------------------------------------
Ideal repr. of divisor:
Finite ideal = P(t,1)^-3*P(t,2)^-3
Infinite ideal = P(t,1)^-5*P(t,2)^-5*P(t,3)^16
----------------------------------------
```

## Arithmetic with Divisors in OM representation

<a id="operation-op-times-rngintelt-omdiv"></a>
### `k * D: RngIntElt, OMDiv -> OMDiv`

Given an integer $k$ and a divisor $D$ in OM representation return the scalar multiple $k D$.

<a id="operation-op-plus-omdiv-omdiv"></a>
### `D1 + D2: OMDiv, OMDiv -> OMDiv`

Given divisors $D1$ and $D2$ in OM representation return their sum also in OM representation.

<a id="operation-op-minus-omdiv-omdiv"></a>
### `D1 - D2: OMDiv, OMDiv -> OMDiv`

Given divisors $D1$ and $D2$ in OM representation return their difference also in OM representation.

<a id="function-gcd-omdiv-omdiv"></a>
### `GCD(D1, D2): OMDiv, OMDiv -> OMDiv`

<a id="function-gcd-omdiv-omdiv-2"></a>
### `Gcd(D1, D2): OMDiv, OMDiv -> OMDiv`

<a id="function-greatestcommondivisor-omdiv-omdiv"></a>
### `GreatestCommonDivisor(D1, D2): OMDiv, OMDiv -> OMDiv`

Given divisors $D1$ and $D2$ in OM representation return their GCD in OM representation.

<a id="example-ex-31985e"></a>
### `Example: Arithmetic of OM Divisors (ex-31985e)`

```magma
> Fq := GF(13);
> A<t> := PolynomialRing(Fq);
> Ax<x> := PolynomialRing(A);
> f := x^5+(t+1)^16*x^4+ x^2+t^3*x+t^6;
> F := FunctionField(f);
> Montes(F,t);
> Ifin := F`PrimeIdeals[t,1];
> D := OMDivisor(Ifin);
> E := PoleDivisor(F.1);
> C := ZeroDivisor(F.1);
> D + E;
Free repr. of divisor:  -1*P(t,1)+( 16*P(1/t,3) )
----------------------------------------
Ideal repr. of divisor:
Finite ideal = P(t,1)
Infinite ideal = P(t,3)^-16
----------------------------------------

> D - C;
Free repr. of divisor:  -4*P(t,1)+ -3*P(t,2)+( -5*P(1/t,1)+ -5*P(1/t,2) )
----------------------------------------
Ideal repr. of divisor:
Finite ideal = P(t,1)^4*P(t,2)^3
Infinite ideal = P(t,1)^5*P(t,2)^5
----------------------------------------

> 5*C;
Free repr. of divisor:  15*P(t,1)+ 15*P(t,2)+( 25*P(1/t,1)+ 25*P(1/t,2) )
----------------------------------------
Ideal repr. of divisor:
Finite ideal = P(t,1)^-15*P(t,2)^-15
Infinite ideal = P(t,1)^-25*P(t,2)^-25
----------------------------------------
> GCD(D, C);
Free repr. of divisor:  -1*P(t,1)
----------------------------------------
Ideal repr. of divisor:
Finite ideal = P(t,1)
Infinite ideal =
----------------------------------------

> GCD(D, E);
Free repr. of divisor:
----------------------------------------
Ideal repr. of divisor:
Finite ideal =
Infinite ideal =
----------------------------------------
```

## Predicates on Divisors in OM representation

<a id="function-iseffective-omdiv"></a>
### `IsEffective(D): OMDiv -> BoolElt`

<a id="function-ispositive-omdiv"></a>
### `IsPositive(D): OMDiv -> BoolElt`

Given a divisor $D$ in OM representation, return whether the valuation of $D$ at every prime in its support is non negative.

<a id="function-isprincipal-omdiv"></a>
### `IsPrincipal(D): OMDiv -> BoolElt`

Given a divisor $D$ in OM representation, return whether $D$ was constructed as the divisor of an element.

<a id="operation-op-eq-omdiv-omdiv"></a>
### `D1 eq D2: OMDiv, OMDiv -> BoolElt`

Given divisors $D1$ and $D2$ in OM representation, return whether they are equal.

<a id="example-ex-c8e530"></a>
### `Example: Predicates on OM Divisors (ex-c8e530)`

Continuing with the previous example :

```magma
> IsPrincipal(OMDivisor(F.1));
true
> IsPositive(OMDivisor(F.1));
false
> IsPositive(ZeroDivisor(F.1));
true
> ZeroDivisor(F.1) eq OMDivisor(F.1);
false
```

## Other Operations on Divisors in OM representation

<a id="function-divisor-omdiv"></a>
### `Divisor(D): OMDiv -> DivFunElt`

Given a divisor $D$ in OM representation return a divisor of type `DivFunElt`.

<a id="function-valuation-omdiv-omidl"></a>
### `Valuation(D, P): OMDiv, OMIdl -> RngIntElt`

Given a divisor $D$ in OM representation and a prime ideal $P$ in OM representation, return the valuation of $D$ at $P$.

<a id="function-support-omdiv"></a>
### `Support(D): OMDiv -> [OMIdl], [RngIntElt]`

Given a divisor $D$ in OM representation, return a sequence of primes at which $D$ has non zero valuation and a sequence of the valuations that $D$ has at those primes.

<a id="function-height-omdiv"></a>
### `Height(D): OMDiv -> RngIntElt`

<a id="function-canonicalheight-omdiv"></a>
### `CanonicalHeight(D): OMDiv -> RngIntElt`

Given a divisor $D$ in OM representation, return the sum of the products of the absolute values of the valuations returned by `Support` with the degree of the primes in the `Support` of $D$ and the maximum degree of the primes in the support of $D$.

<a id="function-degree-omdiv"></a>
### `Degree(D): OMDiv -> RngIntElt`

Given a divisor $D$ in OM representation, return the sum of the products of the valuations returned by `Support` with the degrees of the primes in the support of $D$.

<a id="function-basis-omdiv"></a>
### `Basis(D): OMDiv -> SeqEnum`

Given a divisor $D$ in OM representation, return a basis of the Riemann–Roch space of $D$.

<a id="function-dimension-omdiv"></a>
### `Dimension(D): OMDiv -> RngIntElt`

Given a divisor $D$ in OM representation, return the dimension of its Riemann–Roch space.

<a id="function-reducedbasis-omdiv"></a>
### `ReducedBasis(D): OMDiv -> SeqEnum`

Given a divisor $D$ in OM representation returns a reduced basis for the lattice corresponding to $D$, that is, the lattice given by its finite ideal.

<a id="function-semireducedbasis-omdiv"></a>
### `SemiReducedBasis(D): OMDiv -> SeqEnum`

Given a divisor $D$ in OM representation returns a semi-reduced basis for the lattice corresponding to $D$, that is, the lattice given by its finite ideal.

<a id="function-successiveminima-omdiv"></a>
### `SuccessiveMinima(D): OMDiv -> SeqEnum`

Given a divisor $D$ in OM representation returns the successive minima of the lattice given by the finite ideal of $D$.

<a id="function-approximatedsuccessiveminima-omdiv"></a>
### `ApproximatedSuccessiveMinima(D): OMDiv -> SeqEnum`

Given a divisor $D$ in OM representation returns the ceiling of the successive minima of the lattice given by the finite ideal of $D$.

<a id="example-ex-e8bf40"></a>
### `Example: Operations on OM Divisors (ex-e8bf40)`

Continuing with the previous example :

```magma
> Montes(F, t);
> Ifin := F`PrimeIdeals[t,1];
> D := OMDivisor(Ifin);
> D;
Free repr. of divisor:  -1*P(t,1)
----------------------------------------
Ideal repr. of divisor:
Finite ideal = P(t,1)
Infinite ideal =
----------------------------------------

> Support(D);
[
    OM prime ideal over   t
    of Algebraic function field defined over Univariate rational function field
    over GF(13) by
    x^5 + (t^16 + 3*t^15 + 3*t^14 + t^13 + t^3 + 3*t^2 + 3*t + 1)*x^4 + x^2 +
    t^3*x + t^6
    having residual degree   1
    and ramification index   1
    Last phi polynomial is x + 10*t^3
]
[ -1 ]
> Height(D);
1 1
> Degree(D);
-1
> Basis(OMDivisor(F.1));
[
    12/t^6*F.1^4 + (12*t^16 + 10*t^15 + 10*t^14 + 12*t^13 + 12*t^3 + 10*t^2 +
        10*t + 12)/t^6*F.1^3 + 12/t^6*F.1 + 12/t^3
]
> Dimension(OMDivisor(F.1));
1
> ReducedBasis(OMDivisor(F.1));
[
    12/t^6*F.1^4 + (12*t^16 + 10*t^15 + 10*t^14 + 12*t^13 + 12*t^3 + 10*t^2 +
        10*t + 12)/t^6*F.1^3 + 12/t^6*F.1 + 12/t^3,
    1/t^3*F.1^3 + (t^16 + 3*t^15 + 3*t^14 + t^13 + t^3 + 3*t^2 + 3*t +
        1)/t^3*F.1^2 + 1/t^3,
    12*F.1^2 + (12*t^16 + 10*t^15 + 10*t^14 + 12*t^13 + 12*t^3 + 10*t^2 + 10*t +
        12)*F.1,
    F.1 + t^16 + 3*t^15 + 3*t^14 + t^13 + t^3 + 3*t^2 + 3*t + 1,
    F.1^2 + (t^16 + 3*t^15 + 3*t^14 + t^13 + t^3)*F.1 + 10*t^18 + t^17 + 7*t^16
        + 11*t^15 + 7*t^14 + 12*t^13 + 10*t^5 + t^4 + 7*t^3 + 11*t^2 + 7*t
]
> SemiReducedBasis(OMDivisor(F.1));
[
    12/t^6*F.1^4 + (12*t^16 + 10*t^15 + 10*t^14 + 12*t^13 + 12*t^3 + 10*t^2 +
        10*t + 12)/t^6*F.1^3 + 12/t^6*F.1 + 12/t^3,
    1/t^3*F.1^3 + (t^16 + 3*t^15 + 3*t^14 + t^13 + t^3 + 3*t^2 + 3*t +
        1)/t^3*F.1^2 + 1/t^3,
    12*F.1^2 + (12*t^16 + 10*t^15 + 10*t^14 + 12*t^13 + 12*t^3 + 10*t^2 + 10*t +
        12)*F.1,
    F.1 + t^16 + 3*t^15 + 3*t^14 + t^13 + t^3 + 3*t^2 + 3*t + 1,
    F.1^2 + (t^16 + 3*t^15 + 3*t^14 + t^13 + t^3)*F.1 + 10*t^18 + t^17 + 7*t^16
        + 11*t^15 + 7*t^14 + 12*t^13 + 10*t^5 + t^4 + 7*t^3 + 11*t^2 + 7*t
]
> SuccessiveMinima(OMDivisor(F.1));
[ 0, 11/2, 11, 27/2, 16 ]
> ApproximatedSuccessiveMinima(OMDivisor(F.1));
[ 0, 6, 11, 14, 16 ]
```
