I am currently writing a script to automate the creation of parity curves for a 2 qubit bell state and then calculate fidelity and proving entanglement from that (inspired by this paper). It was going really well. I am able to run simulations perfectly for states 00 and its complement state 10 (getting fidelity values on ibmqx4 of roughly 0.7). Although, it then starts to get weird running states 11 and its complement 01. Although I haven't run state 01 on the real machine yet, the simulation of it runs perfectly. State 11 however, doesn't. As far as I understand 11 and 01 should output similar results. Here's a sample of my 01 states results.
10,471 11,40 00,43 01,440 10,490 11,51 00,54
As you can see, a variety of states come out, allowing me to calculate parity. Running exactly the same code with state 11 instead gives
10,471 01,498 10,526 01,528 10,496 01,514 10,510
which, obviously looks a lot more like a generic bell state with no rotation. The code used to set up the circuit and rotation for simulation is shown below. The math for theta, lam and phi for states 00 and 10 are taken from the paper mentioned above (on the second column of text on page 2). Math for states 11 and 01 are not on the paper but was worked out by my supervisor.
# Set range for rotation phi_range = np.linspace(0, np.pi, 128) for phi_value in phi_range: # inside the loop because putting it outside breaks it and makes it run # really really slow qr = QuantumRegister(2, name='qr') cr = ClassicalRegister(2, name='cr') bell = QuantumCircuit(qr, cr, name='bell') # Set the details of the rotation if startingState == '00' or startingState == '10': theta = np.pi/2 lam = -phi_value - np.pi/2 elif startingState == '01' or startingState == '11': theta = phi_value lam = 0 - np.pi/2 else: raise ValueError('Setting rotation problems') phi = -lam # initializing the starting state of the circuit (done separately to # above for clarity) if startingState == '01': bell.x(qr) elif startingState == '10': bell.x(qr) elif startingState == '11': bell.x(range(2)) # this is the bell state code itself bell.h(qr) bell.cx(qr, qr) bell.barrier() bell.u3(theta, lam, phi, qr) bell.barrier() bell.measure(qr, cr) bell.measure(qr, cr)
I have checked that this creates the correct circuit several times over, and again, it works for all states except 11. Can anyone work out why?