What are Test Functions in QFT (physics context)? In terms of mode function solutions of the KG equation, the field operator can be written as
$$ \hat{\phi}(x) = \int_{R^3} d^3\textbf{p}\space \left(u_\textbf{p} \hat{a}_\textbf{p}+ u^*_\textbf{p}\hat{a}^\dagger_\textbf{p}\right). \tag{1}\label{eq1}$$
The positive frequency mode functions span a one-particle Hilbert space from which the bosonic Fock space of the theory can be constructed. Mathematically, equation \eqref{eq1} is an abuse of notation as the "field operator" presented here is actually pointwise representation of the operator-valued distribution $\hat{\phi}[f]$, which yields an operator on the Fock space once smeared with a Schwartz function $f$ (see p.50 of Chatterjee’s lecture notes), i.e.
$$ \hat{\phi}[f] = \int d^4\textbf{x}\space f(x) \hat{\phi}(x).\tag{2} $$
I’ve read that this is done so to "smoothen" the distribution and, intuitively, to account for the fact that a particle is never perfectly localized; theory fails at high energies etc… However, until now, this test function is not mentioned in any of my courses, so I fail to make its connection to the expressions I see in physics. First, I thought these test functions are the mode functions we get from solving the EoM, and from a QM perspective, related to the wave functions of one-particle states, although they’re fundamentally different entities. This also clarified the (historical, problematic) notion of "second quantization". But, they seem to be independent, for example the plane wave solutions coming from the Fourier transform would be included in $\phi(x)$ and $f$ would be something else. Also, how does then one choose a test function? I know they have to be smooth and rapidly decreasing.
 A: You're not seeing test functions in typical physicist texts on QFT because QFT generally does not operate at the level of mathematical rigor where it would consistently care about the notion of quantum fields being operator-valued distributions and not operator-valued functions.
In contrast to many other areas of physics where we at least in principle know a fully mathematically rigorous formulation of the theory, the correct rigorous formulation of general QFT - and in particular of the kind of QFTs we use to describe the universe, i.e. the Standard Model - is not known. The formulation of an SM-like theory in a fully rigorous framework is one of the millenium problems and still unsolved.
However, indeed one approach to rigorously formulate QFT is to think of quantum fields as operator-valued distributions. A distribution is defined as a linear map on some space of functions, and the functions in that space are called "test functions". A common choice is to talk about tempered distributions, which by definition are the dual space of the space of Schwartz functions, which are functions rapidly decreasing at infinity so that many common integrals can converge without issues. That is, test functions are just part of the definition of what a distribution is, not something with immediate physical meaning.
You rarely have to "choose" a specific test function, much like you would never really choose some specific value of $x$ to evaluate $\phi(x)$ at in the usual non-rigorous approach.
A: Test functions are the objects that occur in the theory of distributions that makes mathematical sense of   Dirac's  delta finction. They are smooth (i.e. infinitely differentiable) functions that vanish rapidly at infinity.
