---
title: "The Intersection Pairing"
canonical: "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/ModularSymbols/intersection_pairing.html"
source: "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/ModularSymbols/intersection_pairing.md"
part: "Modular Arithmetic Geometry"
chapter: "Modular Symbols"
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": "Modular Symbols", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/ModularSymbols/index-modular-symbols.md"}
prev: {"title": "The Hecke Algebra", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/ModularSymbols/hecke-algebra.md"}
next: {"title": "$q$-Expansions", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/ModularSymbols/qexpansions.md"}
intrinsics:
  - {"name": "IntersectionPairing", "signature": "IntersectionPairing(x, y): ModSymElt, ModSymElt -> FldRatElt"}
examples:
  - "ex-3889b3"
---

# The Intersection Pairing

Magma can compute the intersection pairing

$$
H_1(X_0(N),{\mathbb{Q}}) \times H_1(X_0(N),{\mathbb{Q}}) \rightarrow {\mathbb{Q}}
$$

on the homology of the modular curve $X_0(N)$. The algorithm that we implemented is essentially the one given in [[Mer93](https://docs.magma-maths.org/v2.30-1/references.md#cite-merel-intersections)]. (Warning: There is a typo in Proposition 4 of [[Mer93](https://docs.magma-maths.org/v2.30-1/references.md#cite-merel-intersections)]; $W_i$ should be replaced by $W_i^{\varepsilon_i}$.)

<a id="function-intersectionpairing-modsymelt-modsymelt"></a>
## `IntersectionPairing(x, y): ModSymElt, ModSymElt -> FldRatElt`

The intersection pairing of the homology classes corresponding to the weight-$2$ cuspidal modular symbols $x$ and $y$. The symbols $x$ and $y$ must have the same parent, which must have trivial character and not be a $+1$ or $-1$ quotient.

<a id="example-ex-3889b3"></a>
## `Example: Intersection Pairing on X0(37) (ex-3889b3)`

In this example, we illustrate several basic properties of the intersection pairing on $H_1(X_0(37),{\mathbb{Z}})$. First, let `H37` be the space of modular symbols that corresponds to $H_1(X_0(37),{\mathbb{Z}})$, and compute a basis for `H37`.

```magma
> M37 := ModularSymbols(37,2);
> H37 := CuspidalSubspace(M37);
> Z := IntegralBasis(H37); Z;
[
    {-1/29, 0},
    {-1/22, 0},
    {-1/12, 0},
    {-1/18, 0}
]
```

Now we compute some intersection numbers.

```magma
> IntersectionPairing(Z[1],Z[2]);
-1
> IntersectionPairing(Z[3],Z[4]);
0
```

The intersection pairing is perfect and skew-symmetric, so the matrix that defines it is skew-symmetric and has determinant $\pm 1$ (in fact, it has determinant $+1$).

```magma
> A := MatrixAlgebra(RationalField(),4);
> I := A![IntersectionPairing(x,y) : x in Z, y in Z]; I;
[ 0  1  0  1]
[-1  0  1  1]
[ 0 -1  0  0]
[-1 -1  0  0]
> I + Transpose(I) eq 0;
true
> Determinant(I);
1
```

The Hecke operators are compatible with the intersection pairing in the sense that $(T_n x, y) = (x, T_n y).$

```magma
> T2 := HeckeOperator(M37,2);
> IntersectionPairing(Z[1]*T2,Z[2]);
1
> IntersectionPairing(Z[1],Z[2]*T2);
1
```

It is note the case $(T_n x, T_n y) = (x, y)$ for all $n$, $x$, and $y$.

```magma
> IntersectionPairing(Z[1]*T2,Z[2]*T2);
-2
```

The existence of the intersection pairing implies that $H_1(X_0(N),{\mathbb{Z}})$ is isomorphic, as a module over the Hecke algebra, to its linear dual ${\operatorname{Hom}}(H_1(X_0(N),{\mathbb{Z}}),{\mathbb{Z}})$.
