What's the point of a measurement operator?

2

I was experimenting with quantum circuits in IBM Quantum Experience. I know that the Hadamard gate creates superposition in the qubit, so I created the following circuit:

enter image description here

However, when I looked at the measurement probabilities, it looked like this:

enter image description here

I don't think this is supposed to be the case, as superposition distributes the probability of being 0 and 1. When I removed the measurement like this:

enter image description here

The measurement probability was:

enter image description here

What is the right way to create superposition? What is the point of the measurement operator?

Please excuse me if my questions are obvious, I'm new to quantum computing.

Akhilesh Balaji

Posted 2021-01-06T05:22:04.927

Reputation: 31

Question was closed 2021-01-08T13:44:13.407

Welcome to QCSE! My guess is that measurement collapses the state and for some reason software post-selects on the zero outcome. This is suggested by the zero on the c3 wire. – Adam Zalcman – 2021-01-06T05:41:28.293

Answers

2

It is true that the hadamard gate create the superposition state $\dfrac{|0\rangle + |1\rangle}{\sqrt{2}}$ when applied to the state $|0\rangle$, and you should see the state collapses to the state $|0\rangle$ or $|1\rangle$ upon measurement with 50% probability. That is, you should see something like this:

enter image description here

However, if you apply the measurement operator within the Circuit Composer within IBM Quantum Experience, then you might not experience this. That is, you will see that it always collapses to the state $|0\rangle$ instead. However, you can fix this issue by changing the Simulator seed within the composer as commented by @luciano in this related question here https://quantumcomputing.stackexchange.com/a/15367/9858.

enter image description here

By doing this, you will see that the state will collapse to $|1\rangle$ or $|0\rangle$.


Another work-around is to port your circuit to Qiskit Code and run it in Jupyter notebook using qasm_simulator. You can automatically create Qiskit code for your quantum circuit within the composer as follow:

enter image description here

Port the above code to Jupyter notebook in IBM Quantum Lab, then execute the following code:

from qiskit import BasicAer, execute
from qiskit.visualization import plot_histogram
%matplotlib inline
backend = BasicAer.get_backend('qasm_simulator')
job = execute(circuit, backend, shots = 1000)
plot_histogram(job.result().get_counts(), color='black', title="Result")

This will give you the probability plot I shown at the beginning.

KAJ226

Posted 2021-01-06T05:22:04.927

Reputation: 6 322