Is swap gate equivalent to just exchanging the wire of the two qubits?like this

if yes why not just switching the wire whenever we want to apply a swap gate?


2 Answers 2


Yes, it is equivalent. That's a perfectly valid way to represent it in a quantum circuit diagram.

In practice, it depends what physical implementation you're talking about. If you have 'flying' qubits, then it is possible to just reorder them, or even simply relabel them without actively doing anything. However, many physical implementations of quantum computation use static qubits. That means one particular physical qubit is in a particular place. If you want to make it interact (e.g. perform controlled-not) with another qubit, they usually have to be next to each other. That means performing swap operations along some path, exchanging the states of the qubits so that the state that was on one physical qubit is now on a different one, where you need it to be.


why not just switching the wire whenever we want to apply a swap gate?

If this is the crux of the question I think the main rationale here is to treat the swap gate as an actual gate.

I only rarely see raw swap gates on their own in diagrams, typically I see them as part of a Fredkin Gate. Basically, by treating it as a gate rather than a crossing of wires, it makes it easier to understand how it can be "controlled" like any other gate.

But yes, an un-controlled swap gate could be implemented on classical bits in electrical wires by swapping the wires' positions.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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