# Bell State 11 not working for parity curve

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?

• Thanks for the question. Could you explain what phi is in your program? Jun 18 '19 at 12:35
• @JamesWootton Thanks for the reply. The u3 gate needs 4 arguments, as far as I could work out they are rotations around the x, y and z axis respectively plus the 4th argument being the quantum register. If that is correct (which I'm not 100% sure about), that would mean phi is rotation around the z axis. This is the qiskit documentation of the u3 gate. The matrix equation for the gate is shown in the paper linked at the top. Jun 18 '19 at 13:26
• Ah, sorry. I mean phi_value. The thing you loop over Jun 18 '19 at 14:21
• @JamesWootton No worries, phi_value loops through phi_range, which is just a array of (in this case 128) numbers between 0 and pi. It later allows me to create a nice evenly spaced plot of the parity at the corresponding phi_value. Jun 18 '19 at 15:36