# Relationship between Toffoli gate and Deutsch gate

I am reading a book called "Quantum Computing for computer scientists" and stuck at this exercise for a day. Bellow is the description of Deutsch gate: And here is the description of Toffoli gate: In my opinion, phase shift operation only change the phase of |1> state, but leave the probability of both state (|0> and |1>) with no change. My question is how phase shift operation change the |110> -> |111> and |111> -> |110> as in the case of Toffoli gate (I mark by red rectangle in Toffoli gate matrix above?

If I misunderstand any thing, please point out. Any help, hint to solve this exercise would be appreciated.

The rotation $R(\theta)$ in the Deutsch gate should be a rotation about the $X$ axis, not about the $Z$ axis, i.e., $$R(\theta)\vert k \rangle = i\cos(\theta) \vert k \rangle + \sin(\theta)\vert 1-k\rangle\ ,$$ $k=0,1$, as e.g. described on Wikipedia.
Then, setting $\theta=\pi/2$ one immediately obtains the Toffoli gate.
Note that if $R(\theta)$ were a phase shift, the Deutsch gate would not be universal, as it would be diagonal, and thus would only allow to obtain diagonal gates.