  For a thought experiment concerning the mixing of two classical gases, Gibbs
concluded that the work that can be extracted from mixing is determined by
whether or not the gases can be distinguished by a semi-permeable membrane;
that is, the mixing work is a discontinuous function of how similar the gases
are. Here we describe an optomechanical setup that generalises Gibbs' thought
experiment to partially distinguishable quantum gases. Specifically, we model
the interaction between a polarising beamsplitter, that plays the role of a
semi-permeable membrane, and two photon gases of non-orthogonal polarisation.
We find that the work arising from the mixing of the gases is related to the
potential energy associated with the displacement of the microscopic membrane,
and we derive a general quantum mixing work expression, valid for any two
photon gases with the same number distribution. The quantum mixing work is
found to change continuously with the distinguishability of the two polarised
gases. In addition, fluctuations of the work on the microscopic membrane become
important, which we calculate for Fock and thermal states of the photon gases.
Our findings generalise Gibbs' mixing to the quantum regime and open the door
for new quantum thermodynamic (thought) experiments with quantum gases with
non-orthogonal polarisations and microscopic pistons that can distinguish
orthogonal polarisations.
