# Homomorphisms

## Creation

The commands below create the multiplication by $n$ map on an abelian variety, for any $n$. Other ways to create homomorphisms are described in other sections of this chapter. These include computing Hecke operators, Atkin-Lehner operators, and computing the full endomorphism and homomorphism rings, and choosing elements in them.

### `IdentityMap(A): ModAbVar -> MapModAbVar`

The identity homomorphism from the modular abelian variety $A$ to $A$.

### `ZeroMap(A): ModAbVar -> MapModAbVar`

The zero homomorphism from the modular abelian variety $A$ to $A$.

### `nIsogeny(A, n): ModAbVar, FldRatElt -> MapModAbVar`

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

The multiplication by $n$ isogeny on the modular abelian variety $A$, where $n$ is a rational number or an integer.

### `Example: Morphisms Creation (ex-c44dcb)`

```magma
> A := JZero(23);
> IdentityMap(A);
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[1 0 0 0]
[0 1 0 0]
[0 0 1 0]
[0 0 0 1]
> ZeroMap(A);
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[0 0 0 0]
[0 0 0 0]
[0 0 0 0]
[0 0 0 0]
> nIsogeny(A,3);
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[3 0 0 0]
[0 3 0 0]
[0 0 3 0]
[0 0 0 3]
> nIsogeny(A,1/3);
Homomorphism from JZero(23) to JZero(23) (up to isogeny) on integral
homology by:
[1/3   0   0   0]
[  0 1/3   0   0]
[  0   0 1/3   0]
[  0   0   0 1/3]

```

## Restriction, Evaluation, and Other Manipulations

Suppose $A$ is an abelian variety, $B$ is an abelian subvariety of $A$, and $\phi$ is a homomorphism from $A$. Then the `Restriction` command computes the restriction of $\phi$ to $B$. If, moreover, $\phi$ is an endomorphism of $A$ (i.e., also has codomain $A$) and $\phi(B)$ is contained in $B$, then `RestrictEndomorphism` computes the endomorphism of $B$ induced by $\phi$.

If $f$ is a polynomial over the integers or rational numbers and $\phi$ is an endomorphism of an abelian variety, then the `Evaluate` command computes the endomorphism $f(\phi)$ (if $f$ has denominators, then $f(\phi)$ might only be a morphism on abelian varieties up to isogeny). Together with the `Kernel` command, `Evaluate` is useful for cutting out subvarieties of an abelian variety.

The `SurjectivePart`, `DivideOutIntegers`, and `UniversalPropertyOfCokernel` commands can also all be useful in various contexts for constructing homomorphisms.

### `Restriction(phi, B): MapModAbVar, ModAbVar -> MapModAbVar`

The restriction of the map of abelian varieties $\phi$ to a morphism from the abelian variety $B$ to the codomain of $\phi$, if this obviously makes sense.

### `RestrictEndomorphism(phi, B): MapModAbVar, ModAbVar -> MapModAbVar`

The restriction of the map of abelian varieties $\phi$ to an endomorphism of the abelian variety $B$, if this obviously makes sense. If $B$ is not left invariant by $\phi$, an error may occur.

### `RestrictEndomorphism(phi, i): MapModAbVar, MapModAbVar -> MapModAbVar`

Suppose $\phi$ is an endomorphism of an abelian variety $A$ and $i:B \to A$ is an injective morphism of abelian varieties such that $i(B)$ is invariant under $\phi$. This intrinsic computes the endomorphism $\psi$ of $B$ induced by $\phi$. If $i(B)$ is not left invariant by $\phi$, an error may occur.

### `RestrictionToImage(phi, i): MapModAbVar, MapModAbVar -> MapModAbVar`

Suppose $i:A \to D$ and $\phi :D\to B$ are morphisms of abelian varieties. This intrinsic computes the restriction of $\phi$ to the image of $i$. The resulting map is an endomorphism of the image of $i$.

### `Evaluate(f, phi): RngUPolElt, MapModAbVar -> MapModAbVar`

The endomorphism $f(\phi )$ of $A$, where $f$ is a univariate polynomial and $\phi$ is an endomorphism of a modular abelian variety $A$.

### `DivideOutIntegers(phi): MapModAbVar -> MapModAbVar, RngIntElt`

If $\phi :A$ $\to$ $B$ is a homomorphism of abelian varieties, find the largest integer $n$ such that $\psi =(1/n)*\phi$ is also a homomorphism from $A$ to $B$ and return $\psi$ and $n$.

### `SurjectivePart(phi): MapModAbVar -> MapModAbVar`

Let $\phi :A\to$ $B$ be a homomorphism. This intrinsic returns the *surjective* homomorphism $\pi :A\to$ $\phi (A)$ induced by $\phi$.

### `UniversalPropertyOfCokernel(pi, f): MapModAbVar, MapModAbVar -> MapModAbVar`

