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?
$\begingroup$
$\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$– Martin VeselyCommented Nov 26, 2019 at 12:14
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
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.
And after that simulate (to get the answer):
I hope I've helped.