Solution (source code)

= Solution

The characteristic polynomial of the displayed <rotation matrix> is $(1-\lambda)(\lambda^2-2\lambda\cos\theta+1)$, so its eigenvalues are $1,e^{i\theta},e^{-i\theta}$, all of <modulus> one. The real eigenvector $(0,0,1)^T$ spans the rotation axis, while the arguments $\pm\theta$ of the conjugate eigenvalues record the rotation angle on its perpendicular plane.

Applying first the $z$-rotation and then the $x$-rotation gives
$$
R_x(\pi/2)R_z(\pi/2)=
\begin{pmatrix}0&-1&0\\0&0&-1\\1&0&0\end{pmatrix}.
$$
Its $1$-eigenspace is spanned by $(1,-1,1)^T$, so $\mathbf n=(1,-1,1)^T/\sqrt3$. The <matrix trace> identity $\operatorname{tr}R=1+2\cos\phi$ gives $0=1+2\cos\phi$. Thus \b[$\phi=2\pi/3$].