In the context of localization, a quantity closely related to the purity, the so-called inverse participation ratio (IPR) turns out to be useful. It is defined as the integral (or sum for finite system size) over the square of the density in some space, e.g., real space, momentum space, or even phase space, where the densities would be the square of the real space wave function | ψ ψ ( x ) | 2 , the square of the momentum space wave function | ψ ψ ~ ~ ( k ) | 2 , or some phase space density like the Husimi distribution, respectively.