Talk:Deutsch–Jozsa algorithm
![]() | Physics Unassessed | |||||||||
|
I found a small mistake in the description of the algorithm, and I corrected it. To me, the wording of the article is still a bit sloppy; but I'm not going to try to fix it at the moment. At least now the algorithm works. :) Karadoc** 05:27, 3 July 2006 (UTC)
what we measuring?
As wrot there "Definition: A quantum algorithm to determine whether a function is constant or balanced, that is, returns 1 for half the ___domain and 0 for the other half. For a function taking n input qubits, first, do Hadamards on n 0's, forming all possible inputs, and a single 1, which will be the answer qubit. Next, run the function once; this exclusive or's the result with the answer qubit. Finally, do Hadamards on the n inputs again, and measure the answer qubit. If it is 0, the function is constant, otherwise the function is balanced. - http://www.nist.gov/dads/HTML/deutschJozsaAlgo.html" - need measure only one the answer qubit, but how wrote at wikipedia "The algorithm is as follows. First, do a Hadamard transform on a quantum register of n 0s, forming all possible inputs, and a single 1, which will be the answer qubit. Next, run the function once. This is done by using the n input qubits as input of the function of a Function-Controlled NOT gate that works on the answer qubit. Finally, do Hadamards on the n inputs again, and measure them". So what we have measure answer qubit or over all except answer qubit. And if we must measure answer qubit, then why we must do hdamard transform (after then qubits pass through CNOT gate) on qubits that not be measured? CNotGate
- 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.Skippydo 16:28, 27 June 2007 (UTC)
If i correct understand, on output measuring is the answer qubit (it is just mathematical model that measuring must be all first (top) qubits)? Or maybe becouse all firsts qubits is entangled, they gives answer if we measure one of those?..
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: . Then summ last qubits with all firsts qubits except last by MOD 2: 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.