Uses the universal property of the cokernel to find the unique morphism with a certain property. More precisely, suppose $\pi :B\to$ $C$ is the cokernel of a morphism, so $\pi$ is surjective with kernel $K$. Suppose $f:B$ $\to$ $D$ is a morphism whose kernel contains $K$. By definition of cokernel, there exists a unique morphism $\psi :C$ $\to$ $D$ such that $\pi *\psi$ $=$ $f$. This intrinsic returns $\psi$. If we only have that the identity component of $\ker (\pi )$ is contained in `ker(f)`, then $\psi$ will only be a homomorphism in the category of abelian varieties up to isogeny, i.e., it will have a nontrivial denominator.

### `Example: Morphisms Restriction, Evaluation, And Other Manipulations (ex-a8b4fd)`

We use the `Evaluate` and `Kernel` commands to cut out a $2$-dimensional abelian subvariety of $J_0(65)$.

```magma
> J := JZero(65);
> R<x> := PolynomialRing(RationalField());
> T2 := HeckeOperator(J,2);
> Factorization(CharacteristicPolynomial(T2));
[
    <x + 1, 2>,
    <x^2 - 3, 2>,
    <x^2 + 2*x - 1, 2>
]
> phi := Evaluate(x^2-3,T2);
> _,A := Kernel(phi);
> A;
Modular abelian variety of dimension 2 and level 5*13 over Q

```

### `Example: Morphisms Restriction, Evaluation, And Other Manipulations2 (ex-2126fc)`

This example illustrates the universal property of the cokernel. We decompose $J=J_0(65)$ as a product of simples $A$, $B$, and $C$, of dimensions $1$, $2$, and $2$, respectively. Then we let $\pi$ be a homomorphism from $J$ onto $B+C$, and $f$ a homomorphism from $J$ onto $B$. The universal property supplies a morphism $\psi$ from $B+C$ to $B$ such that $\pi * \psi = f$ (i.e., $f(x) = \psi(\pi(x))$ for all $x$).

```magma
> J := JZero(65);
> A,B,C := Explode(Decomposition(J));
> pi := NaturalMap(J,B+C);
> IsSurjective(pi);
true
> f := NaturalMap(J,B);
> psi := UniversalPropertyOfCokernel(pi,f); psi;
Homomorphism from modular abelian variety of dimension 4 to 65B
(up to isogeny) on integral homology by:
 (not printing 8x4 matrix)
> Matrix(psi);
[ 1/2    0    0 -1/2]
[ 1/2    0 -1/2  1/2]
[   0 -1/2  1/2    0]
[   0    0 -1/2    1]
[ 1/2 -1/2 -1/2  1/2]
[ 1/2    0 -1/2  1/2]
[   0  1/2    0    0]
[   0    0  1/2    0]
> pi*psi eq f;    // apply pi then psi is the same as applying f.
true
> Denominator(psi);
2

```

Since $\psi$ has a denominator of $2$, it is only a morphism in the category of abelian varieties up to isogeny. This is because only the connected component of the kernel of $\pi$ is contained in the kernel of $f$.

```magma
> G := Kernel(pi); G;
Finitely generated subgroup of abelian variety with invariants
[ 2, 2, 2, 2, 2, 2 ]
> H, K := Kernel(f);
> H;
{ 0 }: finitely generated subgroup of abelian variety with
invariants []
> G subset K;
false

```

### `Example: Morphisms Restriction, Evaluation, And Other Manipulations3 (ex-40f7a8)`

Next we illustrate dividing out by integers, by dividing the $10$ out of $10T_{3}$ acting on $J_0(23)$. Note that this division occurs in the full endomorphism ring, not just the Hecke algebra.

```magma
> phi := 10*HeckeOperator(JZero(23),3); phi;
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[-10 -20  20   0]
[  0 -30  20 -20]
[ 20 -40  30 -20]
[ 20 -20   0  10]
> DivideOutIntegers(phi);
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[-1 -2  2  0]
[ 0 -3  2 -2]
[ 2 -4  3 -2]
[ 2 -2  0  1]
10

```

### `Example: Morphisms Restriction, Evaluation, And Other Manipulations4 (ex-0687f2)`

Next we illustrate the restriction commands using factors of $J_0(65)$.

```magma
> J := JZero(65);
> A := Decomposition(J)[2]; A;
Modular abelian variety 65B of dimension 2, level 5*13 and
conductor 5^2*13^2 over Q
> T := HeckeOperator(J,3);
> Factorization(CharacteristicPolynomial(T));
[
    <x + 2, 2>,
    <x^2 - 2*x - 2, 2>,
    <x^2 - 2, 2>
]
> Restriction(T,A);
Homomorphism from modular abelian variety of dimension 2 to
JZero(65) given on integral homology by:
[-1  0  0  1  0 -1  0  0  0  0]
[-1  3 -1  1 -3 -1  1  2 -1 -2]
[-1  1 -1  3 -1 -1 -1  0  1 -2]
[-1  0  0  3  0 -1 -2  0  2 -2]
> TonA := RestrictEndomorphism(T,A); TonA;
Homomorphism from 65B to 65B given on integral homology by:
[-1  0  0  1]
[-1  3 -1  1]
[-1  1 -1  3]
[-1  0  0  3]
> Factorization(CharacteristicPolynomial(TonA));
[
    <x^2 - 2*x - 2, 2>
]

```

