---
title: "Bases"
canonical: "https://docs.magma-maths.org/v2.30-1/Modules/FreeModules/basis.html"
source: "https://docs.magma-maths.org/v2.30-1/Modules/FreeModules/basis.md"
part: "Modules"
chapter: "Free Modules"
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": "Free Modules", "source": "https://docs.magma-maths.org/v2.30-1/Modules/FreeModules/index-free-modules.md"}
prev: {"title": "Construction of Elements", "source": "https://docs.magma-maths.org/v2.30-1/Modules/FreeModules/creation.md"}
next: {"title": "Submodules", "source": "https://docs.magma-maths.org/v2.30-1/Modules/FreeModules/submodule.md"}
intrinsics:
  - {"name": "Basis", "signature": "Basis(M): ModTupRng -> [ModTupRngElt]"}
  - {"name": "Rank", "signature": "Rank(M): ModTupRng -> RngIntElt"}
  - {"name": "Coordinates", "signature": "Coordinates(M, u): ModTupRng, ModTupRngElt -> [RngElt]"}
---

# Bases

The application of the functions in this section is restricted either to vector spaces or to torsion-free modules over a Euclidean Domain. For a full description of the basis functions for a module defined over a field, the reader is referred to the chapter on vector spaces.

<a id="function-basis-modtuprng"></a>
## `Basis(M): ModTupRng -> [ModTupRngElt]`

The current basis for the free $R$-module $M$, $R$ an ED, returned as a sequence of module elements.

<a id="function-rank-modtuprng"></a>
## `Rank(M): ModTupRng -> RngIntElt`

The rank of the free $R$-module $M$.

<a id="function-coordinates-modtuprng-modtuprngelt"></a>
## `Coordinates(M, u): ModTupRng, ModTupRngElt -> [RngElt]`

Given a vector $u$ belonging to the rank $r$ free $R$-module $M$, $R$ an Euclidean Domain, with basis $u_1, \ldots, u_r$, return a sequence $[a_1, \ldots, a_r]$ giving the coordinates of $u$ relative to the $M$-basis: $u = a_1*u_1 + \cdots +a_r*u_r$.
