How can I convert the following equation into quadratic format, e.g., $x^TQx$:
$\sum_{i=1}^n (\delta_i .x)^TA (\delta_i .x)$,
where $\delta_i$ is indicator function of size $T \times 1$, same size as $x$, $A$ is matrix of size $T \times T$, and $(\delta_i.x)$ is element-wise multiplication of two vectors.