1
$\begingroup$

Deutsch's algorithm is a special case of Deutsch-Josza's algorithm where the number of qubits evaluated = 2. This is equivalent to performing the operation $x_1 ⊕ x_2$ i.e. checking the parity of 2 qubits. A corollary of Deutsch algorithm says that there is a quantum algorithm that checks the parity of $n$ qubits with at most $\frac{n}{2}$ queries. I'm trying to come up with such an algorithm.

At first, I thought of repeatedly applying Deustch's algorithm (i.e. operating on two qubits with the unitary for parity checking) and increasing the number of qubits by one every iteration. However this does not seem to give me the upper limit of $\frac{n}{2}$ queries which the corollary states. How do I reduce the number of queries? Is my approach even valid? If not, how would I go about doing this?

$\endgroup$

1 Answer 1

1
$\begingroup$

You should think of Deutsch's algorithm as comparing two different bit values, and telling you if they're the same or different. Now, if you need to know the parity of $n$ bits, think of this as comparing the parity of the first $n/2$ bits with the parity of the second $n/2$ bits. To compute either only requires $n/2$ queries.

$\endgroup$
2
  • $\begingroup$ Does this really work? The bit string 0 1 0 1 0 1 has parity with an equal amount of 0's and 1's, but individual pairs or individual halves do not. I probably misunderstand your answer. $\endgroup$
    – rhundt
    Commented Oct 27, 2023 at 20:16
  • $\begingroup$ @rhundt I think you misunderstood. You're not trying to calculate if a function is constant or balanced (that would be Deutsch-Jozsa, not Deutsch). You are just trying to calculate if two bit values ($x$,$y$) are the same or different, which is the same as evaluating $x\oplus y$. So if I happen to set $x=z_1\oplus z_2\oplus\ldots\oplus z_{n/2}$ and $y=z_{n/2+1}\oplus\ldots\oplus z_n$, that will evaluate what I want. $\endgroup$
    – DaftWullie
    Commented Oct 30, 2023 at 7:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.