Finally, we illustrate the `SurjectivePart` command on the non-surjective morphism $T_3+2$ of $J_0(65)$.

```magma
> phi := T+2;
> IsSurjective(phi);
false
> pi := SurjectivePart(phi);
> IsSurjective(pi);
true
> Codomain(pi);
Modular abelian variety of dimension 4 and level 5*13 over Q

```

## Kernels

The category of abelian varieties is not an abelian category because kernels need not exist in this category. More precisely, if $\phi$ is a homomorphism $A\to B$ of abelian varieties, then the kernel of $\phi$ is usually not an abelian variety because it is rarely connected. Instead, the kernel fits into an exact sequence

$$
0 \to C \to \ker(\phi) \to G \to 0,
$$

where $C$ is an abelian variety and $G$ is a finite group, both defined over the same field as $\phi$.

The `ConnectedKernel` command returns $C$.

The `ComponentGroupOfKernel` command returns $G$ as a subgroup of $A/C$.

The `Kernel` command returns a finite subgroup of $A$ that maps to $G$, the abelian variety $C$, and a map from $C$ into $A$.

Note that if $C\neq 0$ then the finite group that the `Kernel` command returns is *not canonical*, since it is just some finite group that maps onto $G$ via quotienting out by $C$. For the canonical component group, use the `ComponentGroupOfKernel` command, which gives a group defined over the same base field as $\phi$, whose main drawback is that the component group is not contained in $A$.

### `ComponentGroupOfKernel(phi): MapModAbVar -> ModAbVarSubGrp`

Component group of $\ker (\phi )$ where $\phi$ is a homomorphism of abelian varieties.

### `ConnectedKernel(phi): MapModAbVar -> ModAbVar, MapModAbVar`

The connected component $C$ of $\ker (\phi )$ and a morphism from $C$ to the domain of $\phi$ where $\phi$ is a homomorphism of abelian varieties.

### `Kernel(phi): MapModAbVar -> ModAbVarSubGrp, ModAbVar, MapModAbVar`

Let $\phi$ be a homomorphism of abelian varieties. This intrinsic returns a finite subgroup $G$ of $A$ (the domain of $\phi$) as a subgroup of an abelian variety, an abelian variety $C$ such that $\ker (\phi )$ equals $f(C)+G$, and an injective map $f$ from $C$ to $A$. If $C=0$, then $G$ has the same field of definition as $\phi$; otherwise, $G$ is only known to be defined over the algebraic closure.

### `Example: Morphisms Kernels (ex-b5d1c0)`

The kernel of $T_2-3$ on $J_0(65)$ is an extension of an abelian surface by a finite group isomorphic to $({\mathbb{Z}}/2{\mathbb{Z}})^4$.

```magma
> J := JZero(65);
> T := HeckeOperator(J,2);
> phi := T^2-3;
> ConnectedKernel(phi);
Modular abelian variety of dimension 2 and level 5*13 over Q
Homomorphism from modular abelian variety of dimension 2 to
JZero(65) given on integral homology by:
[ 1  0  0  0  0  1 -1  0  1 -1]
[ 0  1  0  0 -1  0  0  1  0 -1]
[ 0  0  1  0  0  0 -1  1  1 -1]
[ 0  0  0  1  0  0 -1  0  1 -1]
> Kernel(phi);
Finitely generated subgroup of abelian variety with
invariants [ 2, 2, 2, 2 ]
Modular abelian variety of dimension 2 and level 5*13 over Q
Homomorphism from modular abelian variety of dimension 2 to
JZero(65) given on integral homology by:
[ 1  0  0  0  0  1 -1  0  1 -1]
[ 0  1  0  0 -1  0  0  1  0 -1]
[ 0  0  1  0  0  0 -1  1  1 -1]
[ 0  0  0  1  0  0 -1  0  1 -1]
> G := ComponentGroupOfKernel(phi); G;
Finitely generated subgroup of abelian variety with
invariants [ 2, 2, 2, 2 ]
> FieldOfDefinition(G);
Rational Field

```

Though $G$ is defined over ${\mathbb{Q}}$, the ambient variety of $G$ is the quotient of $J_0(65)$ by the two dimensional connected component of the kernel of $T_2-3$.

```magma
> AmbientVariety(G);
Modular abelian variety of dimension 3 and level 5*13 over Q

```

On the other hand, the group returned by the `Kernel` command is a subgroup of $J_0(65)$.

