---
title: "Basic Module Constructions"
canonical: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/ModulesOverMultivariateRings/basic_mod_cons.html"
source: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/ModulesOverMultivariateRings/basic_mod_cons.md"
part: "Commutative Algebra"
chapter: "Modules over Multivariate Rings"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Commutative Algebra", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/index-commutative-algebra.md"}
  - {"title": "Modules over Multivariate Rings", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/ModulesOverMultivariateRings/index-modules-over-multivariate-rings.md"}
prev: {"title": "Submodules and Quotient Modules", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/ModulesOverMultivariateRings/sub-quo.md"}
next: {"title": "Predicates", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/ModulesOverMultivariateRings/predicates.md"}
intrinsics:
  - {"name": "+", "signature": "M + N: ModMPol, ModMPol -> ModMPol"}
  - {"name": "meet", "signature": "M meet N: ModMPol, ModMPol -> ModMPol"}
  - {"name": "*", "signature": "f * M: ModMPol, RngElt -> ModMPol"}
  - {"name": "*", "signature": "M * f: ModMPol, RngElt -> ModMPol"}
  - {"name": "*", "signature": "I * M: RngMPol, ModMPol -> ModMPol"}
  - {"name": "*", "signature": "M * I: ModMPol, RngMPol -> ModMPol"}
  - {"name": "/", "signature": "M / N: ModMPol, ModMPol -> ModMPol"}
  - {"name": "DirectSum", "signature": "DirectSum(M, N): ModMPol, ModMPol -> ModMPol, [ModMPolHom], [ModMPolHom]"}
  - {"name": "DirectSum", "signature": "DirectSum(S): [ModMPol] -> ModMPol, [ModMPolHom], [ModMPolHom]"}
  - {"name": "DirectSum", "signature": "DirectSum(S): [* ModMPol *] -> ModMPol, [ModMPolHom], [ModMPolHom]"}
  - {"name": "Twist", "signature": "Twist(M, d): ModMPol, RngIntElt -> [ ModMPolElt ], ModMPolHom"}
---

# Basic Module Constructions

The following functions give some fundamental basic constructions with modules.

<a id="operation-op-plus-modmpol-modmpol"></a>
## `M + N: ModMPol, ModMPol -> ModMPol`

Given compatible modules $M$ and $N$ (ie, embedded in the same ambient module), return the sum of $M$ and $N$; that is, the submodule of the ambient generated by $M$ and $N$.

<a id="operation-op-meet-modmpol-modmpol"></a>
## `M meet N: ModMPol, ModMPol -> ModMPol`

Given compatible modules $M$ and $N$ (ie, embedded in the same ambient module), return the intersection of $M$ and $N$ in the ambient. This uses the standard algorithm for intersecting two modules of a free module (see Section 2.8.3 of [[GP02](https://docs.magma-maths.org/v2.30-1/references.md#cite-grpf02)]). If the ambient is the quotient of a free module $F$ by non-trivial relations, the intersection performed is effectively that of the inverse images of $M$ and $N$ in $F$.

<a id="operation-op-times-modmpol-rngelt"></a>
## `f * M: ModMPol, RngElt -> ModMPol`

<a id="operation-op-times-modmpol-rngelt-2"></a>
## `M * f: ModMPol, RngElt -> ModMPol`

Given an $R$-module $M$ and an element $f\in R$, return the submodule of $M$ generated by $\{ f\cdot v: v \in M \}$ or $\{ v\cdot f: v \in M \}$, respectively.

<a id="operation-op-times-rngmpol-modmpol"></a>
## `I * M: RngMPol, ModMPol -> ModMPol`

<a id="operation-op-times-modmpol-rngmpol"></a>
## `M * I: ModMPol, RngMPol -> ModMPol`

Given an $R$-module $M$ and an ideal $I$ of $R$, return the submodule of $M$ generated by $\{ f\cdot v: f \in I, v \in M \}$ or $\{ v\cdot f: f \in I, v \in M \}$, respectively.

<a id="operation-op-div-modmpol-modmpol"></a>
## `M / N: ModMPol, ModMPol -> ModMPol`

Given compatible modules $M$ and $N$ (ie, embedded in the same ambient module), return the quotient module $M/(M \cap N)$. This has the same effect as using the `quo` constructor.

<a id="function-directsum-modmpol-modmpol"></a>
## `DirectSum(M, N): ModMPol, ModMPol -> ModMPol, [ModMPolHom], [ModMPolHom]`

Given $R$-modules $M$ and $N$, return the direct sum $D = M\oplus N$ and two sequences of corresponding homomorphisms giving the injections into and projections from $D$, respectively.

<a id="function-directsum-modmpol"></a>
## `DirectSum(S): [ModMPol] -> ModMPol, [ModMPolHom], [ModMPolHom]`

<a id="function-directsum-modmpol-2"></a>
## `DirectSum(S): [* ModMPol *] -> ModMPol, [ModMPolHom], [ModMPolHom]`

A sequence or list $L$ of $R$-modules, return their direct sum $D$ and two sequences of corresponding homomorphisms giving the injections into and projections from $D$, respectively.

<a id="function-twist-modmpol-rngintelt"></a>
## `Twist(M, d): ModMPol, RngIntElt -> [ ModMPolElt ], ModMPolHom`

Given a graded module $M$, and an integer $d$, return the Serre twist $M(d)$ and an isomorphism $f:M \rightarrow M(d)$. The twisted module is simply an isomorphic copy of $M$, but with the grading twisted by $d$ (so $d$ is subtracted from each weight of $M$). $f$ has degree $-d$.
