-4
$\begingroup$

I have composed the gate with IBM Q Experience, but I do not know how to set the answer.
Please tell me how to set it?

$\endgroup$
1
  • 1
    $\begingroup$ What do you mean by answer? Do you mean a measurement? Please add a figure of your circuit or QASM code to better understand what you are looking for. Thanks. $\endgroup$ Commented Nov 26, 2019 at 12:14

1 Answer 1

2
$\begingroup$

I think this should help:

circuit.measure([0,1,2,3], [0,1,2,3,4,5])

for 4 qubits.

The secret number = '1001' for the circuit below:

NOTE the xor gates "cx" in qbit 0 and 3 are because it is 1 on the first and last bit of the secret number.

enter image description here

And after that simulate (to get the answer):

enter image description here

I hope I've helped.

$\endgroup$

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