# How to specify the CNOT gate direction (control qubit to target qubit) in Qiskit?

If I act a CNOT gate on quantum circuit:

from qiskit import QuantumCircuit
qc = QuantumCircuit(2, 2)
qc.cx(0, 1)


it means that qubit_0 is the control qubit, and qubit_1 is the target qubit. And if I switch 0 and 1, it means that qubit_1 is the control qubit, and qubit_0 is the target qubit.

But I remember that the CNOT gate is a one-direction gate, which means that one of the case would be the same as the other one but with some hadamard gates acting before and after it on the real device.

So, what I would like to ask is that:
"How can I specify which is the one that would not act other gates when executing on the real device."

I had also checked for the coupling_map:

backend.configuration().coupling_map


and it returns both [0, 1] and [1, 0]

I'm not sure which is the one that won't act other hadamard gates, or is the real devices of IBMQ now support both kinds of CNOT operation?

Or, (I'm guessing) the smaller index would be the control qubit?

• Hello! I don't think I really understand your question, could you add an example to show what you mean? – met927 Dec 3 '19 at 9:15
• Hi! You can maybe rephrase your question to make it clearer. I understood it as "I do not want additional H gates in my circuit, how can I know the 'hardware orientation', i.e. the natural way of performing a CNOT in the hardware". In addition to this, could you provide information on the backend you used? The double connectivity (presence of [0,1] and [1,0] in the coupling map) is not present on Melbourne, but is present in essex for example. – Nelimee Dec 3 '19 at 10:11
• @Nelimee thanks for your comment. The backend I tested is not an open device. – Huang Yi Te Dec 3 '19 at 12:34