```magma
> H, C := Kernel(phi);
> H;
Finitely generated subgroup of abelian variety with invariants
[ 2, 2, 2, 2 ]
> FieldOfDefinition(H);
Algebraically closed field with no variables
> AmbientVariety(H);
Modular abelian variety JZero(65) of dimension 5 and level 5*13
over Q

```

## Images

These commands compute the image of a modular abelian variety or a finite group under a homomorphism $\phi$ of modular abelian varieties. Using `@@`, one can also compute a group lifting a given group. Note that this lift is not canonical unless $\phi$ has finite kernel, in which case `G@@phi` is the full inverse image of $G$.

### `A @ phi: ModAbVar, MapModAbVar -> ModAbVar`

### `phi(A): ModAbVar, MapModAbVar -> ModAbVar`

The image of the abelian variety $A$ under the map $\phi$ of abelian varieties, if this makes sense, i.e., if $A$ is the domain of $\phi$, or $A$ has dimension $0$, or one of the embeddings of $A$ has codomain equal to the domain of $\phi$.

### `G @ phi: ModAbVarSubGrp, MapModAbVar -> ModAbVarSubGrp`

### `phi(G): ModAbVarSubGrp, MapModAbVar -> ModAbVarSubGrp`

The image of the subgroup $G$ of an abelian variety under the map $\phi$ of abelian varieties, if this makes sense. If $A$ is the ambient variety of $G$, then this makes sense if $A$ is the domain of $\phi$, or $A$ has dimension $0$, or one of the embeddings of $A$ has codomain equal to the domain of $\phi$.

### `Image(phi): MapModAbVar -> ModAbVar, MapModAbVar, MapModAbVar`

The image $C$ of the morphism $\phi$ of abelian varieties, which is a modular abelian subvariety contained in the codomain of $\phi$, a morphism from $C$ to the codomain of $\phi$, and a surjective morphism from the domain of $\phi$ to $C$.

### `G @@ phi: ModAbVarSubGrp, MapModAbVar -> ModAbVarSubGrp`

A finite group whose image under $\phi$, a morphism of abelian varieties, is equal to the subgroup $G$ of a modular abelian variety, if possible. If $\phi$ has finite kernel, then this is the exact inverse image of $G$ under $\phi$. If not, then this is a group generated by a choice of torsion inverse image for each generator of $G$, which may not be canonical.

### `Example: Morphisms Images (ex-8cd22d)`

The image of $J_0(37)$ under $T_2$ is an elliptic curve.

```magma
> J := JZero(37);
> phi := HeckeOperator(J,2);
> phi(J);
Modular abelian variety of dimension 1 and level 37 over Q
> Image(phi);
Modular abelian variety of dimension 1 and level 37 over Q
Homomorphism from modular abelian variety of dimension 1 to
JZero(37) given on integral homology by:
[ 1 -1  1  0]
[ 1 -1 -1  1]
Homomorphism from JZero(37) to modular abelian variety of dimension
1 given on integral homology by:
[ 0 -1]
[ 1  0]
[-1  1]
[ 0  0]

```

The Hecke operator $T_2$ maps the $2$-torsion subgroup of $J_0(37)$ maps onto the $2$-torsion subgroup of the image of $T_2$.

```magma
> G := nTorsionSubgroup(J,2); G;
Finitely generated subgroup of abelian variety with invariants
[ 2, 2, 2, 2 ]
> phi(G);
Finitely generated subgroup of abelian variety with invariants
[ 2, 2 ]

```

The homomorphism $T_2-1$ is surjective, and the inverse image of the $2$-torsion is a subgroup isomorphic to $({\mathbb{Z}}/2{\mathbb{Z}})^2\times ({\mathbb{Z}}/6{\mathbb{Z}})^2$.

```magma
> IsSurjective(phi-1);
true
> psi := phi-1;
> H := G@@(psi); H;
Finitely generated subgroup of abelian variety with invariants
[ 2, 2, 6, 6 ]
> psi(H);
Finitely generated subgroup of abelian variety with invariants
[ 2, 2, 2, 2 ]
> H := G@@psi; H;
Finitely generated subgroup of abelian variety with invariants
[ 2, 2, 6, 6 ]
> psi(H);
Finitely generated subgroup of abelian variety with invariants
[ 2, 2, 2, 2 ]

```

## Cokernels

### `Cokernel(phi): MapModAbVar -> ModAbVar, MapModAbVar`

The cokernel of the morphism $\phi$ of abelian varieties and a morphism from the codomain of $\phi$ to the cokernel.

### `Example: Morphisms Cokernels (ex-cbef20)`

We compute a 2-dimensional quotient of the 3-dimensional abelian variety $J_0(33)$ using the Hecke operator $T_2$ and the `Cokernel` command.

```magma
> J := JZero(33);
> T := HeckeOperator(J,2);
> Factorization(CharacteristicPolynomial(T));
[
    <x - 1, 2>,
    <x + 2, 4>
]
> phi := T + 2;
> A, pi := Cokernel(phi);
> A;
Modular abelian variety of dimension 2 and level 3*11 over Q
> pi;
Homomorphism from JZero(33) to modular abelian variety of dimension
2 (not printing 6x4 matrix)

```

