2
$\begingroup$

I have the following circuit which consists of symmetric modules. I compiled the circuit in IBM Quantum experience backend - ibmq_qasm_simulator, 8192 shots. The result is not equiprobable. Why? Since this is not a real machine ideally I should get same probability of 16.67%.

figure results

OPENQASM 2.0;
include "qelib1.inc";

qreg qA[8];
qreg qB[8];
qreg qC[6];
qreg qD[6];
creg c[4];

h qA[2];
h qA[4];
x qA[6];
x qA[7];
x qB[1];
h qB[2];
h qB[4];
x qB[6];
x qB[7];
h qC[0];
h qC[2];
x qC[4];
x qC[5];
h qD[0];
h qD[2];
x qD[4];
x qD[5];
cx qA[2],qA[3];
cx qA[4],qA[5];
h qA[6];
cx qB[2],qB[3];
cx qB[4],qB[5];
h qB[6];
cx qC[0],qC[1];
cx qC[2],qC[3];
h qC[4];
cx qD[0],qD[1];
cx qD[2],qD[3];
h qD[4];
cx qA[6],qA[7];
cx qB[6],qB[7];
cx qC[4],qC[5];
cx qD[4],qD[5];
x qA[0];
ccx qA[6],qA[0],qA[4];
ccx qB[6],qB[0],qB[4];
ccx qA[7],qA[1],qA[5];
ccx qB[7],qB[1],qB[5];
x qA[6];
x qA[7];
x qB[6];
x qB[7];
ccx qA[6],qA[0],qA[2];
ccx qB[6],qB[0],qB[2];
ccx qA[7],qA[1],qA[3];
ccx qB[7],qB[1],qB[3];
cx qA[2],qA[3];
cx qA[4],qA[5];
cx qB[2],qB[3];
cx qB[4],qB[5];
ccx qA[3],qC[4],qC[2];
ccx qB[3],qC[5],qC[3];
x qC[4];
x qC[5];
ccx qA[3],qC[4],qC[0];
id qA[5];
ccx qB[3],qC[5],qC[1];
id qA[5];
cx qC[0],qC[1];
cx qC[2],qC[3];
ccx qA[5],qD[4],qD[2];
ccx qB[5],qD[5],qD[3];
x qD[4];
x qD[5];
ccx qA[5],qD[4],qD[0];
ccx qB[5],qD[5],qD[1];
cx qD[0],qD[1];
cx qD[2],qD[3];
measure qC[1] -> c[3];
measure qC[3] -> c[2];
measure qD[1] -> c[1];
measure qD[3] -> c[0];
$\endgroup$
10
  • $\begingroup$ Are you able to check your expected result by running this on a statevector simulator? $\endgroup$
    – met927
    Commented Feb 25, 2020 at 14:49
  • $\begingroup$ I tested on IBM quantum experience ibmq_qasm_simulator backend. I do not have idea about "statevector simulator". $\endgroup$ Commented Feb 25, 2020 at 14:51
  • 1
    $\begingroup$ The statevector simulator will give you the final state vector of the circuit, you can load it by using statevector_simulator instead of qasm_simulator. This way you can check if your circuit is actually doing what you think it is $\endgroup$
    – met927
    Commented Feb 25, 2020 at 14:53
  • $\begingroup$ I am not able to find statevector_simulator in available backends (in quantum-computing.ibm.com). Where can I find that option? $\endgroup$ Commented Feb 25, 2020 at 14:59
  • $\begingroup$ Aer.get_backend('statevector_simulator') $\endgroup$
    – met927
    Commented Feb 25, 2020 at 15:15

1 Answer 1

0
$\begingroup$

enter image description hereYou might have an issue in your circuit. I believe the first X gate on line qB1 should actually be on line qB0 to be symmetric with the upper block.

Maybe you can also try to move those X gates just before the two controlled gates as they act on the first and third qubit you measure but not on the second and fourth ones (in descending order).

$\endgroup$
2
  • $\begingroup$ I guess that is not a problem. Even if I correct that, I am getting the same problem. $\endgroup$ Commented Feb 25, 2020 at 15:04
  • $\begingroup$ check my edited answer to see it that helps $\endgroup$ Commented Feb 25, 2020 at 15:21

Your Answer

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

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