On the canonical distribution in quantum statistical mechanics