## Matrix Structure

Homomorphisms are stored and worked with internally using the linear maps they induce on homology. The commands below provide access to those matrices.

### `Matrix(phi): MapModAbVar -> ModMatFldElt`

The matrix on the chosen basis of rational homology that defines the morphism $\phi$ of abelian varieties.

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

The `Eltseq` of the underlying matrix that defines the morphism $\phi$ of abelian varieties. This is a sequence of integers or rational numbers.

### `Ncols(phi): MapModAbVar -> RngIntElt`

The number of columns of the matrix which defines the morphism $\phi$ of abelian varieties. This is also the dimension of the homology of the codomain of $\phi$.

### `Nrows(phi): MapModAbVar -> RngIntElt`

The number of rows of the matrix that defines the morphism $\phi$ of abelian varieties. This is also the dimension of the homology of the domain of $\phi$.

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

The sequence rows of the matrix that defines the morphism $\phi$ of abelian varieties.

### `IntegralMatrix(phi): MapModAbVar -> ModMatRngElt`

The matrix which defines the morphism $\phi$ of abelian varieties, written with respect to integral homology.

### `IntegralMatrixOverQ(phi): MapModAbVar -> ModMatFldElt`

The matrix which defines the morphism $\phi$ of abelian varieties, written with respect to integral homology.

### `RealMatrix(phi): MapModAbVar -> ModMatFldElt`

The matrix which defines the morphism $\phi$ of abelian varieties, written with respect to real homology.

### `Example: Morphisms Matrix Structure (ex-e3e535)`

The following example demonstrates each of the commands for the Hecke operator $T_2$ on $J_0(23)$.

```magma
> phi := HeckeOperator(JZero(23),2); phi;
Homomorphism T2 from JZero(23) to JZero(23) given on integral homology by:
[ 0  1 -1  0]
[ 0  1 -1  1]
[-1  2 -2  1]
[-1  1  0 -1]
> Eltseq(phi);
[ 0, 1, -1, 0, 0, 1, -1, 1, -1, 2, -2, 1, -1, 1, 0, -1 ]
> IntegralMatrix(phi);
[ 0  1 -1  0]
[ 0  1 -1  1]
[-1  2 -2  1]
[-1  1  0 -1]
> Parent($1);
Full RMatrixSpace of 4 by 4 matrices over Integer Ring
> IntegralMatrixOverQ(phi);
[ 0  1 -1  0]
[ 0  1 -1  1]
[-1  2 -2  1]
[-1  1  0 -1]
> Parent($1);
Full Matrix Algebra of degree 4 over Rational Field
> Matrix(phi);
[ 0  1 -1  0]
[ 0  1 -1  1]
[-1  2 -2  1]
[-1  1  0 -1]
> Ncols(phi);
4
> Nrows(phi);
4
> RealMatrix(phi);
[   0    1   -1    0]
[   0    1   -1    1]
[  -1  2/1 -2/1    1]
[  -1    1    0   -1]
> Parent($1);
Full KMatrixSpace of 4 by 4 matrices over Real Field
> Rows(phi);
[
    ( 0  1 -1  0),
    ( 0  1 -1  1),
    (-1  2 -2  1),
    (-1  1  0 -1)
]

```

## Arithmetic

Magma supports many standard arithmetic operations with homomorphisms of abelian varieties, including composition, addition, subtraction, and exponentiation.

### `Inverse(phi): MapModAbVar -> MapModAbVar, RngIntElt`

The inverse of $\phi$ and an integer $d$ such that $d*\phi ^{-1}$ is a morphism of abelian varieties. More precisely, if $\phi$ is an isogeny, then the inverse of $\phi$ is a morphism in the category of abelian varieties up to isogeny. This intrinsic returns such a morphism or the actual inverse of $\phi$ if $\phi$ has degree $1$.

### `phi * psi: MapModAbVar, MapModAbVar -> MapModAbVar`

The composition of the homomorphisms $\phi$ and $\psi$ of abelian varieties.

### `a * phi: FldRatElt, MapModAbVar -> MapModAbVar`

### `a * phi: RngIntElt, MapModAbVar -> MapModAbVar`

The product of the rational number or integer $a$ and the homomorphism $\phi$ of abelian varieties. The result might only be a homomorphism, up to isogeny.

### `phi * psi: MapModAbVar, AlgMatElt -> AlgMatElt`

### `phi * psi: MapModAbVar, ModMatFldElt -> ModMatFldElt`

The product of the matrix that defines the morphism $\phi$ of abelian varieties and the matrix $\psi$.

### `psi * phi: AlgMatElt, MapModAbVar -> AlgMatElt`

### `psi * phi: ModMatFldElt, MapModAbVar -> ModMatFldElt`

The product of the matrix $\psi$ and the matrix that defines the morphism $\phi$ of abelian varieties.

