  Let $X\subseteq \mathbb{P}^m$ be a totally real, non-degenerate, projective
variety and let $\Gamma\subseteq X(\mathbb{R})$ be a generic set of points. Let
$P$ be the cone of nonnegative quadratic forms on $X$ and let $\Sigma$ be the
cone of sums of squares of linear forms. We examine the dimensions of the faces
$P(\Gamma)$ and $\Sigma(\Gamma)$ consisting of forms in $P$ and $\Sigma$, which
vanish on $\Gamma$. As the cardinality of the set $\Gamma$ varies in
$1,\dots,\rm{codim}(X)$, the difference between the dimensions of $P(\Gamma)$
and $\Sigma(\Gamma)$ defines a numerical invariant of $X$, which we call the
gap vector of X. In this article we begin a systematic study of its fundamental
properties. Our main result is a formula relating the components of the gap
vector of $X$ and the quadratic deficiencies of $X$ and its generic
projections. The quadratic deficiency is a fundamental numerical invariant of
projective varieties introduced by F. L. Zak. The relationship between
quadratic deficiency and gap vectors allows us to effectively compute the gap
vectors of concrete varieties as well as to prove several general properties.
We prove that gap vectors are weakly increasing, obtain upper bounds for their
rate of growth and prove that these upper bounds are eventually achieved for
all varieties. Moreover, we give a characterization of the varieties with the
simplest gap vectors: We prove that the gap vector vanishes identically
precisely for varieties of minimal degree, and characterize the varieties whose
gap vector equals $(0,\dots, 0,1)$. In particular, our results give a new proof
of the theorem of Blekherman, Smith and Velasco saying that there are
nonnegative quadratic forms which are not sums of squares on every variety,
which is not of minimal degree. Finally, we determine the gap vector of all
Veronese embeddings of $\mathbb{P}^2$, generalizing work of the first three
authors.
