Entanglement and heat capacity in a two-atom Bose–Hubbard model