Let me detail the title of the question. I'm trying to give students an intuition of what the class number is.


Let $K=\mathbb{Q}(\sqrt{-d})$, with $d>0$ a square-free integer, be a quadratic imaginary field. Let $\mathcal{O}\_K$ be its ring of integers. It is of the form $\mathbb{Z}[\tau]$ with $\tau=\sqrt{-d}$ or $\tau=\frac{1+\sqrt{-d}}{2}$ depending on the value of $d$ mod $4$. 


So let us think of $\mathcal{O}\_K$ as the lattice of $\mathbb{C}$ generated by $1$ and $\tau$. Then ideals should correspond to sublattices of $\mathcal{O}\_K$ and two of them should define the same class in the class group if one can pass from one to another by multiplying by an element of $\alpha$, isn't it? 


Could anybody help me to make this analogy precise? For instance, how can one see that $\mathbb{Q}(i)$ has class number 1 but $\mathbb{Q}(\sqrt{-5})$ doesn't just by looking at the corresponding lattices? The (non-equivalent) decompositions


$2.3=(1+\sqrt{5}i)(1-\sqrt{5}i)$ 


suggest to consider the lattices $\mathbb{Z}\cdot 2+\mathbb{Z}\cdot(1+\sqrt{5}i)$ and $\mathbb{Z}\cdot 3+\mathbb{Z}\cdot(1-\sqrt{5}i).$ Is that what I have to do?


Thanks! 



how to visualize the class number of an imaginary quadratic field?
This is an interesting question that I've wondered about myself, so I can't really answer it properly but I'll make a couple elementary observations. First, for a lattice in ${\mathbb Z}[\tau]\subset{\mathbb C}$ to be an ideal just means that multiplication by $\tau$ takes the lattice to itself. For example, for the Gaussian integers this says the lattice is invariant under 90 degree rotation about the origin. It is easy to see that this means the lattice is a square lattice with a basis consisting of two of its shortest vectors. (This is really just a disguised version of the Euclidean algorithm for Gaussian integers.) Thus every ideal is principal in this case.


Back to the general case, another observation is that if two ideals are in the same ideal class, then the two lattices are related by an orientation-preserving similarity, that is, rotation and rescaling, which is what multiplying an ideal by an element of ${\mathbb Z}[\tau]$ does to a lattice. (It seems the converse should be true as well). For example in the case $\tau =\sqrt5i$ the principal ideal class consists of rectangular lattices similar to ${\mathbb Z}[\tau]$ itself, and the other ideal class (the class number is 2 here) consists of lattices similar to the lattice $(2,1+\sqrt5i)$ which is skewed rather than rectangular. It is enlightening to draw a picture to see how this lattice is invariant under multiplication by $\sqrt5i$.


Another thing that can be viewed geometrically is the correspondence between ideal classes and equivalence classes of binary quadratic forms of fixed discriminant. An ideal, viewed as a lattice, determines a quadratic form by restricting the usual norm (squared) $x^2 + y^2$ to the lattice, then renormalizing suitably to make equivalent ideals have equivalent quadratic forms. A textbook that explains this, to some extent at least, is Advanced Number Theory by Harvey Cohn.


It would be interesting to work out some more examples to see what the different similarity classes of lattice-ideals look like, especially in cases when the class number is larger than 2. Is the structure of the ideal class group somehow visible in how the similarity classes are related?


