# Complex Multiplication

Let $A$ be a CM-étale algebra of dimension $2g$ over ${{\Bbb Q}}$. Then complex conjugation acts on ${\rm Homs}(A,{\Bbb C})$. We denote this action with $\overline{\cdot}$. A *CM-type* $\Phi$ of $A$ is a set of $g$ elements of ${\rm Homs}(A,{\Bbb C})$ such that ${\rm Homs}(A,{\Bbb C}) = \Phi \sqcup \overline{\Phi}$.

Given a CM-type $\Phi$ and a totally imaginary element $b\in A^\times$, we say that $b$ is $\Phi$-*positive* if ${\operatorname{Im}}(\varphi(b))>0$ for every $\varphi\in \Phi$. Two totally imaginary elements $b$ and $b'$ in $A^\times$ represent the same CM-type $\Phi$ if and only if $b/b'$ is totally real and totally positive.

In Magma a CM-type of a CM-algebra $A$ has type `AlgEtQCMType` and it is determined by $g$ homomorphisms to ${\Bbb C}$ or by a $\Phi$-positive element.

## `CMType(seq): SeqEnum[Map] -> AlgEtQCMType`

Given a sequence $seq$ of homomorphisms from a CM-algebra to CC, one per conjugate pair, it returns the corresponding CMType.

## `Example: CM Types (ex-d5afe8)`

```magma
> _<x> := PolynomialRing(Integers());
> A := EtaleAlgebra(x^2+1);
> homs := HomsToC(A);
> PHI := CMType([homs[1]]);
> H := Homs(PHI : Precision := 30);
> #H;
1

```

## `CreateCMType(seq): SeqEnum[Map] -> AlgEtQCMType`

Given a sequence $seq$ of homomorphisms from a CM-algebra to CC, one per conjugate pair, it returns the corresponding CMType.

## `CMType(b): AlgEtQElt -> AlgEtQCMType`

Given a totally imaginary element $b$, it returns the CMType PHI for which $b$ is PHI-positive, that is, ${\rm Im}(\phi(b))>0$ for every $\phi$ in PHI.

## `CreateCMType(b): AlgEtQElt -> AlgEtQCMType`

Given a totally imaginary element $b$, it returns the CMType PHI for which $b$ is PHI-positive.

## `CMPositiveElement(PHI): AlgEtQCMType -> AlgEtQElt`

Given a CMType PHI returns a totally imaginary PHI-positive element (which uniquely determines PHI).

## `CMPosElt(PHI): AlgEtQCMType -> AlgEtQElt`

Given a CMType PHI returns a totally imaginary PHI-positive element (which uniquely determines PHI).

## `Homs(PHI): AlgEtQCMType -> SeqEnum[Map]`

```magma
prec: RngIntElt                    Default: 30
```

Given an `AlgEtQCMType` PHI returns the sequence of maps to the complex field. The parameter `prec` (default value 30) determines the precision of the codomains of the maps.

## `PHI1 eq PHI2: AlgEtQCMType, AlgEtQCMType -> BoolElt`

```magma
prec: RngIntElt                    Default: 30
```

Returns whether two cm types are equal. This happens if and only if the quotient of (any) two CMPositiveElements is totally real and totally positive.

## `Precision(PHI): AlgEtQCMType -> RngIntElt`

Returns the precision of the given CM-type, that is, the codomain of each homomorphism will be `ComplexField(Precision)`.

## `ChangePrecision(PHI0, prec): AlgEtQCMType, RngIntElt -> AlgEtQCMType`

Changes the precision of the given CM-type, that is, the codomain of each homomorphism will be `ComplexField(Precision)`.

## `ChangePrecision(~PHI, prec): AlgEtQCMType, RngIntElt`

Changes the precision of the given CM-type, that is, the codomain of each homomorphism will be `ComplexField(Precision)`.

## `AllCMTypes(A): AlgEtQ -> SeqEnum[AlgEtQCMType]`

```magma
Precision: RngIntElt                    Default: Precision(GetDefaultRealField())
```

Returns all the `AlgEtQCMTypes` of $A$. The parameter `Precision` determined the precision of the codomain of the maps defining the CMTypes.
