---
title: "Changing Ring"
canonical: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/Matrices/change-ring.html"
source: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/Matrices/change-ring.md"
part: "Matrices and Linear Algebra"
chapter: "Matrices"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Matrices and Linear Algebra", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/index-matrices-linear-algebra.md"}
  - {"title": "Matrices", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/Matrices/index-matrices.md"}
prev: {"title": "Building Block Matrices", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/Matrices/join.md"}
next: {"title": "Elementary Arithmetic", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/Matrices/arithmetic.md"}
intrinsics:
  - {"name": "ChangeRing", "signature": "ChangeRing(A, R): Mtrx, Rng -> Mtrx"}
  - {"name": "Matrix", "signature": "Matrix(R, A): Rng, Mtrx -> Mtrx"}
  - {"name": "ChangeRing", "signature": "ChangeRing(A, R, f): Mtrx, Rng, Map -> Mtrx"}
  - {"name": "ChangeRing", "signature": "ChangeRing(A, f): Mtrx, Map -> Mtrx"}
  - {"name": "CanChangeRing", "signature": "CanChangeRing(A, R): Mtrx, Rng -> BoolElt, Mtrx"}
---

# Changing Ring

<a id="function-changering-mtrx-rng"></a>
## `ChangeRing(A, R): Mtrx, Rng -> Mtrx`

<a id="function-matrix-rng-mtrx"></a>
## `Matrix(R, A): Rng, Mtrx -> Mtrx`

Given a matrix $A$ over a ring $S$ having $m$ rows and $n$ columns, and another ring $R$, return the $m\times n$ matrix over $R$ obtained by coercing the entries of $A$ from $S$ into $R$. The argument order to `ChangeRing(A, R)` here is consistent with other forms of `ChangeRing`, while the `Matrix(R, A)` form of this function is provided to be consistent with the matrix creation functions above, for which the destination ring is the first argument, if supplied.

<a id="function-changering-mtrx-rng-map"></a>
## `ChangeRing(A, R, f): Mtrx, Rng, Map -> Mtrx`

<a id="function-changering-mtrx-map"></a>
## `ChangeRing(A, f): Mtrx, Map -> Mtrx`

Given a matrix $A$ over a ring $S$ having $m$ rows and $n$ columns, another ring $R$, and a map $f:S \rightarrow R$, return the $m\times n$ matrix over $R$ obtained by applying $f$ to each of the entries of $A$. The $R$ may be omitted, in which case it is taken to be the codomain of $f$.

<a id="function-canchangering-mtrx-rng"></a>
## `CanChangeRing(A, R): Mtrx, Rng -> BoolElt, Mtrx`

Return whether the entries in the matrix $A$ can be coerced into $R$ and the matrix resulting from `ChangeRing(A, R)` if so.
