Ariel Pacetti on Thu, 05 May 2005 12:25:20 +0200

 Re: Computing the theta function of a positive definite quadratic form?

```
```
There is a command (in the new versions) which is qfrep. If you look at the help command:
```
? ?qfrep
```
qfrep(x,B,{flag=0}): vector of (half) the number of vectors of norms from 1 to B for the integral and definite quadratic form x. Binary digits of flag mean 1: count vectors of even norm from 1 to 2B, 2: return a t_VECSMALL instead of a t_VEC.
```
Little example;

? qfrep([1,0;0,1],100)
```
%1 = [2, 2, 0, 2, 4, 0, 0, 2, 2, 4, 0, 0, 4, 0, 0, 2, 4, 2, 0, 4, 0, 0, 0, 0, 6, 4, 0, 0, 4, 0, 0, 2, 0, 4, 0, 2, 4, 0, 0, 4, 4, 0, 0, 0, 4, 0, 0, 0, 2, 6, 0, 4, 4, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0, 2, 8, 0, 0, 4, 0, 0, 0, 2, 4, 4, 0, 0, 0, 0, 0, 4, 2, 4, 0, 0, 8, 0, 0, 0, 4, 4, 0, 0, 0, 0, 0, 0, 4, 2, 0, 6]
```
(note that it is implemented in all dimensions, not just quadratic forms).

Ariel

On Thu, 5 May 2005, Jonathan Hanke wrote:

```
```Hi,

I was wondering if Pari can compute the theta function of a quadratic
form.  There seems to have been a gp command (qfred?) which did this,
but I can't find it in the current manual.  Thanks,

-Jon

```
```
```