# Creation Functions

## Riemann Surfaces over Number Fields

As mentioned above, the very general class of Riemann surfaces over number fields can be defined by a geometrically irreducible polynomial $f \in {\bf Q}[x,y]$ or $f \in {\bf K}[x,y]$, together with the homomorphism $\sigma : {\bf K}\rightarrow {\bf C}$, where $K$ is a number field and $\sigma$ is an infinite place for ${\bf K}$. The Riemann surface is constructed by analytic continuation of the multi-valued function $f(x,\ y(x)) = 0$ along the fundamental group of the extended complex plane punctured by the discriminant points of $f$ with respect to the $y$.

The creation of a Riemann surface will automatically produce an associated big period matrix by numerically integrating a basis of holomorphic differentials along a homolgy basis using a numerical integration method `IntMethod`. More details on the bases that are being used is given below.

Recommended integration methods that are available in Magma are Gauss-Legendre quadrature (“GL”), Clenshaw–Curtis quadrature (“CC”), double-exponential integration (“DE”) and mixed integration (“Mixed”) which uses a combination of Gauss-Legendre and double-exponential integration. The default integration method is “Mixed” and this will outperform the other options in most cases. However, depending on the defining polynomial and the precision, there are cases where other choices may be better.

### `RiemannSurface(f): RngMPolElt -> RieSrf`

```magma
Precision: RngIntElt                    Default: 30
IntMethod: MonStgElt                    Default: "Mixed"
```

Create a Riemann surface object defined by $X:f = 0$ where $f \in {\bf Q}[x,y]$ is geometrically irreducible.

### `RiemannSurface(f, sigma): RngMPolElt, PlcNumElt -> RieSrf`

```magma
Precision: RngIntElt                    Default: 30
IntMethod: MonStgElt                    Default: "Mixed"
```

Create a Riemann surface object defined by $X:f = 0$ using the embedding $\sigma : K \rightarrow {\bf C}$, where $K$ is a number field and $f \in {\bf K}[x,y]$ is geometrically irreducible.

### `Example: Riesrf Ex 1 (ex-c4a814)`

We define the Riemann surface associated to the affine equation

$$
f(x,y) = x^3 + x^2 + xy^3 - xy^2 + y^2 - y = 0
$$

defined over **Q**. Here the integration method is chosen at random to show the available options. The default is “Mixed” and is usually a good choice.

```magma
> Qxy<x,y> := PolynomialRing(Rationals(),2);
> f := x^3 + x^2 + x*y^3 - x*y^2 + y^2 - y;
> IntMeth := Random(["Mixed", "GL", "CC", "DE"]);
> X := RiemannSurface(f : Precision:=100, IntMethod:=IntMeth);
> X;

Riemann surface of genus 3 defined by: 0 = x^3 + x^2 + xy^3 - xy^2 + y^2 - y
and prescribed precision 100

Computed data:
 Complex fields: [ 100, 106, 126, 378 ]
 Discriminant points: true
 BasePoint: (-2.000000000, -0.8260051791)
 Path pieces: true
 Index path lists: true
 Closed chains: true
 Branch points: true
 Local monodromy: true
 Monodromy group: true
 Homology basis: true
 Holomorphic differential: true
 Integration method: CC
 BigPeriod matrix: true
 SmallPeriod matrix: false
 Reduction matrix (real) false
 Reduction matrices (complex) false
 SheetToSheetIntegrals: true

```

### `Example: Riesrf Ex 2 (ex-6d46eb)`

Taking an equation $f(x,y) = 0$ defined over a number field $K$ together with a complex embedding $\sigma$ of $K$ is a more general way to define a Riemann surface. The Riemann surface defined by $f(x,y) = -s^2x^7 + 2sx^3y + y^3,$ where $s$ is a primitive element of the number field defined by $t^2 +1$ is constructed in Magma as follows:

```magma
> Qt<t> := PolynomialRing(Rationals());
> K<s> := NumberField(t^2 + 1);
> Kxy<x,y> := PolynomialRing(K,2);
> f := -s^2*x^7 + 2*s*x^3*y + y^3;
> sigma := InfinitePlaces(K)[1];
> sigma;
1st place at infinity
> X := RiemannSurface(f,sigma : Precision:=100);
> X;

Riemann surface of genus 2 defined by: 0 = x^7 + 2*s*x^3*y + y^3
and prescribed precision 100

Computed data:
 Complex fields: [ 100, 106, 126, 378 ]
 Discriminant points: true
 BasePoint: (-2.000000000, -3.424546085 - 4.898716927*I)
 Path pieces: true
 Index path lists: true
 Closed chains: true
 Branch points: true
 Local monodromy: true
 Monodromy group: true
 Homology basis: true
 Holomorphic differential: true
 Integration method: Mixed
 BigPeriod matrix: true
 SmallPeriod matrix: false
 Reduction matrix (real) false
 Reduction matrices (complex) false
 SheetToSheetIntegrals: true

```

## Superelliptic Riemann Surfaces

