I simulated the circuit below in qiskit and used the statevector simulator to extract the statevector:

quantum circuit

The resulting statevector that it gave me was:

array([ 0.5+0.j, -0.5+0.j, 0.5+0.j, 0.5+0.j])

The problem here is that it is assigning a minus sign to the second component which is for the state |01>, while it should actually assign the minus sign to the third component, which is for the state |10>, so I was expecting to get instead:

array([ 0.5+0.j, 0.5+0.j, -0.5+0.j, 0.5+0.j])

Can anyone help to clarify this. I was using qiskit for statevector simulation and need to check this.


C. Pedro

  • 3
    $\begingroup$ When I work out the math, I get the statevector with the negative being in $|01\rangle$ component. Your confusion may be caused by the qubit ordering in Qiskit. Qiskit uses a LSB ordering, meaning the first qubit is all the way to the right. For example, a state of $|01\rangle$ would mean the first qubit is 1 and the second qubit is 0. $\endgroup$ Jul 22 '19 at 20:06
  • $\begingroup$ What is the initial state of the qubits? $\endgroup$
    – Aman
    Jul 22 '19 at 20:10
  • 2
    $\begingroup$ Thanks, @MatthewStypulkoski that's it, I was working with the reverse ordering, first qubit all the way to the left, and so on. The initial state Aman was |00>. $\endgroup$ Jul 22 '19 at 21:00

Your Answer

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

Browse other questions tagged or ask your own question.