---
title: "Changing Ring"
canonical: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/change-ring.html"
source: "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/change-ring.md"
part: "Matrices and Linear Algebra"
chapter: "Sparse 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": "Sparse Matrices", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/index-sparse-matrices.md"}
prev: {"title": "Conversion to and from Dense Matrices", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/conversion.md"}
next: {"title": "Predicates", "source": "https://docs.magma-maths.org/v2.30-1/MatricesLinearAlgebra/SparseMatrices/predicates.md"}
intrinsics:
  - {"name": "ChangeRing", "signature": "ChangeRing(A, R): MtrxSprs, Rng -> MtrxSprs"}
  - {"name": "SparseMatrix", "signature": "SparseMatrix(R, A): Rng, MtrxSprs -> MtrxSprs"}
---

# Changing Ring

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

<a id="function-sparsematrix-rng-mtrxsprs"></a>
## `SparseMatrix(R, A): Rng, MtrxSprs -> MtrxSprs`

Given a sparse matrix $A$ over a ring $S$ having $m$ rows and $n$ columns, and another ring $R$, return the $m\times n$ sparse 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 `SparseMatrix(R, A)` form of this function is provided to be consistent with the sparse matrix creation functions above, for which the destination ring is the first argument, if supplied.
