Given a unit quaternion in hamiltonian notiation $q$ which describes some arbitrary rotation of $\alpha$ about axis $\beta$ as
$$ q =\begin{bmatrix} \cos(\alpha/2) \\ \sin(\alpha/2)\beta_x \\ \sin(\alpha/2)\beta_y \\ \sin(\alpha/2)\beta_z \\ \end{bmatrix} $$
how would I calculate the magnitude of rotation (in radians) that quaternion gives me about some arbitrary axis $v$?
As further clarification, what I mean by "magnitude of rotation about an arbitrary axis" would be the same as finding the angle $\alpha^\star$ which minimizes the angle $\tilde{\alpha}$ encoded by the "error" between the two quaternions $$ \tilde{q} = q^{-1} \otimes q^\star $$ where $$ q^\star =\begin{bmatrix} \cos(\alpha^\star/2) \\ \sin(\alpha^\star/2)v_x \\ \sin(\alpha^\star/2)v_y \\ \sin(\alpha^\star/2)v_z \\ \end{bmatrix} $$ and $$ \tilde q =\begin{bmatrix} \cos(\tilde\alpha /2) \\ \sin(\tilde\alpha /2)\tilde\beta_x \\ \sin(\tilde\alpha /2)\tilde\beta_y \\ \sin(\tilde\alpha /2)\tilde\beta_z \\ \end{bmatrix} $$
and $v=\begin{bmatrix} v_x & v_y & v_z \end{bmatrix}^\top$ is the arbitrary axis of rotation.
I believe that this calculation is similar to calculating euler angles from a quaternion, i.e. "yaw" is typically the amount of rotation about the $z$ axis, and is can be calculated with (link)
$$ \psi = \textrm{atan}\frac{2(q_w q_z + q_x q_y)}{ 1-2(q_y^2+q_z^2)} $$
and you can form a quaternion with rotation only about $z$ through an angle $\psi$ with
$$q_\psi = \begin{bmatrix} \cos\left(\frac{\psi}{2}\right) & 0 & 0 & \sin\left(\frac{\psi}{2}\right) \end{bmatrix}^\top. $$