---
title: "Changing Coefficient Ring"
canonical: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/GrobnerBases/change-ring.html"
source: "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/GrobnerBases/change-ring.md"
part: "Commutative Algebra"
chapter: "Gröbner Bases"
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": "Gröbner Bases", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/GrobnerBases/index-grobner-bases.md"}
prev: {"title": "Gröbner Bases", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/GrobnerBases/groebner.md"}
next: {"title": "Changing Monomial Order", "source": "https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/GrobnerBases/change-order.md"}
intrinsics:
  - {"name": "ChangeRing", "signature": "ChangeRing(I, S): RngMPol, Rng -> RngMPol"}
examples:
  - "ex-d2d66e"
---

# Changing Coefficient Ring

The `ChangeRing` function enables the changing of the coefficient ring of a polynomial ring or ideal.

<a id="function-gb-changering"></a>
## `ChangeRing(I, S): RngMPol, Rng -> RngMPol`

Given an ideal $I$ of a polynomial ring $P=R[x_1, \ldots, x_n]$ of rank $n$ with coefficient ring $R$, together with a ring $S$, construct the ideal $J$ of the polynomial ring $Q=S[x_1, \ldots, x_n]$ obtained by coercing the coefficients of the elements of the basis of $I$ into $S$. It is necessary that all elements of the old coefficient ring $R$ can be automatically coerced into the new coefficient ring $S$. If $R$ and $S$ are fields and $R$ is known to be a subfield of $S$ and the current basis of $I$ is a Gröbner basis, then the basis of $J$ is marked automatically to be a Gröbner basis of $J$.

<a id="example-ex-d2d66e"></a>
## `Example: Groebner Basis over a Smaller Field (ex-d2d66e)`

It is better to find the Gröbner basis of an ideal over the smallest subfield possible (e.g. ${\mathbb{Q}}$), then use [`ChangeRing`](https://docs.magma-maths.org/v2.30-1/CommutativeAlgebra/GrobnerBases/change-ring.md#function-gb-changering) to create the equivalent ideal over a splitting field to find the variety.

```magma
> P<x, y, z, t, u> := PolynomialRing(RationalField(), 5);
> I := ideal<P |
>     x + y + z + t + u,
>     x*y + y*z + z*t + t*u + u*x,
>     x*y*z + y*z*t + z*t*u + t*u*x + u*x*y,
>     x*y*z*t + y*z*t*u + z*t*u*x + t*u*x*y + u*x*y*z,
>     x*y*z*t*u - 1>;
> Groebner(I);
> K<W> := CyclotomicField(5);
> J := ChangeRing(I, K);
> V := Variety(J);
> #V;
70
```
