# Arithmetic

## `A1 + A2: GalRep, GalRep -> GalRep`

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

## `Example: Galrep Sum (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]

```

## `A1 - A2: GalRep, GalRep -> BoolElt`

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

## `Example: Galrep Difference (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]

```

## `A1 * A2: GalRep, GalRep -> GalRep`

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

## `Example: Galrep Product (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]

```

## `A1 / A2: GalRep, GalRep -> GalRep`

## `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 ^ 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.

## `Example: Galrep Power (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]

```

## `A1 eq A2: GalRep, GalRep -> BoolElt`

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

## `Example: Galrep Eq (ex-e6a517)`

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

```

## `Determinant(A): GalRep -> GalRep`

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

## `Example: Galrep Determinant (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

```

## `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.

## `Example: Galrep Tatetwist (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 ]

```
