Swapping Qubit States

Initializing live version
Download to Desktop

Requires a Wolfram Notebook System

Interact on desktop, mobile and cloud with the free Wolfram Player or other Wolfram Language products.

Select the states for two qubits, and . The quantum circuit consisting of three CNOT gates swaps the states as time progresses from left to right to produce the output. The intermediate state after each CNOT gate is also displayed. Quantum wire coloring, unique for each qubit state, illustrates the changing qubit state. The dashed line indicates an entangled state, and the same coloring indicates common qubit state.

Contributed by: Brad Rubin (March 2011)
Open content licensed under CC BY-NC-SA



The three CNOT (Controlled NOT) gates each have a control input (the solid black circle) that affects the target input (the XOR symbol). If the control input is a , then the target output is the same as the target input. If the control input is a , then the target output is the target input inverted. The control input can also be in an entangled state, so it is both a and at the same time (something that can occur only in quantum, not classical, computing). The three gates, when placed in the serial arrangement shown in the diagram, will swap the states of the two input qubits as time progresses from left to right.

Reference: M. Nielsen and I. Chuang, Quantum Computation and Quantum Information, Cambridge, UK: Cambridge University Press, 2000.

Feedback (field required)
Email (field required) Name
Occupation Organization
Note: Your message & contact information may be shared with the author of any specific Demonstration for which you give feedback.