---
title: "Ideals in OM Representation"
canonical: "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFieldsAndOrders/ideal-rep.html"
source: "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFieldsAndOrders/ideal-rep.md"
part: "Global Fields"
chapter: "Number Fields and Orders"
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": "Number Fields and Orders", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFieldsAndOrders/index-number-fields-and-orders.md"}
prev: {"title": "The Montes Algorithm", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFieldsAndOrders/montes.md"}
next: {"title": "Ideal Operations", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFieldsAndOrders/ideal-op.md"}
intrinsics:
  - {"name": "Ideal", "signature": "Ideal(I): OMIdl -> RngOrdIdl"}
  - {"name": "OMRepresentation", "signature": "OMRepresentation(I): RngFunOrdIdl -> OMIdl"}
  - {"name": "OMRepresentation", "signature": "OMRepresentation(I): RngOrdFracIdl -> OMIdl"}
  - {"name": "OMRepresentation", "signature": "OMRepresentation(L, S): FldArith, [FldArithElt] -> OMIdl"}
  - {"name": "OMRepresentation", "signature": "OMRepresentation(L, a): FldArith, FldArithElt -> OMIdl"}
  - {"name": "OMRepresentation", "signature": "OMRepresentation(L, a): FldArith, RngElt -> OMIdl"}
  - {"name": "+", "signature": "I + J: OMIdl, OMIdl -> OMIdl"}
  - {"name": "*", "signature": "I * J: OMIdl, OMIdl -> OMIdl"}
  - {"name": "/", "signature": "I / J: OMIdl, OMIdl -> OMIdl"}
  - {"name": "^", "signature": "I ^ n: OMIdl, RngIntElt -> OMIdl"}
  - {"name": "IsOne", "signature": "IsOne(I): OMIdl -> BoolElt"}
  - {"name": "IsZero", "signature": "IsZero(I): OMIdl -> BoolElt"}
  - {"name": "eq", "signature": "I eq J: OMIdl, OMIdl -> BoolElt"}
  - {"name": "in", "signature": "a in I: RngElt, OMIdl -> BoolElt"}
  - {"name": "subset", "signature": "I subset J: OMIdl, OMIdl -> BoolElt"}
  - {"name": "IsPrime", "signature": "IsPrime(I): OMIdl -> BoolElt"}
  - {"name": "IsIntegral", "signature": "IsIntegral(I): OMIdl -> BoolElt"}
examples:
  - "ex-738d2c"
  - "ex-58ff3a"
---

# Ideals in OM Representation

Ideals of type `RngOrdFracIdl` can have an OM representation computed from them. Similarly ideals constructed from the Montes algorithm in OM representation can be converted into ideals of type `RngOrdFracIdl`.

<a id="function-ideal-omidl"></a>
## `Ideal(I): OMIdl -> RngOrdIdl`

Translates ideal $I$ in OM representation into a Magma representation.

<a id="function-omrepresentation-rngfunordidl"></a>
## `OMRepresentation(I): RngFunOrdIdl -> OMIdl`

<a id="function-omrepresentation-rngordfracidl"></a>
## `OMRepresentation(I): RngOrdFracIdl -> OMIdl`

Computes the OM representation of the ideal $I$ in a number field.

<a id="function-omrepresentation-fldarith-fldarithelt"></a>
## `OMRepresentation(L, S): FldArith, [FldArithElt] -> OMIdl`

<a id="function-omrepresentation-fldarith-fldarithelt-2"></a>
## `OMRepresentation(L, a): FldArith, FldArithElt -> OMIdl`

<a id="function-omrepresentation-fldarith-rngelt"></a>
## `OMRepresentation(L, a): FldArith, RngElt -> OMIdl`

Given a number field $L$ and an element $a$ or sequence $S$ of elements in $L$, construct, in OM representation, the ideal generated by these elements.

<a id="example-ex-738d2c"></a>
## `Example: Converting to and from OM Representation (ex-738d2c)`

```magma
>      Ax<x> := PolynomialRing(Integers());
>      f := x^5 + 343*x^4 + 49*x^3 + 343*x^2 + 7*x + 6;
>      L := NumberField(f);
>      p := 7;
>      Montes(L,p);
> Ideal(L`PrimeIdeals[p,1]);
Prime Ideal
Two element generators:
    [7, 0, 0, 0, 0]
    [6, 1, 0, 0, 0]
> OMRepresentation(L, [7, 1 + L.1 + L.1^2 + L.1^3 + L.1^4]);
OM ideal of the field Number Field with defining polynomial x^5 + 343*x^4 +
49*x^3 + 343*x^2 + 7*x + 6 over the Rational Field
generated by [
7,
$.1^4 + $.1^3 + $.1^2 + $.1 + 1
]

> Ideal($1);
Ideal
Two element generators:
    [7, 0, 0, 0, 0]
    [1, 1, 1, 1, 1]
```

## Ideal Arithmetic

<a id="operation-op-plus-omidl-omidl"></a>
### `I + J: OMIdl, OMIdl -> OMIdl`

<a id="operation-op-times-omidl-omidl"></a>
### `I * J: OMIdl, OMIdl -> OMIdl`

<a id="operation-op-div-omidl-omidl"></a>
### `I / J: OMIdl, OMIdl -> OMIdl`

The sum, product or quotient of ideals $I$ and $J$ in OM representation.

<a id="operation-op-pow-omidl-rngintelt"></a>
### `I ^ n: OMIdl, RngIntElt -> OMIdl`

The $n$-th power of the ideal $I$ in OM representation.

<a id="example-ex-58ff3a"></a>
### `Example: Arithmetic of OM Ideals (ex-58ff3a)`

```magma
> Ax<x> := PolynomialRing(Integers());
> f := x^5 + 343*x^4 + 49*x^3 + 343*x^2 + 7*x + 6;
> L := NumberField(f);
> Montes(L,7);
> P := L`PrimeIdeals[7,1];
> I := OMRepresentation(L,[L.1]);
> I;
OM ideal of the field Number Field with defining polynomial x^5 + 343*x^4 +
49*x^3 + 343*x^2 + 7*x + 6 over the Rational Field
generated by [
$.1
]

> J := P^-2;
> I*J;
> I^2;
OM ideal of the field Number Field with defining polynomial x^5 + 343*x^4 +
49*x^3 + 343*x^2 + 7*x + 6 over the Rational Field
having the factorization [ <2, 1, 2>, <3, 1, 2> ]

> I/J;
OM ideal of the field Number Field with defining polynomial x^5 + 343*x^4 +
49*x^3 + 343*x^2 + 7*x + 6 over the Rational Field
having the factorization [ <2, 1, 1>, <3, 1, 1>, <7, 1, 2> ]

> I+J;
OM ideal of the field Number Field with defining polynomial x^5 + 343*x^4 +
49*x^3 + 343*x^2 + 7*x + 6 over the Rational Field
having the factorization  []
generated by [
1,
0
]
```

## Ideal Predicates

<a id="function-isone-omidl"></a>
### `IsOne(I): OMIdl -> BoolElt`

Given an ideal $I$ in OM representation returns whether the ideal is generated by the $1$ element of the field.

<a id="function-iszero-omidl"></a>
### `IsZero(I): OMIdl -> BoolElt`

Given an ideal $I$ in OM representation returns whether the ideal contains only the $0$ element of the field.

<a id="operation-op-eq-omidl-omidl"></a>
### `I eq J: OMIdl, OMIdl -> BoolElt`

Given two ideals $I$ and $J$ in OM representation returns whether these ideals are the same.

<a id="operation-op-in-rngelt-omidl"></a>
### `a in I: RngElt, OMIdl -> BoolElt`

Given an element $a$ coercible into the field containing the ideal $I$ in OM representation return whether $a$ is contained in the ideal.

<a id="operation-op-subset-omidl-omidl"></a>
### `I subset J: OMIdl, OMIdl -> BoolElt`

Given two ideals $I$ and $J$ in OM representation returns whether $I$ is contained in $J$.

<a id="function-isprime-omidl"></a>
### `IsPrime(I): OMIdl -> BoolElt`

Given an ideal $I$ in OM representation returns whether only the $1$ ideal and $I$ contain $I$.

<a id="function-isintegral-omidl"></a>
### `IsIntegral(I): OMIdl -> BoolElt`

Given an ideal $I$ in OM representation returns whether all elements in the ideal $I$ are integral.
