Consider a quantum two-level system indexed by states $|l\rangle = |0\rangle,|1\rangle$ and energies $\epsilon_l$, where $\epsilon_0 = 0$,$\epsilon_1 = \epsilon$. I throw in 2 bosons into the system and let it thermalize to temperature $T$. Now, if I want to get the partition function, I can do it two ways
- Partition function from counting microstates: Here, the system has $\displaystyle\frac{(2+1)!}{2!\;1!}=3$ microstates, $|00\rangle^+,|01\rangle^+$ and ,$|11\rangle^+$ (the '$+$' superscript signifies symmetric combination), with energies $0,\epsilon, 2\epsilon$ respectively. Thus, the partition function is $$ Z \equiv \displaystyle\sum_{\rm{microstates}}e^{-\beta E_{\rm{microstate}}}=e^{-\beta\times 0}+e^{-\beta\times \epsilon} + e^{-\beta\times 2\epsilon}=1+e^{-\beta\epsilon}+e^{-2\beta\epsilon} $$.
- Partition function from density matrix: Here, $$ Z = \rm{Tr}[e^{-\beta \hat{H}}]=\rm{Tr}[e^{-\beta\sum_l\epsilon_l\hat{n}_l}]=\displaystyle\prod_l\sum_{n\in[0,1,2]} e^{-\beta\epsilon_l n}\\ =\sum_{n\in[0,1,2]} e^{-\beta\epsilon_0 n}\times \sum_{n\in[0,1,2]} e^{-\beta\epsilon_1 n}\\ = \left(e^{-\beta\times 0\times 0 }+e^{-\beta\times 1\times 0 }+e^{-\beta\times 2\times 0 }\right)\times\left(e^{-\beta\times 0\times \epsilon }+e^{-\beta\times 1\times \epsilon }+e^{-\beta\times 2\times \epsilon }\right)\\ = 3\left(1+e^{-\beta\epsilon}+e^{-2\beta\epsilon}\right). $$
Why is there a discrepancy of a factor of $3$ between these two methods? While constant factors in partition functions don't affect any thermodynamics AFAIK, why is the discrepancy there anyways?