In quantum mechanics, the results of the quantum particle in a box can be used to look at the equilibrium situation for a quantum ideal gas in a box which is a box containing a large number of molecules which do not interact with each other except for instantaneous thermalizing collisions. This simple model can be used to describe the classical ideal gas as well as the various quantum ideal gases such as the ideal massive Fermi gas, the ideal massive Bose gas as well as black body radiation (photon gas) which may be treated as a massless Bose gas, in which thermalization is usually assumed to be facilitated by the interaction of the photons with an equilibrated mass. Using the results from either Maxwell–Boltzmann statistics, Bose–Einstein statistics or Fermi–Dirac statistics, and considering the limit of a very large box, the Thomas-Fermi approximation (named after Enrico Fermi and Llewellyn Thomas) is used to express the degeneracy of the energy states as a differential, and summations over states as integrals. This enables thermodynamic properties of the gas to be calculated with the use of the partition function or the grand partition function. These results will be applied to both massive and massless particles. More complete calculations will be left to separate articles, but some simple examples will be given in this article. For both massive and massless particles in a box, the states of a particle areenumerated by a set of quantum numbers. The magnitude of the momentum is given by where h is Planck's constant and L is the length of a side of the box. Each possible state of a particle can be thought of as a point on a 3-dimensional grid of positive integers. The distance from the origin to any point will be Suppose each set of quantum numbers specify f states where f is the number of internal degrees of freedom of the particle that can be altered by collision. For example, a spin ½ particle would have f=2, one for each spin state. For large values of n, the number of states with magnitude of momentum less than or equal to p from the above equation is approximately which is just f times the volume of a sphere of radius n divided by eight since only the octant with positive ni is considered. Using a continuum approximation, the number of states with magnitude of momentum between p and p+dp is therefore where V=L3 is the volume of the box. Notice that in using this continuum approximation, also known as Thomas−Fermi approximation, the ability to characterize the low-energy states is lost, including the ground state where ni=1. For most cases this will not be a problem, but when considering Bose–Einstein condensation, in which a large portion of the gas is in or near the ground state, the ability to deal with low energy states becomes important. Without using any approximation, the number of particles with energy εi is given by