Tuesday, 15 December 2015

quantum mechanics - 2 following gates, permutation matrix


I have a circuit that has 4 wires and 2 following each other Toffoli gates.



I have permutation matrix for each Toffoli gate (A and B).


Do I have to multiply that 2 matrices to get the entire permutation matrix of that 2 Toffoli gates?


And if I do that is $A\times B$ or $B\times A$?



Answer



Yes, of course !


This nevertheless suppose that no time is lost between the two gates, but it is a usual assumption in basic lectures. If the state vector $\left| \Psi_0 \right>$ enters at the left of the circuit, then reach the gate A, represented by matrix $A$, then the B one represented by matrix $B$, and end up at the right of the logic circuit as $\left| \Psi_1 \right>$, then the final state is $\left| \Psi_1 \right> = \left( B \cdot A \right) \left| \Psi_0 \right>$, since A applies first, then B.


In your case, I suppose $\left| \Psi_0 \right> = \alpha_{0000} \left| 0 0 0 0 \right> + \alpha_{0010} \left| 0 0 1 0 \right> + \alpha_{0100} \left| 0 1 0 0\right> + ... $ has 16 entries, since you have 4 wires. Each wire usually represents the time evolution of a single q-bit. A Toffoli gate is usually a 3 q-bits gate, so you have to correctly generalise the Toffoli gate given on the Wikipedia page. Well, it means that you must put extra diagonal 1's in front of the untouched q-bit. You also have to change block-wise for the second gate I presume. (Please tell me if this last point is unclear for you, it is simpler to understand on a black-board than on internet actually :-) !)


No comments:

Post a Comment

Understanding Stagnation point in pitot fluid

What is stagnation point in fluid mechanics. At the open end of the pitot tube the velocity of the fluid becomes zero.But that should result...