Formula for trace of compact operators on $L^2(\mathbb{R})$ given by integral kernels? Given an appropriate function $K: \mathbb{R}^2 \to \mathbb{C}$, say continuous of compact support, we obtain a compact operator $T$ on the Hilbert space $L^2(\mathbb{R})$ by the formula
$$ (T h)(t) = \int K(s,t) h(t-s) \ ds.$$
Suppose $T$ is trace class and we want its trace. The standard formula is
$$ \mathrm{trace}(T) = \sum \langle e_r \vert T e_r \rangle $$
where the sum is taken over an arbitrary orthonormal basis $(e_r)$ for $L^2(\mathbb{R})$ and inner products are conjugate-linear in the 1st slot. Now, correct me if I'm wrong, but I don't think there is any particularly descript basis for $L^2(\mathbb{R})$. However, $\mathbb{R}$ does have nice characters $\epsilon_s(t) = e^{its}$, $s \in \mathbb{R}$. Despite the fact these are not square-integrable, we might attempt to plow on formally, replacing summation by integration, as follows:
\begin{align*}
\mathrm{trace}(T) &= \int \langle \epsilon_r \vert T \epsilon_r \rangle \ dr \\
&= \int \int \overline{\epsilon_r(t)} (T \epsilon_r)(t) \ dt \ dr \\
&= \int \int e^{-irt} \int K(s,t) \epsilon_r(t-s) \ ds \ dt \ dr \\
&= \int \int e^{-irt} \int K(s,t) e^{irt} e^{-irs} \ ds \ dt \ dr \\
&= \int \int e^{-irs} \int K(s,t) \ dt \ ds \ dr \\
&= \int \int e^{-irs} k(s) \ ds \ dr  \\
&= \int \hat k(r) \ dr \\
\end{align*}
where we have defined $k$ by $k(s) = \int K(s,t) \ dt$ and written $\hat k$ for the Fourier transform of $k$. My question is:

Does this actually work? That is, does the compact operator $T$ on $L^2(\mathbb{R})$ given by the integral kernel $K$ have trace equal to $\int \hat k$ where $k(s) = \int K(s,\cdot)$?

I'm pretty sure this should be true. For example, I can write down the $K$ which makes $T$ the rank-1 projection onto some compactly supported unit vector $h  \in L^2(\mathbb{R})$. Specifically, putting $K(s,t) = \overline{h(t-s)} h(t)$ does the job. In this case, it turns out $k = h^* * h$ where $h^*(t) = \overline{ h(-t)}$ and $*$ is the convolution product. So, $\hat k = \widehat{ h^* * h} = \overline h h = |h|^2$ and $\int \hat k = \|h\|_2^2 = 1$ which equals the trace of $h$ so the formula holds in this case. 
 A: Disclaimer (in response to Paul Garret): The following assumes that the integral kernel $K(x,y)$ is nice enough that all integrals and manipulations below make sense. Determining sufficient hypotheses is a standard exercise (say at the level of Folland's Real Analysis), so I leave the details to you. I make no claims about necessary hypotheses.
Take the operator $T$ to be defined by
$(Tf)(x) = \int K(x, y) f(y) dy$.
We would like to compute the trace of $T$ (provided it exists) in terms of $K$.
Let $e_n(x)$ be an orthonormal basis of $L^2(\mathbb{R})$.
\begin{align}
\mathrm{tr}(T) &= \sum_n \langle e_n|T| e_n \rangle \\
&= \sum_n \int e_n(x) (T e_n)(x) dx \\
&= \sum_n \int \int e_n(x) K(x,y) e_n(y) dy dx
\end{align}
Since the $e_n$ form a complete basis, we have a resolution of the identity
$$ 1 = \sum_n | e_n \rangle \langle e_n | $$
Now,
\begin{align}
 f(x) = (1 \cdot f)(x) &= \sum_n \langle e_n | f \rangle | e_n \rangle \\
&= \sum_n e_n(x) \int e_n(y) f(y) dy
\end{align}
Hence
$$ \sum_n e_n(x) \int K(x, y) e_n(y) dy = K(x,x) $$
So we find
$$ \mathrm{tr}(T) = \int K(x,x) dx $$
