Solve the following nonlinear equations for $v$ and $w$
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
by Lagrange multiplier. Here A are all tensor products of Pauli matrices