# Thermodynamic cycles of quantum particles

We usually see thermodynamic cycles (e g. Carnot) applied to ideal gas particles. Can we also apply these cycles to "gases" of quantum particles such as photons and electrons?

For example, a photon gas has pressure $P(T) = \frac{U}{3V}$. Can I put this gas in a piston cylinder assembly and subject it to a Carnot cycle?

$$S = (\text{something}) \cdot VT^3$$
So, to change the entropy while holding the temperature constant you just change the volume. To change the temperature while holding entropy constant is a bit harder. You have to slowly vary the temperature of the container holding your photon gas, while at the same time adjusting the volume to ensure that $VT^3$ remains constant. By doing these two things, it is possible to go around in a rectangle in $T, S$ space forever.
This construction should produce the analogous version of the Carnot cycle for a photon gas. You can then apply additional photon gas equations to find $P$, $U$, etc.