# Function Field Database

An optional database of function fields may be downloaded from the Magma website. This section defines the interface to that database. Each database is associated to a given finite field and extension degree. The supported combinations are:

**${\mathbb{F}}_2$:**
degrees 2, 3

**${\mathbb{F}}_3$:**
degree 2

**${\mathbb{F}}_4$:**
degrees 2, 3, 5

**${\mathbb{F}}_5$:**
degrees 2, 3, 4, 8

**${\mathbb{F}}_7$:**
degree 9

**${\mathbb{F}}_{11}$:**
degree 3

**${\mathbb{F}}_{13}$:**
degree 3

For each function field in the database, the following information is stored and may be used to limit the function fields of interest via the [`sub< D | : parameters>`](#constructor-alffdb-sub) constructor: The genus; the number of degree one places; the class number; and the class group.

## Creation

### `FunctionFieldDatabase(q, d): RngIntElt, RngIntElt -> DB`

Returns a database object for the function fields of degree $d$ over ${\mathbb{F}}_q$.

### `sub< D | : parameters>: DB -> DB`

```magma
Genus                  : RngIntElt                    Default: 
NumberOfDegreeOnePlaces: RngIntElt                    Default: 
```

Returns a sub-database of $D$, restricting (or further restricting, if $D$ is already a sub-database of the full database) the contents to those function fields satisfying the specified conditions. Note that it is not possible to “undo” restrictions with this constructor — the results are always at least as limited as $D$ is.

The parameter `Genus` may be used to restrict the search to fields with the specified genus.

The parameter `NumberOfDegreeOnePlaces` may be used to restrict the search to only those fields with the specified number of places of degree one.

## Access

### `BaseField(D): DB -> FldFin`

### `CoefficientField(D): DB -> FldFin`

Returns the finite field underlying each function field in the database.

### `Degree(D): DB -> RngIntElt`

Returns the degree of each function field in the database.

### `# D: DB -> RngIntElt`

### `NumberOfFields(D): DB -> RngIntElt`

Returns the number of function fields stored in the database.

### `FunctionFields(D): DB -> [ FldFunG ]`

Returns the sequence of function fields stored in the database.

### `Example: Alffdb Basic1 (ex-f1c514)`

The genus of a degree four function field is at most 6. We can see the distribution in a database by counting the size of appropriate sub-databases:

```magma
> D := FunctionFieldDatabase(5, 4);
> #D;
196380
> [ #sub<D |: Genus := g> : g in [0..6] ];
[ 60, 480, 960, 12960, 35040, 63120, 83760 ]

```
