We consider pure three dimensional quantum gravity with a negative cosmological constant. The torus partition function can be computed exactly as a sum over geometries, including all known quantum corrections. The answer provides important clues about the structure of quantum gravity; in particular, in order for the theory to be a proper quantum mechanical system some extra ingredients are needed beyond the usual real geometries considered in general relativity. One possiblity is that complex geometries need to be included; this leads to holomorphically factorized partition functions. These partition functions provide a wealth of information about black hole microphysics. For example, the Hawking-page phase transition can be studied exactly; it is a phase transition of the type described by Lee and Yang, which is associated with a condensation of zeros in the complex temperature plane.