n quadratic equations with n variables I have a system of n quadratic equations with n unknown variables $a_1,...,a_n$  that can be written as followed:
$
\begin{pmatrix}a_1\\a_2\\\vdots\\a_n\end{pmatrix}^TB_i\begin{pmatrix}a_1\\a_2\\\vdots\\a_n\end{pmatrix}=g_i 
$
$i=1,...,n$


*

*$B_i$ are known $n\times n$ matrices

*the $g_i$ are known as well

*$n$ is even
For $n=2$ this is easy to solve by simply multiplying the matrix and vectors out and then doing some basic algebra.
However with $n=4$ or higher the amount of computing time by this method gets quite excessive and I was wondering if there is a simpler algorithm to obtain the $a_i$ ? 
 A: The parity of $n$ has nothing to do here.
Let $X=[a_1,\cdots,a_n]^T$. If the $(B_i),(g_i)$ are generic (for example, randomly choose them), then the number of complex solutions $X$ is $2^n$.
To find explicit solutions, we can use Grobner basis method. We solve an algebraic system of $n$ equations of degree $2$ in the $n$ unknowns $(a_i)$.
That works in less than $18"$ until $n=6$ ($64$ solutions). 
The Grobner decomposition reduces the original system to a system of the form (when $n=6$). 
$P(a_1)=0,a_2=Q_2(a_1),\cdots,a_n=Q_n(a_1)$ where $degree(P)=64,degree(Q_i)=63$.
Thus, solving $P(a_1)=0$, we obtain approximations of the $64$ complex values of $a_1$; the sequel is easy.
EDIT. Answer to the OP. That follows is an example, when $n=4$, solved -using Maple- in 0"2 (of course, the hidden calculations are very complicated). The system of $4$ equations in the unknowns $(x_i)$ has LHS 

.
The polynomial, the roots of which, are the $2^4=16$ complex solutions in $x_1$ is

The other functions (I don't write them) give $x_2,x_3,x_4$ as polynomials in $x_1$.
