This is not a homework problem but rather a passage from my textbook that I don't understand. I don't think I quite understand the concept of reversible processes. Here is the passage from my book: "Consider a system in the quantum state s of energy Es. We assume Es to be a function of the volume of the system. The volume is decreased slowly by application of an external force. Let the volume change take place sufficiently slowly that the system remains in the same quantum state s throughout the compression...The mechanical work done on the system by the pressure in a contraction appears as the change of energy of the system." My question is: How is it possible that the system can remain in the same quantum state throughout the compression if the energy is changing? (I believe the system under consideration is in contact with a thermal reservoir). Is this a reversible process? Thank you!