A Computational Theory of Quantum Thermodynamics