0
$\begingroup$

I'm using python qiskit==0.36.2.
The following code:

sv = Statevector.from_label('00')
mycircuit = QuantumCircuit(2)
mycircuit.h(0)
sv = sv.evolve(Operator(mycircuit))
print(sv.data)

Yeilds: [0.70710678+0.j 0.70710678+0.j 0. +0.j 0. +0.j]
Which doesn't make sense, because Hadamard on the first qubit (qubit 0) should be equal to $1/\sqrt(2)(|00\rangle+|10\rangle)$ yet the output I get corresponds to $1/\sqrt(2)(|00\rangle+|01\rangle)$.

I'm confused as to why this happens.
Thank you.

$\endgroup$

1 Answer 1

1
$\begingroup$

This is because Qiskit uses little-endian[1] for bit ordering. So, $|01\rangle$ means that first qubit in the state $|1\rangle$ and second qubit in the state $|0\rangle$.

For more details see the answers here, here, and here.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.