---
title: "Creation Functions"
canonical: "https://docs.magma-maths.org/v2.30-1/GlobalFields/CyclotomicFields/creation.html"
source: "https://docs.magma-maths.org/v2.30-1/GlobalFields/CyclotomicFields/creation.md"
part: "Global Fields"
chapter: "Cyclotomic 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": "Cyclotomic Fields", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/CyclotomicFields/index-cyclotomic-fields.md"}
prev: {"title": "Introduction", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/CyclotomicFields/introduction.md"}
next: {"title": "Structure Operations", "source": "https://docs.magma-maths.org/v2.30-1/GlobalFields/CyclotomicFields/structure.md"}
intrinsics:
  - {"name": "CyclotomicField", "signature": "CyclotomicField(m): RngIntElt -> FldCyc"}
  - {"name": "CyclotomicPolynomial", "signature": "CyclotomicPolynomial(m): RngIntElt -> RngUPolElt"}
  - {"name": "MinimalField", "signature": "MinimalField(a): FldRatElt -> FldRat"}
  - {"name": "MinimalField", "signature": "MinimalField(a): FldCycElt -> FldCyc"}
  - {"name": "MinimalField", "signature": "MinimalField(a): RngCycElt -> RngCyc"}
  - {"name": "MinimalCyclotomicField", "signature": "MinimalCyclotomicField(a): FldRatElt -> FldRat"}
  - {"name": "MinimalCyclotomicField", "signature": "MinimalCyclotomicField(a): FldCycElt -> FldCyc"}
  - {"name": "MinimalCyclotomicField", "signature": "MinimalCyclotomicField(a): RngCycElt -> RngCyc"}
  - {"name": "MinimalField", "signature": "MinimalField(S): [ FldCycElt ] -> FldCyc"}
  - {"name": "MinimalField", "signature": "MinimalField(S): { FldCycElt } -> FldCyc"}
  - {"name": "MinimalField", "signature": "MinimalField(S): [ RngCycElt ] -> RngCyc"}
  - {"name": "MinimalField", "signature": "MinimalField(S): { RngCycElt } -> RngCyc"}
  - {"name": "MinimalCyclotomicField", "signature": "MinimalCyclotomicField(S): [ FldCycElt ] -> FldCyc"}
  - {"name": "MinimalCyclotomicField", "signature": "MinimalCyclotomicField(S): Setq -> FldCyc"}
  - {"name": "MinimalCyclotomicField", "signature": "MinimalCyclotomicField(S): { FldCycElt } -> FldCyc"}
  - {"name": "MinimalCyclotomicField", "signature": "MinimalCyclotomicField(S): [ RngCycElt ] -> RngCyc"}
  - {"name": "MinimalCyclotomicField", "signature": "MinimalCyclotomicField(S): { RngCycElt } -> RngCyc"}
  - {"name": "RootOfUnity", "signature": "RootOfUnity(n): RngIntElt -> FldCycElt"}
  - {"name": "RootOfUnity", "signature": "RootOfUnity(n, K): RngIntElt, FldCyc -> FldCycElt"}
  - {"name": "Minimise", "signature": "Minimise(~a): FldCycElt"}
  - {"name": "Minimize", "signature": "Minimize(~a): FldCycElt"}
  - {"name": "Minimise", "signature": "Minimise(~a): RngCycElt"}
  - {"name": "Minimize", "signature": "Minimize(~a): RngCycElt"}
  - {"name": "Minimise", "signature": "Minimise(~s): [ FldCycElt ]"}
  - {"name": "Minimize", "signature": "Minimize(~s): [ FldCycElt ]"}
  - {"name": "Minimise", "signature": "Minimise(~s): [ RngCycElt ]"}
  - {"name": "Minimize", "signature": "Minimize(~s): [ RngCycElt ]"}
  - {"name": "Minimise", "signature": "Minimise(a): FldCycElt -> RngElt"}
  - {"name": "Minimize", "signature": "Minimize(a): FldCycElt -> RngElt"}
  - {"name": "Minimise", "signature": "Minimise(a): RngCycElt -> RngElt"}
  - {"name": "Minimize", "signature": "Minimize(a): RngCycElt -> RngElt"}
  - {"name": "Minimise", "signature": "Minimise(s): { FldCycElt } -> { RngElt }"}
  - {"name": "Minimize", "signature": "Minimize(s): { FldCycElt } -> { RngElt }"}
  - {"name": "Minimise", "signature": "Minimise(s): { RngCycElt } -> { RngElt }"}
  - {"name": "Minimize", "signature": "Minimize(s): { RngCycElt } -> { RngElt }"}
examples:
  - "ex-644033"
---

<a id="creation"></a>
<a id="fldcyc-creation"></a>
# Creation Functions

Functions are provided to create fields of the special type `FldCyc`. Orders and elements created from a field of this type will have the special types `RngCyc` and `FldCycElt` respectively and elements created from orders `RngCycElt`. These functions provide an object with the correct type which will allow the extra functions and efficient implementations to be used.

## Creation of Cyclotomic Fields

Cyclotomic fields can be created from an integer specifying which roots of unity it should contain or from a collection of elements of an existing field or order. Cyclotomic polynomials can also be retrieved independently of the fields and orders.

<a id="function-cyclotomicfield-rngintelt"></a>
### `CyclotomicField(m): RngIntElt -> FldCyc`

```magma
Sparse: Boolean                    Default: false
```

Given a positive integer $m$, create the field obtained by adjoining the $m$-th roots of unity to ${\mathbb{Q}}$. It is possible to assign a name to the primitive $m$-th root of unity $\zeta_{m}$ using angle brackets: `R<s> := CyclotomicField(m)`.

If ```Sparse := ``true```, names for all the generating elements can be assigned.

<a id="function-cyclotomicpolynomial-rngintelt"></a>
### `CyclotomicPolynomial(m): RngIntElt -> RngUPolElt`

Given a positive integer $m$, create the cyclotomic polynomial of order $m$. This function is equivalent to `DefiningPolynomial(CyclotomicField(m))`.

<a id="function-minimalfield-fldratelt"></a>
### `MinimalField(a): FldRatElt -> FldRat`

<a id="function-minimalfield-fldcycelt"></a>
### `MinimalField(a): FldCycElt -> FldCyc`

<a id="function-minimalfield-rngcycelt"></a>
### `MinimalField(a): RngCycElt -> RngCyc`

<a id="function-minimalcyclotomicfield-fldratelt"></a>
### `MinimalCyclotomicField(a): FldRatElt -> FldRat`

<a id="function-minimalcyclotomicfield-fldcycelt"></a>
### `MinimalCyclotomicField(a): FldCycElt -> FldCyc`

<a id="function-minimalcyclotomicfield-rngcycelt"></a>
### `MinimalCyclotomicField(a): RngCycElt -> RngCyc`

Given an element $a$ from a cyclotomic field $F$ or ring $R$, this function returns the smallest cyclotomic field or order thereof (possibly the rational field or the ring of integers) $E\subset F$ containing $a$.

<a id="function-minimalfield-fldcycelt-2"></a>
### `MinimalField(S): [ FldCycElt ] -> FldCyc`

<a id="function-minimalfield-fldcycelt-3"></a>
### `MinimalField(S): { FldCycElt } -> FldCyc`

<a id="function-minimalfield-rngcycelt-2"></a>
### `MinimalField(S): [ RngCycElt ] -> RngCyc`

<a id="function-minimalfield-rngcycelt-3"></a>
### `MinimalField(S): { RngCycElt } -> RngCyc`

<a id="function-minimalcyclotomicfield-fldcycelt-2"></a>
### `MinimalCyclotomicField(S): [ FldCycElt ] -> FldCyc`

<a id="function-minimalcyclotomicfield-setq"></a>
### `MinimalCyclotomicField(S): Setq -> FldCyc`

<a id="function-minimalcyclotomicfield-fldcycelt-3"></a>
### `MinimalCyclotomicField(S): { FldCycElt } -> FldCyc`

<a id="function-minimalcyclotomicfield-rngcycelt-2"></a>
### `MinimalCyclotomicField(S): [ RngCycElt ] -> RngCyc`

<a id="function-minimalcyclotomicfield-rngcycelt-3"></a>
### `MinimalCyclotomicField(S): { RngCycElt } -> RngCyc`

Given a set or sequence $S$ of cyclotomic field or ring elements, this function returns the smallest cyclotomic field or ring (possibly the rational field or integers) $G$ containing each of the elements of $S$.

<a id="example-ex-644033"></a>
### `Example: Dense and Sparse Cyclotomic Fields (ex-644033)`

We will demonstrate the difference between the “dense” and the “sparse” representation on the cyclotomic field of order 100.

```magma
> K1 := CyclotomicField(100);
> K2 := CyclotomicField(100: Sparse := true);
> K2!K1.1;
zeta(100)_4*zeta(100)_25^19
```

Where `zeta(100)_25` indicates a 25th root of unity in a field of order 100.

```magma
> K1!K2.1;
zeta_100^25
```

## Creation of Elements

For elements of cyclotomic number fields the following conventions are used. Primitive roots of unity $\zeta_m$ are chosen in such a way that $\zeta_m^{m/d}=\zeta_d$, for every divisor $d$ of $m$; one may think of this as choosing $\zeta_m={\rm e}^{2\pi{\mathrm{i}}\over m}$ (where the roots of unity are $\zeta_m^k = {\rm e}^{2k\pi{\mathrm{i}}\over m}$) in the complex plane for every $m$ (a convention that is followed for the explicit embedding in the complex domains). Elements of cyclotomic fields and orders can also be created using coercion (`!`) and the elt constructor (`elt<|>`) where the left hand side is the field or order the element will lie in. For details about coercion see Section [Creation of Elements](https://docs.magma-maths.org/v2.30-1/GlobalFields/NumberFields/creation.md#fldnum-main-elt-create).

<a id="function-rootofunity-rngintelt"></a>
### `RootOfUnity(n): RngIntElt -> FldCycElt`

Create the $n$-th root of unity $\zeta_n$ in ${\mathbb{Q}}(\zeta_n)$.

<a id="function-rootofunity-rngintelt-fldcyc"></a>
### `RootOfUnity(n, K): RngIntElt, FldCyc -> FldCycElt`

Given a cyclotomic field $K = {\mathbb{Q}}(\zeta_m)$ and an integer $n>2$, create the $n$-th root of unity $\zeta_n$ in $K$. An error results if $\zeta_n\notin K$, that is, if $n$ does not divide $m$ (or $2m$ in case $m$ is odd).

<a id="procedure-minimise-fldcycelt-ref"></a>
### `Minimise(~a): FldCycElt`

<a id="procedure-minimize-fldcycelt-ref"></a>
### `Minimize(~a): FldCycElt`

<a id="procedure-minimise-rngcycelt-ref"></a>
### `Minimise(~a): RngCycElt`

<a id="procedure-minimize-rngcycelt-ref"></a>
### `Minimize(~a): RngCycElt`

Given an element $a$ in a cyclotomic field $F$ or ring $R$, this procedure finds the minimal cyclotomic subfield $E\subset F$ or subring $E \subset F$ containing $a$, and coerces $a$ into $E$. Note that $E$ may be ${\mathbb{Q}}$ or ${\mathbb{Z}}$.

<a id="procedure-minimise-fldcycelt-ref-2"></a>
### `Minimise(~s): [ FldCycElt ]`

<a id="procedure-minimize-fldcycelt-ref-2"></a>
### `Minimize(~s): [ FldCycElt ]`

<a id="procedure-minimise-rngcycelt-ref-2"></a>
### `Minimise(~s): [ RngCycElt ]`

<a id="procedure-minimize-rngcycelt-ref-2"></a>
### `Minimize(~s): [ RngCycElt ]`

Given a set $s$ of cyclotomic field or ring elements, this procedure finds the minimal cyclotomic field or ring $E$ containing all of them, and coerces each element into $E$. The resulting set will have universe $E$. Note that $E$ may be ${\mathbb{Q}}$ or ${\mathbb{Z}}$.

<a id="function-minimise-fldcycelt"></a>
### `Minimise(a): FldCycElt -> RngElt`

<a id="function-minimize-fldcycelt"></a>
### `Minimize(a): FldCycElt -> RngElt`

<a id="function-minimise-rngcycelt"></a>
### `Minimise(a): RngCycElt -> RngElt`

<a id="function-minimize-rngcycelt"></a>
### `Minimize(a): RngCycElt -> RngElt`

Given an element $a$ in a cyclotomic field $F$ or ring $R$, this function finds the minimal cyclotomic subfield $E\subset F$ or subring $E \subset R$ containing $a$, and coerces $a$ into $E$. Note that $E$ may be ${\mathbb{Q}}$ or ${\mathbb{Z}}$.

<a id="function-minimise-fldcycelt-2"></a>
### `Minimise(s): { FldCycElt } -> { RngElt }`

<a id="function-minimize-fldcycelt-2"></a>
### `Minimize(s): { FldCycElt } -> { RngElt }`

<a id="function-minimise-rngcycelt-2"></a>
### `Minimise(s): { RngCycElt } -> { RngElt }`

<a id="function-minimize-rngcycelt-2"></a>
### `Minimize(s): { RngCycElt } -> { RngElt }`

Given a set $s$ of cyclotomic field or ring elements, this function finds the minimal cyclotomic field $E$ containing all of them, and coerces each element into $E$. The resulting set will have universe $E$. Note that $E$ may be ${\mathbb{Q}}$ or ${\mathbb{Z}}$.
