Content deleted Content added
Deutsch algorithm with n qubits remake |
|||
Line 11:
:By "answer qubit" they are refering to the target of f. That is |x>|y> becomes |x>|f(x)+y> and the "|y>" qubit is the "answer" (of f). The behaviour of f should have been explicitly stated as it has in my recent change.[[User:Skippydo|Skippydo]] 16:28, 27 June 2007 (UTC)
== Deutsch algorithm with n qubits remake ==
I don't understand why so stupid and dificul is calculation of such simple thing...
Supose we have ''n'' qubits on input, for example |0>|1>|0>|1>...|n>=|0,1,0,1,...,n>. Let's mark all qubits like this:
<math>|x_1 \rang |x_2 \rang |x_3 \rang...|x_n \rang=|x_1,x_2,x_3,..,x_n \rangle </math>.
Then summ last qubits with all firsts qubits except last by MOD 2:
<math>|x_1 \times x_n ,x_2 \times x_n, x_3 \times x_n ,..., x_{n-1} \times x_n \rangle H \times |x_n\rang </math>
If all firsts qubits is zeros, then function is constant, if ''all'' first qubits doesn't zeros, then function is balanced.
Example. We have on input |0>|1>|0>|0>|1>|1>=|0,1,0,0,1,1>. As we see, last qubit is 1. Then plus last qubit by Mod 2: |0+1,1+1,0+1,0+1,1+1,1>=|1,0,1,1,1,1>, all firsts qubits is not zeros, so function is balanced.
Another example. We has on input |1,1,1,1,1,1>. Last qubit is 1. So by Mod 2 plus last qubit to all firsts: |1+1,1+1,1+1,1+1,1+1,1>=|0,0,0,0,0,1>. As we can see all firsts qubits is zeros, so function is constant.
One more example. We has on input |0,0,0,0,0,0,0,0>. Sum up firsts all qubits with last one by Mod 2. |0+0,0+0,0+0,0+0,0+0,0+0,0+0,0>=|0,0,0,0,0,0,0,0>. As we can see all firsts qubits is zeros, so function is constant.
|