### `phi ^ n: MapModAbVar, RngIntElt -> MapModAbVar`

The $n$-fold composition $\phi ^n$ of the endomorphism $\phi$ of an abelian variety with itself. If $n=-1$, then this is the inverse of $\phi$, in which case $\phi$ must be an isogeny or an error occurs.

### `phi + psi: MapModAbVar, MapModAbVar -> MapModAbVar`

The sum of the homomorphisms $\phi$ and $\psi$

### `n + phi: FldRatElt, MapModAbVar -> MapModAbVar`

### `n + phi: RngIntElt, MapModAbVar -> MapModAbVar`

The sum of the morphism multiplication by the rational number or integer $n$ and the endomorphism $\phi$ of an abelian variety.

### `phi + n: MapModAbVar, RngIntElt -> MapModAbVar`

The sum of the endomorphism $\phi$ of an abelian variety and the endomorphism multiplication-by-$n$ where $n$ is an integer.

### `phi + psi: MapModAbVar, AlgMatElt -> AlgMatElt`

### `phi + psi: MapModAbVar, ModMatFldElt -> ModMatFldElt`

The sum of the matrix that defines the morphism $\phi$ of abelian varieties and the matrix $\psi$.

### `psi + phi: AlgMatElt, MapModAbVar -> AlgMatElt`

### `psi + phi: ModMatFldElt, MapModAbVar -> ModMatFldElt`

The sum of the matrix $\psi$ and the matrix which defines the morphism $\phi$ of abelian varieties.

### `phi - psi: MapModAbVar, MapModAbVar -> MapModAbVar`

The difference between the homomorphisms $\phi$ and $\psi$ of abelian varieties.

### `n - phi: FldRatElt, MapModAbVar -> MapModAbVar`

### `n - phi: RngIntElt, MapModAbVar -> MapModAbVar`

The difference between the morphism multiplication-by-$n$, where $n$ is a rational number or an integer, and the endomorphism $\phi$ of an abelian variety.

### `phi - n: MapModAbVar, FldRatElt -> MapModAbVar`

### `phi - n: MapModAbVar, RngIntElt -> MapModAbVar`

The difference between the endomorphism $\phi$ of an abelian variety and the endomorphism multiplication-by-$n$ where $n$ is a rational number or an integer.

### `phi - psi: MapModAbVar, AlgMatElt -> AlgMatElt`

### `phi - psi: MapModAbVar, ModMatFldElt -> ModMatFldElt`

The difference between the matrix that defines the morphism $\phi$ of abelian varieties and the matrix $\psi$.

### `psi - phi: AlgMatElt, MapModAbVar -> AlgMatElt`

### `psi - phi: ModMatFldElt, MapModAbVar -> ModMatFldElt`

The difference between the matrix $\psi$ and the matrix which defines the morphism $\phi$ of abelian varieties.

### `Example: Morphisms Arithmetic (ex-a1b822)`

We illustrate several arithmetic operations use the Hecke operators $T_2$ and $T_3$ on $J_0(23)$.

```magma
> J := JZero(23);
> phi := HeckeOperator(J,2);
> psi := HeckeOperator(J,3);
> Matrix(phi)*Matrix(psi);
[-2  1 -1  0]
[ 0 -1 -1  1]
[-1  2 -4  1]
[-1  1  0 -3]
> phi*psi;
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[-2  1 -1  0]
[ 0 -1 -1  1]
[-1  2 -4  1]
[-1  1  0 -3]
> Inverse(phi);
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[ 1  1 -1  0]
[ 0  2 -1  1]
[-1  2 -1  1]
[-1  1  0  0]
1
> 1/3*phi;
Homomorphism from JZero(23) to JZero(23) (up to isogeny) on integral
homology by:
[   0  1/3 -1/3    0]
[   0  1/3 -1/3  1/3]
[-1/3  2/3 -2/3  1/3]
[-1/3  1/3    0 -1/3]
> 2+phi;
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[ 2  1 -1  0]
[ 0  3 -1  1]
[-1  2  0  1]
[-1  1  0  1]
> phi+psi;
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[-1 -1  1  0]
[ 0 -2  1 -1]
[ 1 -2  1 -1]
[ 1 -1  0  0]
> phi^4;
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[ 2 -3  3  0]
[ 0 -1  3 -3]
[ 3 -6  8 -3]
[ 3 -3  0  5]
1
> phi^(-4);
Homomorphism from JZero(23) to JZero(23) given on integral homology by:
[ 5  3 -3  0]
[ 0  8 -3  3]
[-3  6 -1  3]
[-3  3  0  2]
1

```

## Polynomials

The polynomial commands compute the characteristic and minimal polynomials of endomorphisms of modular abelian varieties. Each command requires that the input homomorphism be a genuine homomorphism (not just a morphism up to isogeny). The same computation could be done by first extracting the matrix of the endomorphism and using the analogous command on the matrix. However, in some special cases there may be special techniques which can be used to do the computation more quickly, so there can be some advantage to using the commands below.

