# Why I am not getting approximate equiprobable states in the following circuit on IBM Q simulator?

Quantum Computing Asked on January 1, 2022

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%.

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];


You 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).

Answered by nathan raynal on January 1, 2022

## Related Questions

### Is there an error on Qiskit.org textbook with the superdense coding section?

1  Asked on March 7, 2021 by e-h

### Is there an efficient circuit implementing the unitary $U|xrangle|0rangle=|xrangleBig(sqrt{1 – x/2^n},|0rangle+sqrt{x/2^n}|1rangleBig)?$

0  Asked on March 7, 2021

### ProjectQ – Error messages

1  Asked on March 7, 2021 by marija-scekic

### Can quantum state tomography break bb84?

2  Asked on March 7, 2021

### Does applying the transformation $sumalpha_{jk}|j,f(k)ranglemapstosumomega_N^{-jk}alpha_{jk}|j,f(k)rangle$ require computing $f^{-1}$?

1  Asked on March 6, 2021

### What is the probability of finding the second qubit as $0$ in the state $|psirangle=frac1{sqrt2}|00rangle+frac12|10rangle-frac12|11rangle$?

1  Asked on March 5, 2021 by lizzo

### What is the computational complexity of quantum annealing?

2  Asked on March 4, 2021 by dr-prasanna-date

### What are the thermodynamic limits of Shor’s algorithm

1  Asked on March 3, 2021

### A CNOT between two Hadamard gates: why does the CNOT changed the output of the second Hadamard gate?

1  Asked on March 3, 2021 by devymex

### How many shots should one take to get a reliable estimate in a quantum program?

2  Asked on March 3, 2021

### Simple Hadamard Circuit gives incorrect results?

3  Asked on March 3, 2021

### What is the intuition behind Bures and angle metrics?

1  Asked on March 2, 2021

### Is the column vector of a uniformly sampled random unitary matrix a uniformly sampled random state vector?

2  Asked on March 1, 2021 by quantum-guy-123

### How to not optimize the quantum gates in a qiskit circuit when running it in the real device?

1  Asked on March 1, 2021

### Can’t access IBMQ (NameError: name ‘IBMQ’ is not defined)

1  Asked on March 1, 2021 by sangeetha-paulraj

### Why does full state reconstruction require at least $N+1$ MUBs?

1  Asked on February 28, 2021 by gls

### Problems with Q# installing

2  Asked on February 28, 2021 by brockenduck

### Obtaining hermitian matrix using Knill and Laflamme condition?

1  Asked on February 28, 2021 by m-al-jumaily

### Can quantum computers be used to solve P = NP

1  Asked on February 27, 2021 by peter-morgan