# Why a dirac delta function makes the dimension of elements in a density matrix inconsistent?

Suppose that $$\left | m \right >=\int \frac {dk}{2\pi} G(k)\left | k \right >$$ and $$G(k)$$ has the dimension of $$[L]$$. So both sides of the equation are dimensionless.

A density matrix is defined as $$\rho=\sum_{mn} \rho_{mn}\left | m \right >\left < n\right |=\sum_{mn}\int \frac{dk_1dk_2}{(2\pi)^2}G_m(k_1)G^*_n(k_2) \rho_{mn}\left | k_1 \right >\left < k_2\right|$$ and the dimension of $$\rho_{mn}$$ is zero which is consistent.

But if I use select a element by applying \begin{align}\rho_{mn}=\left < m \right | \rho \left | n \right >&=\int \frac{dk_3dk_4}{(2\pi)^2}G_m(k_3)G^*_n(k_4) \left < k_3\right|\rho \left | k_4 \right >\nonumber \\ &=\int \frac{dk_3dk_4}{(2\pi)^2}G_m(k_3)G^*_n(k_4) \sum_{m'n'}\int \frac{dk_1dk_2}{(2\pi)^2}G_{m'}(k_1)G^*_{n'}(k_2) \rho_{m'n'}\left < k_3\right|\left . k_1 \right >\left < k_2\right| \left . k_4 \right > \nonumber \\ &=\sum_{m'n'}\int \frac{dk_3dk_4}{(2\pi)^2}\int \frac{dk_1dk_2}{(2\pi)^2}G_m(k_3)G^*_n(k_4) G_{m'}(k_1)G^*_{n'}(k_2) \rho_{m'n'}(2\pi)^2\delta(k_3-k_1)\delta(k_4-k_2) \nonumber \\ &=\sum_{m'n'}\int \frac{dk_1dk_2}{(2\pi)^2}G_m(k_1)G^*_n(k_2) G_{m'}(k_1)G^*_{n'}(k_2) \rho_{m'n'} \nonumber \end{align}

Now the rhs of the equation has the dimension of $$[L^2]$$ which is inconsistent with the lhs.

Where did I make a mistake? I think the problem is somewhere arond the Dirac delta function, but I still have not find any useful information about that.

I know Dirac delta function has the inverse dimension of its parameters, but I could not see how this fit in here.

I suppose you consider states $$|k>$$ in the continuous spectrum, otherwise you would not use the integration over $$k$$ but a summation. If so, the normalization of your $$|k>$$ probably looks like that $$=\delta(k_i-k_j)$$ which means $$|k>$$ is not exactly dimensionless for the reasons you mentioned (Dirac delta is $$[k]^{-1}$$).
Actually, you don't need to calculate density matrix to notice that; just try $$$$ and you"ll run into the same issue. One way out of this would be to say that the dimension of $$|k>$$ to be $$L^{1/2}$$ (assuming $$k$$ is sort of a wavevector) and thus consider instead $$|m^{\prime}>=L^{-1/2}|m>$$, in the spirit of eigenmodes in a box of a size $$L$$.