### Theta series of even lattice

I am new to sage and trying to figure out how to calculate the series expansion of the theta function for an even lattice $L$, i.e. $$\Theta_L(q)=\sum_{x\in L} q^{\langle x,x\rangle/2}$$

I tried the following code for the $A_2$ lattice, but I doesn't really do what its supposed to do

Q=QuadraticForm(QQ,2,[2,-1,2]); Q
Q.theta_series(20)

I found the following code on OEIS, which gives the correct result:

ModularForms( Gamma1(3), 1, prec=81).0