Show that Cx = 00 ⊗ I + 1 1 ⊗ XBuild the Swap gate from three Cx note
To show that Cx = |0><0| ⊗ I + |1><1| ⊗ X, we can use the fact that Cx is the controlled-X gate, which applies the X gate to the target qubit if the control qubit is in state |1>, and leaves the target qubit unchanged if the control qubit is in state |0>.
Let's denote the control qubit as C and the target qubit as T. We can express the Cx gate as:
Cx = |0><0| ⊗ I + |1><1| ⊗ X
To build the Swap gate using three Cx gates, we can follow the steps below:
- 
Initialize three qubits labeled as A, B, and C.
 - 
Apply the first Cx gate with the control qubit A and the target qubit B:
 
CxA: |0><0| ⊗ I + |1><1| ⊗ X
- Apply the second Cx gate with the control qubit B and the target qubit C:
 
CxB: |0><0| ⊗ I + |1><1| ⊗ (|0><0| ⊗ I + |1><1| ⊗ X) = |0><0| ⊗ I + |1><1| ⊗ (|0><0| ⊗ I) + |1><1| ⊗ (|1><1| ⊗ X)
Simplifying the above expression, we have:
CxB: |0><0| ⊗ I + |1><1| ⊗ (|0><0| ⊗ I) + |1><1| ⊗ X
- Apply the third Cx gate with the control qubit A and the target qubit B:
 
CxA: |0><0| ⊗ I + |1><1| ⊗ (|0><0| ⊗ I + |1><1| ⊗ X)
Expanding the above expression, we have:
CxA: |0><0| ⊗ I + |1><1| ⊗ |0><0| ⊗ I + |1><1| ⊗ |1><1| ⊗ X
Now, we can see that the expression for the third Cx gate matches the expression for the first Cx gate. Hence, we can replace the third Cx gate with the first Cx gate:
CxA: |0><0| ⊗ I + |1><1| ⊗ |0><0| ⊗ I + |1><1| ⊗ |1><1| ⊗ X = |0><0| ⊗ I + |1><1| ⊗ X
Therefore, by using three Cx gates, we can build the Swap gate
原文地址: https://www.cveoy.top/t/topic/iBGy 著作权归作者所有。请勿转载和采集!