The Quantum-Mechanical Partition Function