---
title: "Standard Constructions"
canonical: "https://docs.magma-maths.org/v2.30-1/Modules/FreeModules/operation.html"
source: "https://docs.magma-maths.org/v2.30-1/Modules/FreeModules/operation.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": "Accessing Module Information", "source": "https://docs.magma-maths.org/v2.30-1/Modules/FreeModules/access.md"}
next: {"title": "Construction of Elements", "source": "https://docs.magma-maths.org/v2.30-1/Modules/FreeModules/creation.md"}
intrinsics:
  - {"name": "ChangeRing", "signature": "ChangeRing(M, S): ModRng, Rng -> ModRng, Map"}
  - {"name": "ChangeRing", "signature": "ChangeRing(M, S, f): ModRng, Rng, Map -> ModRng, Map"}
  - {"name": "ChangeUniverse", "signature": "ChangeUniverse(~x, R): ModTupRngElt, Rng -> ModRng, Map"}
  - {"name": "DirectSum", "signature": "DirectSum(M, N): ModRng, ModRng -> ModRng, Map, Map, Map, Map"}
  - {"name": "DirectSum", "signature": "DirectSum(Q): [ ModRng ] -> [ ModRng ], [ Map ], [ Map ]"}
---

<a id="modules-standard-constructions"></a>
# Standard Constructions

Given one or more existing modules, various standard constructions are available to construct new modules.

## Changing the Coefficient Ring

<a id="function-changering-modrng-rng"></a>
### `ChangeRing(M, S): ModRng, Rng -> ModRng, Map`

Given a module $M$ with base ring $R$, together with a ring $S$, construct the module $N$ with base ring $S$ obtained by coercing the components of elements of $M$ into $N$, together with the homomorphism from $M$ to $N$.

<a id="function-changering-modrng-rng-map"></a>
### `ChangeRing(M, S, f): ModRng, Rng, Map -> ModRng, Map`

Given a module $M$ with base ring $R$, together with a ring $S$, and a homomorphism $f: R \rightarrow S$, construct the module $N$ with base ring $S$ obtained by mapping the components of elements of $M$ into $N$ by $f$, together with the homomorphism from $M$ to $N$.

<a id="function-changeuniverse-modtuprngelt-rng-ref"></a>
### `ChangeUniverse(~x, R): ModTupRngElt, Rng -> ModRng, Map`

Change the coefficient ring of $x$ to be $R$.

## Direct Sums

<a id="function-directsum-modrng-modrng"></a>
### `DirectSum(M, N): ModRng, ModRng -> ModRng, Map, Map, Map, Map`

Given $R$-modules $M$ and $N$, construct the direct sum $D$ of $M$ and $N$ as an $R$-module. The embedding maps from $M$ into $D$ and from $N$ into $D$ respectively, and the projection maps from $D$ onto $M$ and from $D$ onto $N$ respectively are also returned.

<a id="function-directsum-modrng"></a>
### `DirectSum(Q): [ ModRng ] -> [ ModRng ], [ Map ], [ Map ]`

Given a sequence $Q$ of $R$-modules, construct the direct sum $D$ of these modules. The embedding maps from each of the elements of $Q$ into $D$ and the projection maps from $D$ onto each of the elements of $Q$ are also returned.