### `CharacteristicPolynomial(phi): MapModAbVar -> RngUPolElt`

The characteristic polynomial of the endomorphism $\phi$ of an abelian variety. We can sometimes use extra information about $\phi$ (e.g., how it was constructed, Deligne bounds) to gain an answer faster.

### `FactoredCharacteristicPolynomial(phi): MapModAbVar -> RngUPolElt`

The factorization of the characteristic polynomial of the endomorphism $\phi$ of an abelian variety. We can sometimes use extra information about $\phi$ (e.g., how it was constructed, Deligne bounds), to gain an answer faster. These factored polynomials are cached.

### `MinimalPolynomial(phi): MapModAbVar -> RngUPolElt`

The minimal polynomial of the endomorphism $\phi$ of an abelian variety. We can sometimes use extra information about $\phi$ (e.g., how it was constructed, Deligne bounds), to gain an answer faster.

### `Example: Morphisms Polynomials (ex-4cc971)`

This example illustrates each of the polynomial commands for the Hecke operator $T_2$ on $J_0(66)$.

```magma
> J := JZero(66);
> phi := HeckeOperator(J,2);
> R<x> := PolynomialRing(RationalField());
> CharacteristicPolynomial(phi);
x^18 + 4*x^17 + 8*x^16 + 8*x^15 + 6*x^14 - 20*x^12 - 56*x^11 -
    55*x^10 - 4*x^9 + 36*x^8 + 48*x^7 + 104*x^6 + 128*x^5 -
    32*x^4 - 192*x^3 - 112*x^2 + 64*x + 64
> CharacteristicPolynomial(Matrix(phi));
x^18 + 4*x^17 + 8*x^16 + 8*x^15 + 6*x^14 - 20*x^12 - 56*x^11 -
    55*x^10 - 4*x^9 + 36*x^8 + 48*x^7 + 104*x^6 + 128*x^5 -
    32*x^4 - 192*x^3 - 112*x^2 + 64*x + 64
> FactoredCharacteristicPolynomial(phi);
[
    <x - 1, 4>,
    <x + 1, 2>,
    <x^2 - x + 2, 2>,
    <x^2 + 2*x + 2, 4>
]
> MinimalPolynomial(phi);
x^6 + x^5 + x^4 + x^3 + 2*x^2 - 2*x - 4
> Factorization(MinimalPolynomial(phi));
[
    <x - 1, 1>,
    <x + 1, 1>,
    <x^2 - x + 2, 1>,
    <x^2 + 2*x + 2, 1>
]

```

## Invariants

It is possible to retrieve the domain and codomain of homomorphisms between abelian varieties. The degrees of such homomorphisms can be computed. Denominators of homomorphisms can be determined and cleared. A field over which a homomorphism is defined is available. The rank, nullity and trace of a homomorphism can also be computed.

### `Domain(phi): MapModAbVar -> ModAbVar`

The domain of the morphism $\phi$ of abelian varieties.

### `Codomain(phi): MapModAbVar -> ModAbVar`

The codomain of the morphism $\phi$ of abelian varieties.

### `Degree(phi): MapModAbVar -> RngIntElt`

The degree of the morphism $\phi$ of abelian varieties, i.e. the cardinality of the kernel of $\phi$. If the kernel of $\phi$ is not finite, then the degree is defined to be $0$.

### `Denominator(phi): MapModAbVar -> RngIntElt`

Given a morphism $\phi$ of abelian varieties return the smallest positive integer $n$ such that $n*\phi$ is a homomorphism. This is also the denominator of the matrix that defines $\phi$.

### `ClearDenominator(phi): MapModAbVar -> MapModAbVar`

Return the morphism $n*\phi$ where $\phi$ is a morphism of abelian varieties and $n$ is positive and the smallest such that $n*\phi$ is a genuine homomorphism.

### `FieldOfDefinition(phi): MapModAbVar -> ModAbVar`

A field of definition of the morphism $\phi$ of abelian varieties. This is only some field over which $\phi$ is defined, it is not guaranteed to be minimal.

### `Nullity(phi): MapModAbVar -> RngIntElt`

The dimension of the kernel of the morphism $\phi$ of abelian varieties.

### `Rank(phi): MapModAbVar -> RngIntElt`

The dimension of the kernel of the morphism $\phi$ of abelian varieties.

### `Trace(phi): MapModAbVar -> FldRatElt`

The trace of any matrix which represents the action of the morphism $\phi$ of abelian varieties on integral homology. For example, the trace of multiplication by $n$ on $A$ is $2n\dim(A)$.

### `Example: Morphisms Invariants (ex-c7c8a0)`

