Integrable Partition Functions and Quantum Systems