Another type of Riemann surface, for which a special set of faster algorithms is available, are *superelliptic Riemann surfaces*. These are defined by an affine equation of the form $y^m = p(x)$ where $m > 1$ and $p \in {\bf K}[x]$ is a separable polynomial (i.e., it has no multiple roots) of degree $\deg(p) \ge 3$ with ${\bf K}\subseteq{\bf C}$. Due to the special form of its defining equation and the resulting geometric properties, period matrices and the Abel-Jacobi map can be computed considerably faster, for higher genus, with more precision and more numerical stability.

Just as in the general case, a big period matrix will be computed using numerical integration at the time that a superelliptic Riemann surface is constructed. Available options for integration methods are Gauss-Jacobi integration (`J`), double-exponential integration (`DE`) and a mixture of both (`Mixed`). For most examples, choosing mixed integration is the preferable option, as the algorithm will use Gauss-Jacobi for well-behaved integrands and switch to double-exponential for the difficult integrands.

### `RiemannSurface(p, m): RngUPolElt, RngIntElt -> RieSrf`

```magma
Precision: RngIntElt                    Default: 30
IntMethod: MonStgElt                    Default: "Mixed"
```

Create a superelliptic Riemann surface object defined by $X:y^m = p(x)$.

### `RiemannSurface(L, m): SeqEnum[FldComElt], RngIntElt -> RieSrf`

```magma
IntMethod: MonStgElt                    Default: "Mixed"
```

Create a superelliptic Riemann surface object defined by $X:y^m = p(x)$, where $p = L[n] \cdot \prod_{i = 1}^{n-1} (x-L[i])$ with $n=\#L$. Here the sequence $L$ contains the branch points of $p(x)$ together with its leading coefficient.

### `Example: Riesrf Ex 2 (ex-d6ff62)`

A superelliptic Riemann surface of genus $12$ in precision $100$ will be constructed using a random integration method:

```magma
> Q<x> := PolynomialRing(Rationals());
> p := x^5 - 5/2*x^4 + 5/3*x^3 - 1/6*x;
> m := 7;
> IntMeth := Random(["Mixed","GJ","DE"]);
> X1 := RiemannSurface(p,m : IntMethod := IntMeth, Precision:=100);
> Genus(X1);
12
> X1;

Superelliptic Riemann surface of genus 12 defined as degree 7 covering defined
by x^5 - 5/2*x^4 + 5/3*x^3 - 1/6*x
and prescribed precision 100

Computed data:
 Complex fields: [ 100, 110, 120 ]
 Discriminant points: true
 BasePoint: (-0.2637626158, 0.0000000000)
 Path pieces: false
 Index path lists: false
 Closed chains: false
 Branch points: true
 Local monodromy: false
 Monodromy group: false
 Homology basis: true
 Holomorphic differential: true
 Integration method: Mixed
 BigPeriod matrix: true
 SmallPeriod matrix: false
 Reduction matrix (real) false
 Reduction matrices (complex) false
 SheetToSheetIntegrals: false

```

For the next example the polynomial $p(x)$ above is taken over the complex field. Note that, in the output printing, the coefficients of the polynomial $p(x)$ are printed to only 10 decimal places.

```magma
> C<I> := ComplexField(100);
> X2 := RiemannSurface(ChangeRing(p,C),m);

Superelliptic Riemann surface of genus 12 defined as degree 7 covering defined
by $.1^5 - 2.5000000000*$.1^4 + 1.6666666667*$.1^3 -  0.1666666667$.1^1
and prescribed precision 100

Computed data:
 Complex fields: [ 100, 110, 120 ]
 Discriminant points: true
 BasePoint: (-0.2637626158, 0.0000000000)
 Path pieces: false
 Index path lists: false
 Closed chains: false
 Branch points: true
 Local monodromy: false
 Monodromy group: false
 Homology basis: true
 Holomorphic differential: true
 Integration method: Mixed
 BigPeriod matrix: true
 SmallPeriod matrix: false
 Reduction matrix (real) false
 Reduction matrices (complex) false
 SheetToSheetIntegrals: false

```

In the final example, a superelliptic Riemann surface is constructed given the branch points of $p(x)$ and its leading coefficient.

```magma
> pRts := Roots(ChangeRing(p,C));
> L := [ r[1] : r in pRts ] cat [ 1 ];
> X3 := RiemannSurface( L, m );
> X3;
Superelliptic Riemann surface of genus 12 defined as degree 7 covering defined
by x^5 - 2.5000000000*x^4 + 1.6666666667*x^3 - 0.1666666667*x
and prescribed precision 100

Computed data:
 Complex fields: [ 100, 110, 120 ]
 Discriminant points: true
 BasePoint: (-0.2637626158, 0.0000000000)
 Path pieces: false
 Index path lists: false
 Closed chains: false
 Branch points: true
 Local monodromy: false
 Monodromy group: false
 Homology basis: true
 Holomorphic differential: true
 Integration method: Mixed
 BigPeriod matrix: true
 SmallPeriod matrix: false
 Reduction matrix (real) false
 Reduction matrices (complex) false
 SheetToSheetIntegrals: false

```
