Solution (source code)

= Solution

The <grand potential> is
$$
\boxed{\Phi=E-TS-\mu\langle N\rangle
=-k_BT\log\mathcal Z}.
$$