---
title: "Twists"
canonical: "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/ModularSymbols/twists.html"
source: "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/ModularSymbols/twists.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": "Subspaces", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/ModularSymbols/subspaces.md"}
next: {"title": "Operators", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/ModularSymbols/operators.md"}
intrinsics:
  - {"name": "IsTwist", "signature": "IsTwist(M1, M2, p): ModSym, ModSym, RngIntElt -> BoolElt, GrpDrchElt"}
  - {"name": "IsMinimalTwist", "signature": "IsMinimalTwist(M, p): ModSym, RngIntElt -> BoolElt, ModSym, GrpDrchElt"}
examples:
  - "ex-1f6206"
---

<a id="sec-twists"></a>
<a id="id1"></a>
# Twists

This section is about twists of newforms by Dirichlet characters. A newform is specified by giving a space of modular symbols that contains a single Galois-orbit (over ${\mathbb{Q}}$ or some extension of ${\mathbb{Q}}$) of newforms. Spaces of this kind are obtained using `NewformDecomposition`.

To prove that $f_2 = f_1^\chi$ holds for two newforms, the program compares their Hecke eigenvalues up to an appropriate Sturm bound. (For instance, a bound of this kind is given in Lemma 1.4 of [[BS02](https://docs.magma-maths.org/v2.30-1/references.md#cite-buzzardsteinicosahedral)]).

<a id="function-istwist-modsym-modsym-rngintelt"></a>
## `IsTwist(M1, M2, p): ModSym, ModSym, RngIntElt -> BoolElt, GrpDrchElt`

Given two spaces `M1` and `M2` of modular symbols that specify newforms $f_1$ and $f_2$ as above, and a prime $p$, this determines whether some Galois conjugate (over ${\mathbb{Q}}$) of $f_2$ is the twist of $f_1$ by a nontrivial Dirichlet character of $p$-power conductor. If so, a character $\chi$ such that $f_2 = f_1^\chi$ is also returned.

<a id="function-isminimaltwist-modsym-rngintelt"></a>
## `IsMinimalTwist(M, p): ModSym, RngIntElt -> BoolElt, ModSym, GrpDrchElt`

Given a space `M` of modular symbols that specifies a newform $f$ as above, and a prime $p$, this determines whether some Galois conjugate (over ${\mathbb{Q}}$) of $f$ is a twist of some newform of lower level by some Dirichlet character of $p$-power conductor. If so, it returns `false`, together with the newform of lower level (specified by a space of modular symbols), and the Dirichlet character.

<a id="example-ex-1f6206"></a>
## `Example: Newform That Is Its Own Twist (ex-1f6206)`

We exhibit a newform that is a twist of itself, namely the only newform of level $9$ and weight $4$. The newform is specified by the space of modular symbols on $\Gamma_0(9)$ of weight $4$ (with sign $1$).

```magma
> M9 := CuspidalSubspace(ModularSymbols(9, 4, 1));
> newforms := NewformDecomposition(NewSubspace(M9));
> newforms;
[
    Modular symbols space for Gamma_0(9) of weight 4 and dimension 1
    over Rational Field
]
> f := newforms[1];
> Eigenform(f, 20);
q - 8*q^4 + 20*q^7 - 70*q^13 + 64*q^16 + 56*q^19 + O(q^20)
```

Note that here the coefficients for primes congruent to $2$ mod $3$ are all zero.

```magma
> bool, chi := IsTwist(f, f, 3);
> bool;
true
> Parent(chi);
Group of Dirichlet characters of modulus 3 over Rational Field
> Conductor(chi), Order(chi);
3 2
```

However, $f$ is not a twist of any newform with lower level:

```magma
> bool := IsMinimalTwist(f, 3);
> bool;
true
```
