Suppose w is a 1-d vector, X is a d by d positive semi-definite symmetric matrix, and a is a constant. Is there a way to express w in terms of X, a? $$ w^T X w = a^2 $$
I was thinking something like $ w = aX^{-1} $, but it does not seem right when I plug the value back.
This is not possible in general. Given the value of a quadratic form, you cannot recover the vector uniquely in general. Think of $X$ being the identity matrix. Then your left hand side is the square of the length of $w$. Knowing the length, you cannot find the vector uniquely. There is a whole sphere satisfying your condition.