---
title: "$q$-Expansions"
canonical: "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/BrandtModules/qexpansions.html"
source: "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/BrandtModules/qexpansions.md"
part: "Modular Arithmetic Geometry"
chapter: "Brandt Modules"
breadcrumbs:
  - {"title": "Magma Handbook", "source": "https://docs.magma-maths.org/v2.30-1/index.md"}
  - {"title": "Modular Arithmetic Geometry", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/index-modular-arithmetic-geometry.md"}
  - {"title": "Brandt Modules", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/BrandtModules/index-brandt-modules.md"}
prev: {"title": "Hecke Operators", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/BrandtModules/hecke-operators.md"}
next: {"title": "Dimensions of Spaces", "source": "https://docs.magma-maths.org/v2.30-1/ModularArithmeticGeometry/BrandtModules/ModBrdt-dimension-formulas.md"}
intrinsics:
  - {"name": "ThetaSeries", "signature": "ThetaSeries(x, y, prec): ModBrdtElt, ModBrdtElt, RngIntElt -> RngSerElt"}
  - {"name": "qExpansionBasis", "signature": "qExpansionBasis(M, prec): ModBrdt, RngIntElt -> SeqEnum"}
---

# $q$-Expansions

We can associate a theta series to any pair of elements of a Brandt module, which give embeddings (with respect to any fixed module element) of the Brandt module in a space of weight $2$ modular forms.

<a id="function-thetaseries-modbrdtelt-modbrdtelt-rngintelt"></a>
## `ThetaSeries(x, y, prec): ModBrdtElt, ModBrdtElt, RngIntElt -> RngSerElt`

Returns the theta series associated to the pair $(x,y)$ of elements of a Brandt module, as an element of a power series ring.

<a id="function-qexpansionbasis-modbrdt-rngintelt"></a>
## `qExpansionBasis(M, prec): ModBrdt, RngIntElt -> SeqEnum`

A sequence of power series elements, to precision $prec$, spanning the image of the theta functions associated to pairs in the Brandt module $M$.
