I have a system with three qubits as input and I want to demonstrate this equality:
where the left part of the equal is the circuit representation of the Toffoli gate where the first two lines are the control qubits and the third one is the target. On the right side we have the CNOT gate whose matrix representation is
$$ CNOT=\left(\begin{array}{cccc} 1 & 0 & 0 & 0\\ 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 1\\ 0 & 0 & 1 & 0 \end{array}\right)$$
T,S and H are the $\dfrac{\pi}{8}$ gate,phase gate and Hadamard gate, respectively, represented by the matrixes
$$H=\dfrac{1}{\sqrt{2}}\left(\begin{array}{cc} 1 & 1\\ 1 & -1 \end{array}\right), S=\left(\begin{array}{cc} 1 & 0\\ 0 & i \end{array}\right), T=\left(\begin{array}{cc} 1 & 0\\ 0 & exp(i\pi/4) \end{array}\right)$$
The Toffoli gate is supposed to do this
My problem is that I don't know how, given some input, for example, the three qubits in the state |1>, the circuit acts on the input. For example, in the second control qubit there is a CNOT gate, so what I have to do is calculate the direct sum of |1> and the qubit which is below it once it has passed through the H gate? This is, before the target qubit reach $T^{\dagger}$, we have the state $|1>|1\oplus H|1>>=-\dfrac{1}{\sqrt{2}}|1>(|0>-|1>)$
Is this correct?