# How to generate the Bell state $\frac{1}{\sqrt{2}}(|01\rangle+|10\rangle)$ from the state $|00\rangle$ using Qiskit?

I want to generate the Bell state $$(|01\rangle+|10\rangle)/\sqrt{2}$$ from the state $$|00\rangle$$ in qiskit, applying the Hadamard gate followed by the $$\text{CNOT}$$ gate.

But it generates $$(|11\rangle-|00\rangle)/\sqrt{2}$$. What is the problem?

sv1 = Statevector.from_label('01')
mycircuit1 = QuantumCircuit(2)
mycircuit1.h(0)
mycircuit1.cx(0,1)
new_sv1 = sv1.evolve(mycircuit1)
print(new_sv1)
plot_state_qsphere(new_sv1.data)


Qiskit uses little-endian ordering for both classical bits and qubits. So, the least significant bit (LSB) is the rightmost bit in the binary representation of numbers. That means, you should use

sv1 = Statevector.from_label('10')


sv1 = Statevector.from_label('01')


For more details, see the documentation.

The Bell state $$\frac{1}{\sqrt{2}}(|01\rangle + |10\rangle)$$ can be generated from $$|00\rangle$$ in Qiskit as follows:

from qiskit import QuantumCircuit
from qiskit.quantum_info import Statevector


Regarding your code, I see two possible issues for which I included in-line comments in my code. The first issue is that you are starting with $$|01\rangle$$ instead of $$|00\rangle$$. The second issue is that if you start with $$|00\rangle$$, then the $$H$$ and $$CX$$ gates are not enough. You also need an $$X$$ gate at the end.