# Diagonal of Hilbert--Schmidt operator

Suppose $U\in HS$, Hilbert--Schmidt operators on $V = L^2(\mathbb{R}^n)$. There is a natural isomorphism between HS operators and elements in $W = L^2(\mathbb{R}^n\times\mathbb{R}^n)$, in particular, for every $U\in HS$ there is a $u\in W$ such that $$[U\varphi](x) = \int_{\mathbb{R}^n} u(x,y)\varphi(y) dy.$$

Suppose now that $U$ is also trace-class. Informally (i.e., in physics), $$\operatorname{Tr} U = \int_{\mathbb{R}^3} u(x,x)dx.$$

Question: To what extent is the latter statement rigorous? What confuses me is that $u$ is defined only up to a set of measure zero and the integral is taken over such a set. Is there some notion of trace operator that can be used here, which gives the "correct diagonal"? Taking the limit of successively narrow "strips" along the diagonal?

I can "prove" it as follows: Let $\{f_\mu\}$ be an orthonormal basis for $V$, say Hermite functions, such that $\{f_\mu\otimes f_\nu\}$ is an orthonormal basis for $W$, and we have an expansion $$u = \sum_{\mu\nu} u_{\mu\nu} f_\mu\otimes f_\nu.$$ Now we have $$\int u(x,x) dx = \sum_{\mu\nu} u_{\mu\nu} \int f_\mu(x) f_{\nu}(x) = \sum_{\mu\nu} u_{\mu\nu} \langle{f_\mu,f_\nu}\rangle = \sum_\mu u_{\mu\mu} = \operatorname{Tr} U.$$

-