  We consider two seemingly unrelated questions: the relationship between
nonnegative polynomials and sums of squares on real varieties, and sparse
semidefinite programming. This connection is natural when a real variety $X$ is
defined by a quadratic square-free monomial ideal. In this case nonnegative
polynomials and sums of squares on $X$ are also natural objects in positive
semidefinite matrix completion. Nonnegative quadratic forms over $X$ naturally
correspond to partially specified matrices where all of the fully specified
square blocks are PSD, and sums of squares quadratic forms naturally correspond
to partially specified matrices which can be completed to a PSD matrix. We show
quantitative results on approximation of nonnegative polynomials by sums of
squares, which leads to applications in sparse semidefinite programming.
