---
title: "Arithmetic"
canonical: "https://docs.magma-maths.org/v2.30-1/LocalFields/LocalGaloisRepresentations/arithmetic.html"
source: "https://docs.magma-maths.org/v2.30-1/LocalFields/LocalGaloisRepresentations/arithmetic.md"
part: "Local Fields"
chapter: "Local Galois Representations"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Local Fields", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/index-local-fields.md"}
  - {"title": "Local Galois Representations", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/LocalGaloisRepresentations/index-local-galois-representations.md"}
prev: {"title": "Basic Invariants", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/LocalGaloisRepresentations/invariants.md"}
next: {"title": "Changing Precision", "source": "https://docs.magma-maths.org/v2.30-1/LocalFields/LocalGaloisRepresentations/precision.md"}
intrinsics:
  - {"name": "+", "signature": "A1 + A2: GalRep, GalRep -> GalRep"}
  - {"name": "-", "signature": "A1 - A2: GalRep, GalRep -> BoolElt"}
  - {"name": "*", "signature": "A1 * A2: GalRep, GalRep -> GalRep"}
  - {"name": "/", "signature": "A1 / A2: GalRep, GalRep -> GalRep"}
  - {"name": "/", "signature": "A1 / A2: RngIntElt, GalRep -> GalRep"}
  - {"name": "^", "signature": "A ^ n: GalRep, Any -> GalRep"}
  - {"name": "eq", "signature": "A1 eq A2: GalRep, GalRep -> BoolElt"}
  - {"name": "Determinant", "signature": "Determinant(A): GalRep -> GalRep"}
  - {"name": "TateTwist", "signature": "TateTwist(A, n): GalRep, RngIntElt -> GalRep"}
examples:
  - "ex-1e67b8"
  - "ex-2242b4"
  - "ex-eb562c"
  - "ex-173850"
  - "ex-e6a517"
  - "ex-e59efc"
  - "ex-a9cca5"
---

<a id="galrep-arithmetic"></a>
<a id="id1"></a>
# Arithmetic

<a id="operation-op-plus-galrep-galrep"></a>
## `A1 + A2: GalRep, GalRep -> GalRep`

Direct sum of two Galois representations, both defined over the same $p$-adic field $K$.

<a id="example-ex-1e67b8"></a>
## `Example: Sums of Galois Representations (ex-1e67b8)`

```magma
> K:=pAdicField(2,20);
> SP(K,1)+SP(K,2)+SP(K,3);
6-dim Galois representation 1 + SP(2) + SP(3) over Q2[20]
```

<a id="operation-op-minus-galrep-galrep"></a>
## `A1 - A2: GalRep, GalRep -> BoolElt`

Assuming $A2$ is a Galois subrepresentation of $A1$, compute $A1-A2$.

<a id="example-ex-2242b4"></a>
## `Example: Differences of Galois Representations (ex-2242b4)`

We take $K={\mathbb{Q}}_2$, $F$ its unique degree 3 unramified extension, and compute the regular representation $\mathop{\rm Gal}\nolimits(F/K)$ minus the trivial representation, as a Galois representation over $K$.

```magma
> K:=pAdicField(2,20);
> F:=ext<K|3>;
> PermutationCharacter(F,K)-PrincipalCharacter(K);
2-dim unramified Galois representation (2,-1,-1) with G=C3, I=C1 over Q2[20]
```

<a id="operation-op-times-galrep-galrep"></a>
## `A1 * A2: GalRep, GalRep -> GalRep`

Tensor product of two Galois representations, both defined over the same $p$-adic field $K$.

<a id="example-ex-eb562c"></a>
## `Example: Tensor Products of Galois Representations (ex-eb562c)`

We take $K={\mathbb{Q}}_2$ and compute `SP(K,3)`$\otimes$`SP(K,3)`; this is basically the Clebsch-Gordan decomposition.

```magma
> K:=pAdicField(2,20);
> SP(K,3)*SP(K,3);
9-dim Galois representation Unr(1/4) + Unr(1/2)*SP(3) + SP(5) over Q2[20]
```

<a id="operation-op-div-galrep-galrep"></a>
## `A1 / A2: GalRep, GalRep -> GalRep`

<a id="operation-op-div-rngintelt-galrep"></a>
## `A1 / A2: RngIntElt, GalRep -> GalRep`

Tensor $A_1$ with $A_2^{-1}$, for $1$-dimensional $A_2$. ($A_1$ may also be the integer 0 or the integer 1.)

<a id="operation-op-pow-galrep-any"></a>
## `A ^ n: GalRep, Any -> GalRep`

Tensor power of a Galois representation. The power $n$ should be a non-negative integer for a general representation, but may be negative for 1-dimensional representations, and an arbitrary complex number for (powers of) the cyclotomic character.

<a id="example-ex-173850"></a>
## `Example: Powers of Galois Representations (ex-173850)`

```magma
> K:=pAdicField(2,20);
> CyclotomicCharacter(K)^(1/2);
1-dim unramified Galois representation Unr(1/2*sqrt(2)) over Q2[20]
> SP(K,2)^2 / CyclotomicCharacter(K);
4-dim Galois representation 1 + Unr(2)*SP(3) over Q2[20]
```

<a id="operation-op-eq-galrep-galrep"></a>
## `A1 eq A2: GalRep, GalRep -> BoolElt`

Return `true` if the two Galois representations are equal.

<a id="example-ex-e6a517"></a>
## `Example: Equality of Galois Representations (ex-e6a517)`

```magma
> K:=pAdicField(2,20);
> w:=CyclotomicCharacter(K);
> A:=Semisimplification(SP(K,2));
> A eq w^0+w;
true
```

<a id="function-determinant-galrep"></a>
## `Determinant(A): GalRep -> GalRep`

Determinant of a Galois representation (a $1$-dimensional Galois representation).

<a id="example-ex-e59efc"></a>
## `Example: Determinant of a Galois Representation (ex-e59efc)`

```magma
> K:=pAdicField(5,20);
> E:=EllipticCurve([K|0,5]);
> A:=GaloisRepresentation(E); A;
2-dim Galois representation Unr(sqrt(5)*i)*(2,-2,0,0,-1,1) with G=D6, I=C6,
   conductor 5^2 over Q5[20]
> Determinant(A) eq CyclotomicCharacter(K)^(-1);
true
```

<a id="function-tatetwist-galrep-rngintelt"></a>
## `TateTwist(A, n): GalRep, RngIntElt -> GalRep`

Tate twist $A(n)$ of a Galois representation. So $A(n)=A\otimes w^{\otimes n}$ where $w$ is the cyclotomic character.

<a id="example-ex-a9cca5"></a>
## `Example: Tate Twists of Galois Representations (ex-a9cca5)`

```magma
> K:=pAdicField(5,20);
> R<x>:=PolynomialRing(K);
> A:=GaloisRepresentations(x^2-2)[2];
> A;
1-dim unramified Galois representation (1,-1) with G=C2, I=C1 over Q5[20]
> TateTwist(A,1);
1-dim unramified Galois representation Unr(1/5)*(1,-1) with G=C2, I=C1
   over Q5[20]
> [EulerFactor(TateTwist(A,n)): n in [-2..2]];
[ 25*x + 1, 5*x + 1, x + 1, 1/5*x + 1, 1/25*x + 1 ]
```
