# Qiskit: Understanding statevector output

I am looking for some help in understanding the state vector output. I am studying myself and found some exercise online. Below question is from one of those exercises - Given two qubits. Both of them are in 0 state. Using the single-qubit gates, turn them into |+> state and |-> state respectively.

from qiskit import QuantumCircuit, execute, Aer, assemble, QuantumRegister, ClassicalRegister

qc = QuantumCircuit(2, 2)
qc.h(0)
qc.measure(0, 0)

qc.x(1)
qc.h(1)
qc.measure(1, 1)
qc.draw(output="mpl") svsim = Aer.get_backend('aer_simulator')
qc.save_statevector()
qobj = assemble(qc)
final_state = svsim.run(qobj).result().get_statevector(decimals=3)

from qiskit.visualization import array_to_latex
array_to_latex(final_state, prefix="\\text{Statevector} = ")


Output: Statevector=[0 0 −1 0]

Upon plotting on bloch sphere, I get below - It is my understanding that state vectors are amplitudes. So, how is qubit0 state is 0 and same for qubit 1.

Thanks!

• You can also try to see if the Bloch sphere has another case once these two quanta are entangled, perhaps ..... Jul 18 at 10:37
• There is no entanglement as they are single qubit gates. Jul 18 at 16:05

This is circuit is easy to analyse. H gate on qo will result in a + state. The x gate on q1 puts 1 to 1 state. Next te Hgate on q1 will put q1 in the - state. In the circuit measurementgates are used and therefore the output will collapse to 1 and -1. Measurement gates are only needed for measuring counts.

from qiskit import QuantumCircuit, execute, Aer, assemble, QuantumRegister, ClassicalRegister

qc = QuantumCircuit(2, 2) qc.h(0) #qc.measure(0, 0)

qc.x(1) qc.h(1) #qc.measure(1, 1) qc.draw(output="mpl")

plot_bloch_multivector(final_state) • Thanks a lot! This was very helpful to understand. :-) Jul 19 at 13:04