---
title: "Syzygies"
canonical: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/PolynomialRingIdealOperations/syzygy-matrix.html"
source: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/PolynomialRingIdealOperations/syzygy-matrix.md"
part: "Commutative Algebra"
chapter: "Polynomial Ring Ideal Operations"
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": "Polynomial Ring Ideal Operations", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/PolynomialRingIdealOperations/index-polynomial-ring-ideal-operations.md"}
prev: {"title": "Hilbert Series and Hilbert Polynomial", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/PolynomialRingIdealOperations/hilbert.md"}
next: {"title": "Maps between Rings", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/PolynomialRingIdealOperations/maps.md"}
intrinsics:
  - {"name": "SyzygyMatrix", "signature": "SyzygyMatrix(Q): [ RngMPolElt ] -> ModMatRngElt"}
examples:
  - "ex-41f6f0"
---

# Syzygies

The main functions to compute syzygies work with or return modules. See Chapter [Modules over Multivariate Rings](https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/ModulesOverMultivariateRings/index-modules-over-multivariate-rings.md#pmod-chap) for these. This section contains a variant that returns a basis of syzygies of a polynomial sequence as rows of a matrix.

<a id="function-syzygymatrix-rngmpolelt"></a>
## `SyzygyMatrix(Q): [ RngMPolElt ] -> ModMatRngElt`

Given a sequence $Q$ of polynomials from a multivariate polynomial ring $P$, return the module of syzygies of $Q$ as a matrix $S$. This an $r$ by $k$ matrix, where $k$ is the length of $Q$, whose rows span the space of all vectors $v$ such that the sum of $v[i]*Q[i]$ for $i=1,\ldots k$ is zero. The algorithm used is the standard one, computing a module Gröbner basis with respect to a particular elimination order (see section 2.5 of [[GP02](https://docs.magma-maths.org/v2.30-1/references.md#cite-grpf02)], for example). The base ring may be a field or Euclidean ring.

<a id="example-ex-41f6f0"></a>
## `Example: Syzygy Matrix (ex-41f6f0)`

```magma
> P<x, y, z> := PolynomialRing(RationalField(), 3);
> SyzygyMatrix([x + y, x - y, x*z + y*z]);
[             z              0             -1]
[ 1/2*x - 1/2*y -1/2*x - 1/2*y              0]
```
