---
title: "Action of ${\\operatorname{PSL}}_2({\\mathbb{R}})$ on the Upper Half Plane"
canonical: "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/CongruenceSubgroupsOfPSL2R/group-action.html"
source: "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/CongruenceSubgroupsOfPSL2R/group-action.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": "The Upper Half Plane", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/CongruenceSubgroupsOfPSL2R/upper-plane.md"}
next: {"title": "Farey Symbols and Fundamental Domains", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/CongruenceSubgroupsOfPSL2R/Farey-Symbols.md"}
intrinsics:
  - {"name": "*", "signature": "g * z: GrpPSL2Elt, SpcHypElt -> SpcHypElt"}
  - {"name": "*", "signature": "g * z: GrpPSL2Elt, [SpcHypElt] -> [SpcHypElt]"}
  - {"name": "*", "signature": "g * z: GrpPSL2Elt, SetCspElt -> SetCspElt"}
  - {"name": "*", "signature": "g * z: RngIntElt, SpcHypElt -> SpcHypElt"}
  - {"name": "*", "signature": "g * z: RngIntElt, [SpcHypElt] -> [SpcHypElt]"}
  - {"name": "*", "signature": "g * z: RngIntElt, SetCspElt -> SetCspElt"}
  - {"name": "FixedPoints", "signature": "FixedPoints(g, H): GrpPSL2Elt, SpcHyp -> SeqEnum"}
  - {"name": "IsEquivalent", "signature": "IsEquivalent(G, a, b): GrpPSL2, SpcHypElt, SpcHypElt -> BoolElt, GrpPSL2Elt"}
  - {"name": "EquivalentPoint", "signature": "EquivalentPoint(x): SpcHypElt -> SpcHypElt, GrpPSL2Elt"}
  - {"name": "Stabilizer", "signature": "Stabilizer(a, G): SpcHypElt, GrpPSL2 -> GrpPSL2Elt"}
  - {"name": "FixedArc", "signature": "FixedArc(g, H): GrpPSL2Elt, SpcHyp -> SeqEnum"}
  - {"name": "+", "signature": "z + a: SpcHypElt, RngIntElt -> SpcHypElt"}
  - {"name": "+", "signature": "z + a: SpcHypElt, FldRatElt -> SpcHypElt"}
  - {"name": "-", "signature": "z - a: SpcHypElt, RngIntElt -> SpcHypElt"}
  - {"name": "-", "signature": "z - a: SpcHypElt, FldRatElt -> SpcHypElt"}
  - {"name": "*", "signature": "a * z: RngElt, SpcHypElt -> SpcHypElt"}
  - {"name": "*", "signature": "z * a: SpcHypElt, RngElt -> SpcHypElt"}
  - {"name": "*", "signature": "a * z: RngIntElt, SetCspElt -> SetCspElt"}
  - {"name": "*", "signature": "a * z: FldRatElt, SetCspElt -> SetCspElt"}
  - {"name": "*", "signature": "a * seq: RngElt, [SpcHypElt] -> [SpcHypElt]"}
  - {"name": "*", "signature": "a * z: RngIntElt, [SetCspElt] -> [SetCspElt]"}
  - {"name": "*", "signature": "a * z: FldRatElt, [SetCspElt] -> [SetCspElt]"}
  - {"name": "*", "signature": "z * a: SpcHypElt, RngIntElt -> SpcHypElt"}
  - {"name": "*", "signature": "z * a: SpcHypElt, RngIntElt -> SpcHypElt"}
  - {"name": "*", "signature": "z * a: SpcHypElt, RngIntElt -> SpcHypElt"}
  - {"name": "*", "signature": "z * a: SpcHypElt, RngIntElt -> SpcHypElt"}
  - {"name": "*", "signature": "z * a: SpcHypElt, RngIntElt -> SpcHypElt"}
  - {"name": "/", "signature": "z / a: SpcHypElt, RngIntElt -> SpcHypElt"}
  - {"name": "Distance", "signature": "Distance(z, w): SpcHypElt, SpcHypElt -> FldReElt"}
  - {"name": "TangentAngle", "signature": "TangentAngle(x, y): SpcHypElt, SpcHypElt -> FldReElt"}
  - {"name": "Angle", "signature": "Angle(e1, e2): [SpcHypElt], [SpcHypElt] -> FldReElt"}
  - {"name": "ExtendGeodesic", "signature": "ExtendGeodesic([z1,z2], H): [SpcHypElt], SpcHyp -> [SpcHypElt]"}
  - {"name": "GeodesicsIntersection", "signature": "GeodesicsIntersection(x1, x2): [SpcHypElt], [SpcHypElt] -> SeqEnum"}
  - {"name": "GeodesicsIntersection", "signature": "GeodesicsIntersection(x1, x2): [SetCspElt], [SetCspElt] -> SeqEnum"}
---

<a id="action-of-operatorname-psl-2-mathbb-r-on-the-upper-half-plane"></a>
# Action of ${\operatorname{PSL}}_2({\mathbb{R}})$ on the Upper Half Plane

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

<a id="operation-op-times-grppsl2elt-spchypelt-2"></a>
## `g * z: GrpPSL2Elt, [SpcHypElt] -> [SpcHypElt]`

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

<a id="operation-op-times-rngintelt-spchypelt"></a>
## `g * z: RngIntElt, SpcHypElt -> SpcHypElt`

<a id="operation-op-times-rngintelt-spchypelt-2"></a>
## `g * z: RngIntElt, [SpcHypElt] -> [SpcHypElt]`

<a id="operation-op-times-rngintelt-setcspelt"></a>
## `g * z: RngIntElt, SetCspElt -> SetCspElt`

For $z$ of type `SpcHypElt, SetCspElt ` or `[SpcHypElt]`, and when $g$ is an element of a projective linear group, returns the image of $z$ under the action of $g$. The type of the image is the same as the type of $z$. If $g$ is a positive integer, returns return $az$, which his is equivalent to acting on $z$ with the matrix $\begin{pmatrix}a & 0\\ 0 & 1\end{pmatrix}\in {\operatorname{PGL}}_2({\mathbb{R}})$.

<a id="function-fixedpoints-grppsl2elt-spchyp"></a>
## `FixedPoints(g, H): GrpPSL2Elt, SpcHyp -> SeqEnum`

Returns a sequence of points in $H$ fixed by the action of $g$.

<a id="function-isequivalent-grppsl2-spchypelt-spchypelt"></a>
## `IsEquivalent(G, a, b): GrpPSL2, SpcHypElt, SpcHypElt -> BoolElt, GrpPSL2Elt`

If points $a,b$ in the upper half plane are equivalent under the action of the group $G$, returns `true`, and the matrix $g$ in $G$ such that $g\cdot a = b$. Otherwise returns `false` and the identity.

<a id="function-equivalentpoint-spchypelt"></a>
## `EquivalentPoint(x): SpcHypElt -> SpcHypElt, GrpPSL2Elt`

For the point x in the upper half plane, returns a point z in the region with $-1/2 < z \leq 1/2$ and $|z| \geq 1$, and a matrix $g$ in ${\operatorname{PSL}}_2({\mathbb{Z}})$ with g\*x = z

<a id="function-stabilizer-spchypelt-grppsl2"></a>
## `Stabilizer(a, G): SpcHypElt, GrpPSL2 -> GrpPSL2Elt`

Returns a generator of the subgroup of $G$ stabilizing $a$.

<a id="function-fixedarc-grppsl2elt-spchyp"></a>
## `FixedArc(g, H): GrpPSL2Elt, SpcHyp -> SeqEnum`

If $g$ is an element of ${\operatorname{PSL}}_2({\mathbb{Z}})$ which is an involution, this returns the end points in the real line of the arc fixed by $g$, with mid point of the arc also fixed by $g$. Note that for any point $b$, the arc from $b$ to $g\cdot b$ is fixed by $g$.

## Arithmetic

<a id="operation-op-plus-spchypelt-rngintelt"></a>
### `z + a: SpcHypElt, RngIntElt -> SpcHypElt`

<a id="operation-op-plus-spchypelt-fldratelt"></a>
### `z + a: SpcHypElt, FldRatElt -> SpcHypElt`

<a id="operation-op-minus-spchypelt-rngintelt"></a>
### `z - a: SpcHypElt, RngIntElt -> SpcHypElt`

<a id="operation-op-minus-spchypelt-fldratelt"></a>
### `z - a: SpcHypElt, FldRatElt -> SpcHypElt`

For any integer $a$, and element $z$ in the upper half plane, this returns the element $z + a$ in the same copy of the upper half plane.

<a id="operation-op-times-rngelt-spchypelt"></a>
### `a * z: RngElt, SpcHypElt -> SpcHypElt`

<a id="operation-op-times-spchypelt-rngelt"></a>
### `z * a: SpcHypElt, RngElt -> SpcHypElt`

<a id="operation-op-times-rngintelt-setcspelt-2"></a>
### `a * z: RngIntElt, SetCspElt -> SetCspElt`

<a id="operation-op-times-fldratelt-setcspelt"></a>
### `a * z: FldRatElt, SetCspElt -> SetCspElt`

<a id="operation-op-times-rngelt-spchypelt-2"></a>
### `a * seq: RngElt, [SpcHypElt] -> [SpcHypElt]`

<a id="operation-op-times-rngintelt-setcspelt-3"></a>
### `a * z: RngIntElt, [SetCspElt] -> [SetCspElt]`

<a id="operation-op-times-fldratelt-setcspelt-2"></a>
### `a * z: FldRatElt, [SetCspElt] -> [SetCspElt]`

<a id="operation-op-times-spchypelt-rngintelt"></a>
### `z * a: SpcHypElt, RngIntElt -> SpcHypElt`

<a id="operation-op-times-spchypelt-rngintelt-2"></a>
### `z * a: SpcHypElt, RngIntElt -> SpcHypElt`

<a id="operation-op-times-spchypelt-rngintelt-3"></a>
### `z * a: SpcHypElt, RngIntElt -> SpcHypElt`

<a id="operation-op-times-spchypelt-rngintelt-4"></a>
### `z * a: SpcHypElt, RngIntElt -> SpcHypElt`

<a id="operation-op-times-spchypelt-rngintelt-5"></a>
### `z * a: SpcHypElt, RngIntElt -> SpcHypElt`

<a id="operation-op-div-spchypelt-rngintelt"></a>
### `z / a: SpcHypElt, RngIntElt -> SpcHypElt`

Given an element z (or a sequence of elements) in the upper half plane, and a positive rational number $a$, this returns the product (or products) in the same copy of the upper half plane.

## Distances, Angles, and Geodesics

<a id="function-distance-spchypelt-spchypelt"></a>
### `Distance(z, w): SpcHypElt, SpcHypElt -> FldReElt`

```magma
Precision: RngIntElt                    Default: 
```

Returns the hyperbolic distance between $z$ and $w$.

<a id="function-tangentangle-spchypelt-spchypelt"></a>
### `TangentAngle(x, y): SpcHypElt, SpcHypElt -> FldReElt`

```magma
Precision: RngIntElt                    Default: 
```

Returns the angle of the tangent at $x$ of the geodescic from $x$ to $y$, with given precision.

<a id="function-angle-spchypelt-spchypelt"></a>
### `Angle(e1, e2): [SpcHypElt], [SpcHypElt] -> FldReElt`

```magma
Precision: RngIntElt                    Default: 
```

Given two sequences $e_1 = [z_1,z_2]$ and $e_2 = [z_1,z_3]$, where $z1, z2, z3$ are elements of the upper half plane, this returns the angle between the geodesics at $z_1$.

<a id="function-extendgeodesic-spchypelt-spchyp"></a>
### `ExtendGeodesic([z1,z2], H): [SpcHypElt], SpcHyp -> [SpcHypElt]`

Given elements $z1, z2$ in the upper half plane $H$, this extends the geodesic between $z1$ and $z2$ to a semicircle with endpoints on the real line, and returns the two real endpoints as elements of $H$.

<a id="function-geodesicsintersection-spchypelt-spchypelt"></a>
### `GeodesicsIntersection(x1, x2): [SpcHypElt], [SpcHypElt] -> SeqEnum`

<a id="function-geodesicsintersection-setcspelt-setcspelt"></a>
### `GeodesicsIntersection(x1, x2): [SetCspElt], [SetCspElt] -> SeqEnum`

The intersection in the upper half plane of the two geodesics whose endpoints are given by the sequences $x_1$ and $x_2$. If the geodesics intersect along a line, the empty sequence is returned.
