qiskit.circuit.QuantumCircuit.swap¶
- QuantumCircuit.swap(qubit1, qubit2)[Quellcode]¶
Apply
SwapGate
.For the full matrix form of this gate, see the underlying gate documentation.
- Parameter
qubit1 (
Union
[Qubit
,QuantumRegister
,int
,slice
,Sequence
[Union
[Qubit
,int
]]]) – The qubits to apply the gate to.qubit2 (
Union
[Qubit
,QuantumRegister
,int
,slice
,Sequence
[Union
[Qubit
,int
]]]) – The qubits to apply the gate to.
- Rückgabetyp
- Rückgabe
A handle to the instructions created.