1
$\begingroup$

I just wanted to implement an algorithm for adding two 2-bit binary numbers. And it works, but only on an IBM 32-qubit simulator. And on a real 15-qubit computer, ibmq_16_melbourne, it produces very strange results. I don't understand what I'm doing wrong. Or maybe the quantum computer is so noisy?

Result_1

I also tried to rewrite the algorithm for the structure of this computer, so that the qubits used in one operation are connected or are quite close.

ibm circuit_2

But it didn't help.

About the algorithm: qubits 0-2 are the result. Qubits 3-4 are the first number. Qubits 5-6 are the second number. The remaining qubits play the role of transfer flags. I set qubits 3 and 5 to one using the NOT operation (I didn't understand how to apply units to them in another way). So at the output of the algorithm, I should get "010". But I get basically a different result. circuit

$\endgroup$

1 Answer 1

4
$\begingroup$

There will be a lot of swapping and additional gates during the execution of your circuit since CCX is not a native gate. The actual circuit that is being executed is something like:

enter image description here

This circuit has 11 qubits and depth of 79 and close to 100 CNOT gates, this is way too much for current hardware. Below is the noise level for Melbourne.

enter image description here

$\endgroup$
1
  • $\begingroup$ Thanks for the answer! Is it possible to develop an algorithm (circuit) for adding two 2-bit binary numbers so that it works correctly on 15-qubit IBM Melbourne? $\endgroup$
    – alexhak
    Apr 16, 2021 at 19:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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