patternMinor
Is it possible to make N-way Controlled-NOTs out of Toffoli gates, without extra work bits?
Viewed 0 times
withouttoffolibitsmakewaygatespossiblenotsworkout
Problem
I'm working on exercise 4.29 of Nielsen and Chuang:
Find a circuit containing O(n^2) Toffoli, CNOT, and single qubit gates which implements a $C^n(X)$ gate (for n >3), using no work qubits.
As part of solving this exercise, I'm trying to figure out if the task of making a NOT-controlled-by-N-bits is possible classically (i.e. without using single qubit gates, except the NOT gate).
This is trivial to do if you have work bits initialized to 0 available, but I haven't been able to figure out how to do it without work bits. I'm also not sure how to approach an impossibility proof.
The main thing I've figured out is that, if I could make $Increment$ and $Decrement$ gates, then I could do it like this:
But I also can't figure out how to make those gates, at least not without the many-controlled-not gate I'm trying to make.
Is this even possible (the limited-to-classical case, not the exercise)?
Find a circuit containing O(n^2) Toffoli, CNOT, and single qubit gates which implements a $C^n(X)$ gate (for n >3), using no work qubits.
As part of solving this exercise, I'm trying to figure out if the task of making a NOT-controlled-by-N-bits is possible classically (i.e. without using single qubit gates, except the NOT gate).
This is trivial to do if you have work bits initialized to 0 available, but I haven't been able to figure out how to do it without work bits. I'm also not sure how to approach an impossibility proof.
The main thing I've figured out is that, if I could make $Increment$ and $Decrement$ gates, then I could do it like this:
____ ____
--| |--| |--- --•--
--| |--| |--- --•--
--| +1 |--| -1 |--- == --•--
--| |--| |--- --•--
--| |--|____|--- --•--
--|____|----------- --X--But I also can't figure out how to make those gates, at least not without the many-controlled-not gate I'm trying to make.
Is this even possible (the limited-to-classical case, not the exercise)?
Solution
It's not possible.
A reversible computation always corresponds to a permutation of the state space. When working on three bits, a Toffoli corresponds to a single swap in the state space (it swaps 111 for 110). When working on four or more bits, a Toffoli gate always corresponds to an even number of swaps in the state space. This is because it performs a swap for each possible state of the uninvolved bits, and there are an even number of such states. For example, a Toffoli applied to the first three bits of a four bit system swaps 111_0 for 110_0 and swaps 111_1 for 110_1. Even number of swaps.
Permutations have a parity. A permutation that can be implemented with an even number of swaps has even parity. Permutations that can be implemented with an odd number of swaps have odd parity. The composition of two even parity permutations will also be an even parity permutation. Odd parity permutations can't be reached by composing even parity permutations.
This means the Toffoli gate can't perform a CCCNOT without workspace, because the action of the CCCNOT on the state space is an odd parity permutation but the action of the Toffoli is an even parity permutation. The single CNOT and NOT gates have the same problem. You need an extra work bit (or quantum gates like $X^{1/8}$) to break the parity barrier.
A reversible computation always corresponds to a permutation of the state space. When working on three bits, a Toffoli corresponds to a single swap in the state space (it swaps 111 for 110). When working on four or more bits, a Toffoli gate always corresponds to an even number of swaps in the state space. This is because it performs a swap for each possible state of the uninvolved bits, and there are an even number of such states. For example, a Toffoli applied to the first three bits of a four bit system swaps 111_0 for 110_0 and swaps 111_1 for 110_1. Even number of swaps.
Permutations have a parity. A permutation that can be implemented with an even number of swaps has even parity. Permutations that can be implemented with an odd number of swaps have odd parity. The composition of two even parity permutations will also be an even parity permutation. Odd parity permutations can't be reached by composing even parity permutations.
This means the Toffoli gate can't perform a CCCNOT without workspace, because the action of the CCCNOT on the state space is an odd parity permutation but the action of the Toffoli is an even parity permutation. The single CNOT and NOT gates have the same problem. You need an extra work bit (or quantum gates like $X^{1/8}$) to break the parity barrier.
Context
StackExchange Computer Science Q#40864, answer score: 3
Revisions (0)
No revisions yet.