In a multi-qubit system I can find the amplitudes of a state and compute probabilities, $\theta$, and $\varphi$. This falls out from simulation with simple numpy arrays. For example, after application of a variety of states, I get the amplitudes for all multi-qubit state $|\psi\rangle$, eg., $|00\rangle$, $|01\rangle$, $|10\rangle$, $|11\rangle$ as 4x1 complex numpy array, representing the tensor product of my 2 qubits.
These amplitudes and phases corresponds to this display in Quirk:
However, Quirk also shows the "local state" - per qubit - as a bloch wireframe.
How do I compute the Bloch coordinates for this local state, eg., out of my state vector? I believe I can get $\theta$ as the $arccos$ of the measurement probability for $|0\rangle$, which I compute via projection of $|0\rangle \langle 0|$ and $|1\rangle \langle 1|$ onto the density operator of the state? But how do I get the phase?
Thanks for any pointers!