I'm encountering a problem in my Qiskit simulation involving W-state entanglement. The issue arises when attempting to measure all three qubits in the X measurement basis. Surprisingly, the entanglement breaks and this behavior is consistent even when running the code on a real quantum device.
import numpy as np
# Define a F_gate
def F_gate(circ, q, i, j, n, k):
theta = np.arccos(np.sqrt(1/(n-k+1)))
circ.ry(-theta, q[j])
circ.cz(q[i], q[j])
circ.ry(theta, q[j])
circ.barrier(q[i])
# Define the cxrv gate which uses reverse CNOT instead of CNOT
def cxrv(circ, q, i, j):
circ.h(q[i])
circ.h(q[j])
circ.cx(q[j], q[i])
circ.h(q[i])
circ.h(q[j])
circ.barrier(q[i], q[j])
# Define the flag_qx2 variable
flag_qx2 = True # Set it to True or False based on your requirements
singlet = QuantumCircuit(qr, cr)
singlet.x(qr[2]) # start is |100>
F_gate(singlet, qr, 2, 1, 3, 1) # Applying F12
F_gate(singlet, qr, 1, 0, 3, 2) # Applying F23
if flag_qx2: # option ibmqx2
singlet.cx(qr[1], qr[2]) # cNOT 21
singlet.cx(qr[0], qr[1]) # cNOT 32
else: # option ibmqx4
cxrv(singlet, qr, 1, 2)
cxrv(singlet, qr, 0, 1)
for i in range(3):
singlet.h(qr[i]) # Apply Hadamard gate for X basis
singlet.measure(qr[i], cr[i])
The problem seems to be related to measuring in the X basis. When measuring in the Z basis, the W state is correctly obtained which is |001>, |010>, |001>. However, measuring in the X basis results in the breakdown of entanglement and gives a significant state of |000>, |011>, etc.
I appreciate any insights or suggestions on how to address this issue and preserve entanglement during X-basis measurements.
I attempted to simulate a quantum circuit using Qiskit, specifically focusing on a W-state entanglement scenario. The goal was to measure all three qubits in the X measurement basis. I expected that the entanglement would be preserved, as observed when measuring in the Z basis. However, the actual result was a breakdown of entanglement during X-basis measurements. This behavior persisted when running the code on both the simulator and a real quantum device. I am seeking insights or suggestions on how to address this issue and maintain entanglement in the X basis measurements.
NOTE: I know the W state is not a single state rather it can be seen as a Triplate.