'2 entangle qubit gives all states with 25 %

We entangle two quarks; after measurement gives either |01> or |10> with probability of 50%.(regardless of their prior states ,they always give opposite states)

when I entangle 2 qubits using Cnot it gives |00> ,|01> ,|10> ,|11> all with 25% probability. why???

enter image description here



Solution 1:[1]

The circuit you created is actually doing this: first, applying Hadamard gates to |00> will create the state 1/2(|00>+|01>+|10>+|11>). Then, applying the C-NOT will make |01> to |11> and |11> to |01> (normally |10> to |11> and |11> to |10> with textbook's convention but the Qiskit's convention makes it the other way), therefore your state actually is the same, that's why you get the 25% probability for each. I hope it is clear enough!

Solution 2:[2]

Let's consider the 2-qubit system where we are applying Hadamard operator to both the qubits and then a CNOT (with the first qubit as the control bit).

enter image description here

With qiskit we can simulate the above system as shown in the code below and see that the results are as per our expectation (the output system is uniform superposition of 4 states with equal probability).

from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram

qc = QuantumCircuit(2)
qc.h(0)  # |0> -> |+>
qc.h(1)  # |0> -> |+>
qc.cx(0,1)
qc.draw()

enter image description here

backend = Aer.get_backend('statevector_simulator')
plot_histogram(execute(qc,backend).result().get_counts())

enter image description here

In order to get the desired states we need to apply a Hadamard gate (H) to the first qubit, a NOT (X) gate to the 2nd qubit and then apply CNOT to have desired entangled states (Bell State):

enter image description here

Simulating the above with qiskit:

qc = QuantumCircuit(2)
qc.h(0)  # |0> -> |+>
qc.x(1)  # |0> -> |1>
qc.cx(0,1)
qc.draw()

enter image description here

plot_histogram(execute(qc,backend).result().get_counts())

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Lena
Solution 2