TITLE: Maneuvering with limited moves on $S^2$
QUESTION [29 upvotes]: This question comes to me via a friend, and apparently has something to do with quantum physics. However, stripped of all physics, it seems interesting enough on its own. I assume someone has asked this question before, but I have no idea what to search for:
Suppose we have points $P$ and $Q$ on $S^2$, and two available rotations: specifically, I am interested in rotations by $\pi/4$ radians about the $x$ and $z$ axes. Given $\varepsilon > 0$, is there an effective algorithm for applying these rotations to $P$ so that it is within Euclidean  distance $\varepsilon$ of $Q$?
Edit: Update retracted. I'm curious about the general situation as well, where the two rotations are arbitrary (and, obviously, send $P$ to a dense subset of $S^2$).

REPLY [9 votes]: Using  properties of commutators in a neighborhood of identity (beautifully described in Bill Thurston's answer, on which the following is a comment), Solovay-Kitaev algorithm in quantum computation produces words of length  $O(\log^{2+}(1/\epsilon))$ for any dense subgroup; see, for example, [1] for a very nice exposition.  
For dense subgroups generated by elements with algebraic entries, the spectral gap result proved in [2] implies existence of words of length $O(\log(1/\epsilon))$. 
[1] C.M. Dawson and M.A. Nielsen, The Solovay-Kitaev algorithm, Quantum Inf. Comput., 6, 81-95, 2006.
[2]J. Bourgain and A. Gamburd, On the spectral gap for finitely generated subgroups of SU(2), Inv. Math. 171, 83-121, 2008.
(It appears to be of interest (and challenge) to extend the result in [2] to arbitrary dense subgroups, and to find an effective algorithm producing words of length $O(\log(1/\epsilon))$).