Consider the smallest Weyl algebra $A\_1=\{q,p; qp-pq=1\}$. It is known that there exist pairs of commuting elements, say $L$ and $M$, that obey various polynomial relations, e.g. elliptic curves. I wonder how big the commutative subalgebra of the Weyl algebra can be? (of course, I mean how big the generating set of commuting elements can be since any product of commuting things trivially commutes with the generating set)



How big can a commutative subalgebra of Weyl algebra be?
The key papers on this seem to be by Krichever: I skimmed "[Commutative rings of ordinary linear differential operators](http://link.springer.com/article/10.1007/BF01681429)" and "[Integration of nonlinear equations by the methods of algebraic geometry](http://link.springer.com/article/10.1007/BF01135528)". I am not certain that I understood them correctly; I hope an expert will show up to correct any errors.


Let $f$ be any nonscalar element of $A\_1$ and let $C(f)$ be the set of $g\in A\_1$ that commute with $f$. Then $C(f)$ is a finitely generated $k[f]$-module. In particular, if $R$ is a commutative ring containing $f$, then $R$ is a finitely generated $k[f]$ module. This result is originally due to Flanders; see [Amitsur](http://www.ams.org/mathscinet-getitem?mr=95305) for an elementary proof. 


Let $R$ be a commutative subalgebra of $A\_1$. We have just showed that $R$ is a $\mathbb{C}$-algebra which is finite over $\mathbb{C}[f]$ for any nonscalar $f$ in $R$. Let $\tilde{R}$ be the normalization of $R$. Then this shows that $\mathrm{Spec}(\tilde{R})$ is a curve with one puncture. (If there were more than one puncture, we could find $f$ in $R$ which blew up at one of the punctures and not another, and then $R$ wouldn't be finite over $\mathbb{C}[f]$.)


It seems like papers in this field describe the size of subalgebras of $A\_1$ using two parameters: The genus of $\mathrm{Spec}(\tilde{R})$ and something called the "rank". I didn't understand the more sophisticated description of rank, but it seems to have the following elementary description: Let $\phi \in R \subset A\_1$ be a nonscalar. Considered as an element of $\tilde{R}$, let $\phi$ have a pole of order $d$ at the puncture. Considered as an element of $A\_1$, let $\phi$ be a polynomial in $p$ and $q$ of degree $e$. Then $e/d$ is an integer independent of $\phi$, called the rank. WARNING: I inferred this from context; no one explicitly said it.


See [Mokhov](http://arxiv.org/abs/1201.5979) for constructions of commutative subalgebras of arbitrary genus and rank.


You asked about number of generators. In other words, you would like the ring $R$ to have many generators. This is not what most papers focus on and I agree with Qiaochu that it isn't the best notion of size, but I'll try to think about it. If $R = \tilde{R}$, then $R$ can be generated by $3$ elements because any smooth affine curve embeds into $\mathbb{C}^3$. (Take a generic projection of a high dimensional embedding.) I found papers that stated that $R$ need not equal to $\tilde{R}$, but I didn't find explicit examples. The papers of Krichever linked above are supposed to be answering the inverse problem: Given $R$, build the ring of differential operators, but I couldn't extract an explicit statement from them of whether this is always possible.


