The cheatsheet page of the documentation for CNOT says the following
qc.cnot(condition_qubit, target_qubit)
Applies the CNOT operation between two qubits. Takes two arguments condition_qubit and target_qubit. The first argument (condition_qubit) specifies the qubit whose value will determine whether or not a NOT operation is applied to the target_qubit specified in the second argument.
Example:qc.cnot(0x4, 0x2)
but the following code produces the opposite result
qc.reset(2);
var a = qint.new(1, 'a');
var b = qint.new(1, 'b');
qc.write(0);
a.had();
qc.cnot(a,b);
Here's the resulting circuit diagram:
Which shows b as the condition_qubit and a as the target_qubit.
The cheatsheet page of the documentation for CNOT says the following
but the following code produces the opposite result
Here's the resulting circuit diagram:
Which shows b as the
condition_qubit
and a as thetarget_qubit
.