  Motivated by applications in genomics, this paper studies the problem of
optimal estimation of a quadratic functional of two normal mean vectors,
$Q(\mu, \theta) = \frac{1}{n}\sum_{i=1}^n\mu_i^2\theta_i^2$, with a particular
focus on the case where both mean vectors are sparse. We propose optimal
estimators of $Q(\mu, \theta)$ for different regimes and establish the minimax
rates of convergence over a family of parameter spaces. The optimal rates
exhibit interesting phase transitions in this family. The simultaneous signal
detection problem is also considered under the minimax framework. It is shown
that the proposed estimators for $Q(\mu, \theta)$ naturally lead to optimal
testing procedures.
