# Syzygies

The main functions to compute syzygies work with or return modules. See Chapter [Modules over Multivariate Rings](../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.

## `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 [[Greuel and Pfister, 2002](../../references.md#cite-grpf02)], for example). The base ring may be a field or Euclidean ring.

## `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]

```
