Solve the following nonlinear equations for $v$ and $w$
$Avv^TAw+Bvv^TBw=\lambda_1v+\lambda_2w$
$Aww^TAv+Bww^TBv=\lambda_1w+\lambda_2v$
$v^Tw=w^Tv=0$
$v^Tv=w^Tw=1$
where $\lambda_1, \lambda_2, \lambda_3$ are real. $A$, $B$ are n-by-n symmetric matrices. Furthermore, they are similar and each of them has exactly $n/2$ eigenvalues equal to $+1$ and $n/2$ eigenvalues equal to $-1$.
It is part of my attempt to minimize
$\sum_A |w^TAv|^2$
by Lagrange multiplier. Here A are all tensor products of Pauli matrices

