---
title: "Elementary Functions"
canonical: "https://docs.magma-maths.org/v2.30-1/Modules/ModulesOverDedekindDomains/elementary-functions.html"
source: "https://docs.magma-maths.org/v2.30-1/Modules/ModulesOverDedekindDomains/elementary-functions.md"
part: "Modules"
chapter: "Modules over Dedekind Domains"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Modules", "source": "https://docs.magma-maths.org/v2.30-1/Modules/index-modules.md"}
  - {"title": "Modules over Dedekind Domains", "source": "https://docs.magma-maths.org/v2.30-1/Modules/ModulesOverDedekindDomains/index-modules-over-dedekind-domains.md"}
prev: {"title": "Creation of Modules", "source": "https://docs.magma-maths.org/v2.30-1/Modules/ModulesOverDedekindDomains/creation.md"}
next: {"title": "Predicates on Modules", "source": "https://docs.magma-maths.org/v2.30-1/Modules/ModulesOverDedekindDomains/ops.md"}
intrinsics:
  - {"name": "BaseRing", "signature": "BaseRing(M): ModDed -> Rng"}
  - {"name": "CoefficientRing", "signature": "CoefficientRing(M): ModDed -> Rng"}
  - {"name": "Degree", "signature": "Degree(M): ModDed -> RngIntElt"}
  - {"name": "Ngens", "signature": "Ngens(M): ModDed -> RngIntElt"}
  - {"name": "NumberOfGenerators", "signature": "NumberOfGenerators(M): ModDed -> RngIntElt"}
  - {"name": ".", "signature": "M . i: ModDed, RngIntElt -> ModTupRngElt"}
  - {"name": "Determinant", "signature": "Determinant(M): ModDed -> RngOrdIdl"}
  - {"name": "Determinant", "signature": "Determinant(M): ModDed -> RngFunOrdIdl"}
  - {"name": "Dimension", "signature": "Dimension(M): ModDed -> RngIntElt"}
  - {"name": "Contents", "signature": "Contents(M): ModDed -> RngOrdFracIdl"}
  - {"name": "Simplify", "signature": "Simplify(M): ModDed -> ModDed"}
  - {"name": "EmbeddingSpace", "signature": "EmbeddingSpace(M): ModDed -> Mod"}
examples:
  - "ex-5e5c19"
---

# Elementary Functions

Various simple properties of a module can be retrieved using the following functions.

<a id="function-basering-modded"></a>
## `BaseRing(M): ModDed -> Rng`

<a id="function-coefficientring-modded"></a>
## `CoefficientRing(M): ModDed -> Rng`

The Dedekind domain which $M$ is a module over.

<a id="function-degree-modded"></a>
## `Degree(M): ModDed -> RngIntElt`

The dimension of the vector space the module $M$ embeds into.

<a id="function-ngens-modded"></a>
## `Ngens(M): ModDed -> RngIntElt`

<a id="function-numberofgenerators-modded"></a>
## `NumberOfGenerators(M): ModDed -> RngIntElt`

The minimum number of vectors and ideals which generate the module $M$.

<a id="operation-operation-modded-rngintelt-modtuprngelt"></a>
## `M . i: ModDed, RngIntElt -> ModTupRngElt`

The vector of the $ith$ vector and ideal pair generating the module $M$.

<a id="function-determinant-modded"></a>
## `Determinant(M): ModDed -> RngOrdIdl`

<a id="function-determinant-modded-2"></a>
## `Determinant(M): ModDed -> RngFunOrdIdl`

The determinant of the module $M$.

<a id="function-dimension-modded"></a>
## `Dimension(M): ModDed -> RngIntElt`

The dimension of the vector space spanned by the module $M$ over its coefficient ring. This is the same as the number of generators of a pseudo basis of $M$.

<a id="function-contents-modded"></a>
## `Contents(M): ModDed -> RngOrdFracIdl`

```magma
UseBasis: BoolElt                    Default: false
```

The contents of the module $M$, ie. the gcd of the ideals obtained by multiplying the coefficient ideals by the ideal generated by the coefficients in the corresponding generators. The parameter `UseBasis` decides whether a pseudo basis or pseudo generators are used.

<a id="function-simplify-modded"></a>
## `Simplify(M): ModDed -> ModDed`

```magma
UseBasis: BoolElt                    Default: false
```

Computes a module of contents $1$ by scaling each coefficient ideal by the inverse of the contents of the module $M$. The parameter `UseBasis` determines if the operations are performed on the pseudo generators or the pseudo basis of $M$.

<a id="function-embeddingspace-modded"></a>
## `EmbeddingSpace(M): ModDed -> Mod`

The canonical vector space containing the module $M$, ie.. $M$ tensored with the field of fractions of the coefficient ring.

<a id="example-ex-5e5c19"></a>
## `Example: Elementary Functions on a Module (ex-5e5c19)`

The use of some elementary functions on a module is shown below.

```magma
> P<x> := PolynomialRing(Rationals());
> P<y> := PolynomialRing(P);
> F<c> := FunctionField(x^2 - y);
> M := MaximalOrderFinite(F);
> Vs := RModule(M, 2);
> s := [Vs | [1, 3], [2, 3]];
> Mods := Module(s);
> CoefficientRing(Mods);
Maximal Equation Order of F over Univariate Polynomial Ring in x over Rational
Field
> Mods.1;
(1 0)
> Determinant(Mods);
Ideal of M
Generator:
-3
> Vs := RSpace(M, 2);
> s := [Vs | [1, 3], [2, 3]];
> Mods := Module(s);
> sMods := sub<Mods | Mods!Vs![1, 3]>;
> qMods := quo<Mods | sMods>;
> Degree(Mods);
2
> Ngens(Mods);
2
> Ngens(sMods);
1
> Degree(sMods);
2
> Degree(qMods);
2
> Ngens(qMods);
2
> Determinant(Mods);
Ideal of M
Basis:
[1]
> Determinant(sMods);
>>   Determinant(sMods);
               ^
Runtime error in `Determinant': Module must be square
> Determinant(qMods);
Ideal of M
Basis:
[1]
```