```magma
> phi := NaturalMap(JZero(11),JZero(33));
> Codomain(phi);
Modular abelian variety JZero(33) of dimension 3 and level 3*11 over Q
> Domain(phi);
Modular abelian variety JZero(11) of dimension 1 and level 11 over Q
> Degree(phi);
1
> Denominator(1/5*phi);
5
> FieldOfDefinition(phi);
Rational Field
> Nullity(phi);
0
> Rank(phi);
1
> Trace(HeckeOperator(JZero(33),2));
-6
> Trace(nIsogeny(JZero(33),5));
30

```

## Predicates

A range of predicates are provided allowing a morphism to be checked for whether it is an actual morphism or not, whether its kernel is finite, and whether it is injective or surjective or an isogeny. There are also commands for testing equality of homomorphisms and inclusion in a list.

### `IsMorphism(phi): MapModAbVar -> BoolElt`

Return `true` if and only if the map $\phi$ between abelian varieties is a morphism in the category of abelian varieties (not just in the category of abelian varieties up to isogeny).

### `OnlyUpToIsogeny(phi): MapModAbVar -> BoolElt`

Return `true` if the map $\phi$ between abelian varieties is not a homomorphism, but $n*\phi$ is a homomorphism for some positive integer $n$, i.e., $\phi$ is only a homomorphism in the category of abelian varieties up to isogeny.

### `HasFiniteKernel(phi): MapModAbVar -> BoolElt`

Return `true` if the kernel of the homomorphism $\phi$ of abelian varieties is finite.

### `IsInjective(phi): MapModAbVar -> BoolElt`

Return `true` if the map $\phi$ between abelian varieties is an injective homomorphism.

### `IsSurjective(phi): MapModAbVar -> BoolElt`

Return `true` if the homomorphism $\phi$ between abelian varieties is surjective.

### `IsEndomorphism(phi): MapModAbVar -> BoolElt`

Return `true` if the morphism $\phi$ between abelian varieties is an endomorphism, i.e., the domain and codomain of $\phi$ are equal.

### `IsInteger(phi): MapModAbVar -> BoolElt, RngIntElt`

Return `true` if the morphism $\phi$ between abelian varieties is multiplication by $n$ for some integer $n$. If so, returns that $n$ as well, otherwise, returns `false`.

### `IsIsogeny(phi): MapModAbVar -> BoolElt`

Return `true` if the morphism $\phi$ between abelian varieties is a surjective homomorphism with finite kernel. Note that this definition differs from the one in Silverman’s books on elliptic curves, agrees with the one in Milne’s articles, and is an equivalence relation.

### `IsIsomorphism(phi): MapModAbVar -> BoolElt`

Return `true` if the morphism $\phi$ between abelian varieties is an isomorphism of abelian varieties.

### `IsOptimal(phi): MapModAbVar -> BoolElt`

Return `true` if the morphism $\phi$ between abelian varieties is an optimal quotient map, i.e., $\phi$ is surjective and has connected kernel.

### `IsHeckeOperator(phi): MapModAbVar -> BoolElt, RngIntElt`

Returns `true` if the morphism $\phi$ between abelian varieties was computed using the `HeckeOperator` command, and the argument $n$ passed to the `HeckeOperator` command when $\phi$ was created, otherwise `false`.

### `IsZero(phi): MapModAbVar -> BoolElt`

Return `true` if the morphism $\phi$ of abelian varieties is the zero morphism.

### `phi eq psi: MapModAbVar, MapModAbVar -> BoolElt`

Return `true` if the two homomorphisms of abelian varieties $\phi$ and $\psi$ are equal.

### `n eq phi: RngIntElt, MapModAbVar -> BoolElt`

### `phi eq n: MapModAbVar, RngIntElt -> BoolElt`

Return `true` if the morphism $\phi$ between abelian varieties is equal to multiplication by the integer $n$.

### `phi in X: MapModAbVar, List -> BoolElt`

Return `true` if the morphism $\phi$ between abelian varieties is one of the homomorphisms in the list $X$ of homomorphisms.

### `Example: Morphisms Predicates (ex-460750)`

```magma
> phi := HeckeOperator(JZero(65),2)-1;
> HasFiniteKernel(phi);
true
> IsEndomorphism(phi);
true
> IsHeckeOperator(phi);
false 0
> IsInjective(phi);
false
> IsInteger(phi);
false
> IsIsogeny(phi);
true
> IsIsomorphism(phi);
false
> IsMorphism(phi);
true
> IsMorphism(1/2*phi);
false
> IsSurjective(phi);
true
> IsZero(phi);
false
> OnlyUpToIsogeny(phi);
false
> 2 eq phi;
false
> phi eq 2;
false
> 2 eq nIsogeny(JZero(65),2);
true
> phi eq nIsogeny(JZero(65),2);
false
> phi in [* phi, nIsogeny(JZero(65),2) *];
true
> IsIsomorphism(NaturalMap(JZero(11),JOne(11)));
false
> IsIsomorphism(NaturalMap(JZero(11)^2,JZero(22)));
false
> IsIsomorphism(NaturalMap(JZero(11),JZero(11)));
true

```
