Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.31k stars 2.38k forks source link

IBM Q Simulator Allows Gates After Measure #700

Closed wca-123 closed 6 years ago

wca-123 commented 6 years ago

Informations

What is the current behavior?

I noticed that IBM Q's ibmq_qasm_simulator allows for gates after a measure while IBM Q's actual quantum computers do not. I think that maybe if the simulator had a code so that it blocked this, the simulator could be more realistic.

Steps to reproduce the problem

What is the expected behavior?

I expected that it would return an issue in the simulator.

Suggested solutions

nonhermitian commented 6 years ago

Gates after a measurement is allowed in openQASM. However, it is not really a good thing to do on the current hardware, so it is disabled. Future hardware will allow this.

jaygambetta commented 6 years ago

We want the simulator to add for the future directions.

wca-123 commented 6 years ago

May I ask why this isn't a good thing to do on current hardware? Is it because a measurement would collapse the superposition and thus is irreversible?

nonhermitian commented 6 years ago

It takes some time for the current hardware to reset after a measurement. The other gates would have to wait for this to happen, and thus we wish to avoid this for now.

jaygambetta commented 6 years ago

Because if you entangle before the measurement allows you to learn a bit about the state without fully collapsing the wave function. The qubit measured will be in a classical state but the entangled ones will still have some information left in them.