# Decomposing and Factoring Abelian Varieties

By the Poincare reducibility theorem, every abelian variety is isogenous to a product of simple abelian subvarieties. If $A$ is a modular abelian variety over ${\mathbb{Q}}$, then $A$ is isogenous to a product of simple abelian varieties $A_f$ attached to newforms. The `Decomposition` and `Factorization` commands compute such decompositions.

## Decomposition

### `Decomposition(A): ModAbVar -> SeqEnum`

Given an abelian variety $A$, return a sequence $[B_i]$ of simple modular abelian varieties, whose product is isogenous to $A$. Each $B_i$ is equipped with an embedding into $A$ such that the sum of the images of the $B_i$ is equal to $A$. This embedding is the first element of the output of [`Embeddings`](modabvar.md#function-modabvar-embed), given a $B_i$.

### `A(n): RngIntElt, ModAbVar -> ModAbVar`

The $n$th factor in `Decomposition(A)`, denoted $A(n)$ where $A$ is an abelian variety.

### `Example: Decomp Decomposition (ex-e61813)`

We decompose $A=J_0(37)\times J_0(22)$, then find the embedding into $A$ of a factor which is isogenous to $J_0(11)$.

```magma
> A := JZero(37) * JZero(22);
> D := Decomposition(A); D;
[
    Modular abelian variety 37A of dimension 1, level 2*11*37 and
    conductor 37 over Q,
    Modular abelian variety 37B of dimension 1, level 2*11*37 and
    conductor 37 over Q,
    Modular abelian variety N(11,814,1)(11A) of dimension 1,
    level 2*11*37 and conductor 11 over Q,
    Modular abelian variety N(11,814,2)(11A) of dimension 1,
    level 2*11*37 and conductor 11 over Q
]
> B := D[3];
> Embeddings(B);
[*
Homomorphism from N(11,814,1)(11A) to JZero(37) x JZero(22) given on
integral homology by:
[ 0  0  0  0  1  0 -1  3]
[ 0  0  0  0  0  1 -2  3]
*]

```

## Factorization

### `Factorisation(A): ModAbVar -> List`

### `Factorization(A): ModAbVar -> List`

Given an abelian variety $A$, compute pairwise non-isogenous simple newform abelian varieties $A_f$ whose product, with multiplicities, is isomorphic to $A$. A list of pairs $\langle B,[\phi, \ldots]\rangle$ is returned, where $B$ is an isogeny simple abelian variety and $[\phi, \ldots]$ is a sequence of maps from $B$ into $A$ (whose length is the “multiplicity”), such that the product of all images of all $B$ is isogenous to $A$, and the sum of the dimensions of the images of $B$ is the dimension of $A$. Moreover, the $B$ are pairwise non-isogenous. To obtain a list of the images of the $B$ canonically embedded into $A$, use `Decomposition(A)`.

### `Example: Decomp Factorization (ex-189402)`

```magma
> A := JZero(37) * JZero(22);
> Factorization(A);
[*
<Modular abelian variety 37A of dimension 1, level 37 and
conductor 37 over Q, [
    Homomorphism N(37,814,1) from 37A to JZero(37) x JZero(22) given on
    integral homology by:
    [ 1 -1  1  0  0  0  0  0]
    [ 1 -1 -1  1  0  0  0  0]
]>,
<Modular abelian variety 37B of dimension 1, level 37 and
conductor 37 over Q, [
    Homomorphism N(37,814,1) from 37B to JZero(37) x JZero(22) given on
    integral homology by:
    [1 1 1 0 0 0 0 0]
    [0 0 0 1 0 0 0 0]
]>,
<Modular abelian variety 11A of dimension 1, level 11 and
conductor 11 over Q, [
    Homomorphism N(11,814,1) from 11A to JZero(37) x JZero(22) given on
    integral homology by:
    [ 0  0  0  0  0  1 -2  3]
    [ 0  0  0  0  1 -1  1  0],
    Homomorphism N(11,814,2) from 11A to JZero(37) x JZero(22) given on
    integral homology by:
    [ 0  0  0  0 -1  0  2 -2]
    [ 0  0  0  0 -1  2 -1  0]
]>
*]

```

## Decomposition with respect to an Endomorphism or a Commutative Ring

The following commands use the elements of a commutative subring of endomorphisms to decompose a modular abelian variety $A$ into a direct sum of abelian subvarieties by taking kernels (which are analogous to generalized eigenspaces).

### `DecomposeUsing(R): HomModAbVar -> SeqEnum`

Decompose an abelian variety $A$ using the commutative ring of endomorphisms generated by the space of homomorphisms $R$ of $A$.

### `DecomposeUsing(phi): MapModAbVar -> SeqEnum`

Decompose an abelian variety $A$ using the endomorphism $\phi$ of $A$.

### `Example: Decomp Decomposition With Respect To An Endomorphism Or A Commutative Ring (ex-27db11)`

```magma
> T2 := HeckeOperator(JZero(100),2);
> DecomposeUsing(T2);
[
    Modular abelian variety of dimension 1 and level 2^2*5^2 over Q,
    Modular abelian variety of dimension 5 and level 2^2*5^2 over Q,
    Modular abelian variety of dimension 1 and level 2^2*5^2 over Q
]
> W := AtkinLehnerOperator(JZero(100),100);
> DecomposeUsing(W);
[
    Modular abelian variety of dimension 3 and level 2^2*5^2 over Q,
    Modular abelian variety of dimension 4 and level 2^2*5^2 over Q
]

```

## Additional Examples

### `Example: homology1 (ex-f1a775)`

We compute a decomposition of $J_0(46)$ as a product of simple abelian subvarieties.

```magma
> J := JZero(46); J;
Modular abelian variety JZero(46) of dimension 5 and level 2*23 over Q
> Decomposition(J);
[
    Modular abelian variety 46A of dimension 1, level 2*23 and
    conductor 2*23 over Q,
    Modular abelian variety N(23,46,1)(23A) of dimension 2, level
    2*23 and conductor 23^2 over Q,
    Modular abelian variety N(23,46,2)(23A) of dimension 2, level
    2*23 and conductor 23^2 over Q
]

```

Thus $J$ decomposes as a product $E\times A \times B$, where $E$ is an elliptic curve of conductor $46$, and $A$ and $B$ are two isogenous images of $J_0(23)$.

```magma
> J(1);
Modular abelian variety 46A of dimension 1, level 2*23 and
conductor 2*23 over Q
> Conductor(J(1));
46
> Factorization(Conductor(J(2)));
[ <23, 2> ]

```

The `Factorization` command gives an explicit decomposition with embeddings of each factor into $J_0(46)$.

```magma
> Factorization(Conductor(J(2)));
[ <23, 2> ]
> Factorization(J);
[*
<Modular abelian variety 46A of dimension 1, level 2*23 and
conductor 2*23 over Q, [
    Homomorphism from 46A to JZero(46) given on integral homology
    by:
    [ 1  0 -2 -1 -1  1  1  1 -2  1]
    [ 0  1 -1 -1  0  0  0  1 -1  0]
]>,
<Modular abelian variety 23A of dimension 2, level 23 and
conductor 23^2 over Q, [
    Homomorphism N(23,46,1) from 23A to JZero(46) given on integral
    homology by:
    [-1  1 -1  1  0 -1 -1  1 -1  2]
    [ 0  0 -1  2 -2 -1  0  0  1  0]
    [ 0  0  0  1 -2  0  0  1  0  0]
    [ 0  1  0 -1  0  0  1  0  0  0],
    Homomorphism N(23,46,2) from 23A to JZero(46) given on integral
    homology by:
    [ 0 -1  0  0  1 -1  0  1  0  0]
    [-1  0  0  0  0 -1  2 -1  1 -1]
    [-1  1 -1  0  0  0  2 -2  2 -2]
    [ 0  0 -1  2 -1  0  0  0  0 -1]
]>
*]

```
