---
title: "Elements of ${\\operatorname{PSL}}_2({\\mathbb{R}})$"
canonical: "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/CongruenceSubgroupsOfPSL2R/GrpPSL2Elt.html"
source: "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/CongruenceSubgroupsOfPSL2R/GrpPSL2Elt.md"
part: "Modular Arithmetic Geometry"
chapter: "Congruence Subgroups of ${\\operatorname{PSL}}_2({\\mathbb{R}})$"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Modular Arithmetic Geometry", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/index-modular-arithmetic-geometry.md"}
  - {"title": "Congruence Subgroups of ${\\operatorname{PSL}}_2({\\mathbb{R}})$", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/CongruenceSubgroupsOfPSL2R/index-congruence-subgroups-of-psl2-r.md"}
prev: {"title": "Structure of Congruence Subgroups", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/CongruenceSubgroupsOfPSL2R/structure-of-congruence-groups.md"}
next: {"title": "The Upper Half Plane", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/CongruenceSubgroupsOfPSL2R/upper-plane.md"}
intrinsics:
  - {"name": "!", "signature": "G ! x: GrpPSL2, . -> GrpPSL2"}
  - {"name": "!", "signature": "G ! x: GrpPSL2, RngIntElt -> GrpPSL2"}
  - {"name": "!", "signature": "G ! x: GrpPSL2, GrpMatElt -> GrpPSL2"}
  - {"name": "!", "signature": "G ! x: GrpPSL2, AlgMatElt -> GrpPSL2"}
  - {"name": "!", "signature": "G ! x: GrpPSL2, GrpPSL2Elt -> GrpPSL2"}
  - {"name": "Random", "signature": "Random(G, m): GrpPSL2, RngIntElt -> GrpPSL2Elt"}
  - {"name": "eq", "signature": "g eq h: GrpPSL2Elt, GrpPSL2Elt -> BoolElt"}
  - {"name": "IsEquivalent", "signature": "IsEquivalent(g, h, G): GrpPSL2Elt, GrpPSL2Elt, GrpPSL2 -> BoolElt"}
  - {"name": "in", "signature": "g in G: GrpPSL2Elt, GrpPSL2 -> BoolElt"}
  - {"name": "Eltseq", "signature": "Eltseq(g): GrpPSL2Elt -> SeqEnum"}
  - {"name": "*", "signature": "g * h: GrpPSL2Elt, GrpPSL2Elt -> GrpPSL2Elt"}
  - {"name": "^", "signature": "g ^ n: GrpPSL2Elt, RngIntElt -> GrpPSL2Elt"}
examples:
  - "ex-baea46"
---

<a id="elements-of-operatorname-psl-2-mathbb-r"></a>
# Elements of ${\operatorname{PSL}}_2({\mathbb{R}})$

## Creation

<a id="operation-op-grppsl2"></a>
### `G ! x: GrpPSL2, . -> GrpPSL2`

<a id="operation-op-grppsl2-rngintelt"></a>
### `G ! x: GrpPSL2, RngIntElt -> GrpPSL2`

<a id="operation-op-grppsl2-grpmatelt"></a>
### `G ! x: GrpPSL2, GrpMatElt -> GrpPSL2`

<a id="operation-op-grppsl2-algmatelt"></a>
### `G ! x: GrpPSL2, AlgMatElt -> GrpPSL2`

<a id="operation-op-grppsl2-grppsl2elt"></a>
### `G ! x: GrpPSL2, GrpPSL2Elt -> GrpPSL2`

If $x$ is a sequence $x = [a,b,c,d]$ of elements in the base ring of $G$, this function returns $\begin{pmatrix}a & b\\ c & d\end{pmatrix}$, provided this is an element of $G$. If $x$ is an integer the identity matrix is returned. If $x$ is a matrix, it is coerced into $G$ if possible.

<a id="function-random-grppsl2-rngintelt"></a>
### `Random(G, m): GrpPSL2, RngIntElt -> GrpPSL2Elt`

Returns a random element of the projective linear group $G$, with $m$ determining the size of the coefficients.

## Membership and Equality Testing

<a id="operation-op-eq-grppsl2elt-grppsl2elt"></a>
### `g eq h: GrpPSL2Elt, GrpPSL2Elt -> BoolElt`

For $g$ and $h$ elements of ${\operatorname{PSL}}_2({\mathbb{Z}})$, returns `true` if $g, h$ have compatible coefficient rings and if $g = h$, `false` otherwise. Since the group is projective, returns `true` if the matrices are equal up to a nonzero scalar multiple.

<a id="function-isequivalent-grppsl2elt-grppsl2elt-grppsl2"></a>
### `IsEquivalent(g, h, G): GrpPSL2Elt, GrpPSL2Elt, GrpPSL2 -> BoolElt`

For $g$ and $h$ elements of ${\operatorname{PSL}}_2({\mathbb{Z}})$, returns `true` if $g$ and $h$ are defined of the same field, and if $Gg = Gh$, i.e. if $gh^{-1}\in G$.

<a id="operation-op-in-grppsl2elt-grppsl2"></a>
### `g in G: GrpPSL2Elt, GrpPSL2 -> BoolElt`

For $g$ an elements of ${\operatorname{PSL}}_2({\mathbb{Z}})$, returns `true` if $g$ is in the congruence subgroup $G$, `false` otherwise.

## Basic Functions

For a matrix $g$ in a congruence subgroup, and an integer $n$, returns $g^n$.

<a id="function-eltseq-grppsl2elt"></a>
### `Eltseq(g): GrpPSL2Elt -> SeqEnum`

Returns the sequence of four numbers which are the entries of the matrix $g$.

<a id="operation-op-times-grppsl2elt-grppsl2elt"></a>
### `g * h: GrpPSL2Elt, GrpPSL2Elt -> GrpPSL2Elt`

If $g$ and $h$ have the same parent then this returns their product.

<a id="operation-op-pow-grppsl2elt-rngintelt"></a>
### `g ^ n: GrpPSL2Elt, RngIntElt -> GrpPSL2Elt`

For a matrix $g$ and integer $n$ returns $g^n$.

<a id="example-ex-baea46"></a>
### `Example: Elements of Congruence Subgroups (ex-baea46)`

Define congruence subgroups as in the following examples:

```magma
> // examples of defining matrix elements of congruence subgroups:
>
> G := PSL2(Integers());
> G![2,0,0,2];
[1 0]
[0 1]

> H := CongruenceSubgroup([2,3,6]);
> H![7,6,8,7];
[7 6]
[8 7]
```
