processing between sequential executions

Regarding real quantum computers of IBM, can one execute a circuit that contains measurements and afterwards get counts and then, based on the results of measurements (from counts), decide if to build circuit A or circuit B that will be executed on the same quantum register with init_qubits=False and with use of rep_delay parameter, so that the chosen circuit, A or B will run on the quantum register with output state of the first circuit?

Currently (Feb 2021), no. The run/measure/condition/run loop needs to be handled on user-side and it is not possible to preserve the state of quantum register among runs.

However checkout the IBM Quantum Development Roadmap:

Jay Gambetta explains that in 2021 IBM will launch the Quantum Runtime. By bringing together classical and quantum computation on the server-side you should be able to run a Quantum Program that contains a similar logic to the one you are describing. However, you are interested in continuing a computation without reseting the quantum registers.

In 3:32 of the same video, Jay describes Dynamic Circuits. That's much closer to what you are searching for. Circuit with branching in them. They are planned for 2022.

If you are curious about how a Quantum Program might look like, check the OpenQASM3 specification draft: https://qiskit.github.io/openqasm/

Update (Feb 2021): In the direction towards dynamic circuit (and a positive answer to your question), today is possible to do mid-circuit measurements in the IBMQ backends.

Here, an example:

from qiskit import *

backend = provider.get_backend('ibmqx2')

circuit = QuantumCircuit(1,2)
circuit.h(0)
circuit.measure(0,0)
circuit.x(0)
circuit.measure(0,1)

display(circuit.draw('mpl'))

result = execute(circuit, backend).result()
visualization.plot_histogram(result.get_counts())


This allows you to continue the execution after measurement. Consider that the first measurement colapses the superposition to either 0 or 1. The X gate flips that first result and then it is saved in the second classical bit.

• Thanks a lot. But it sounds like it can be done now, but as you wrote, on the user side? And I wonder, how it can be done.
– AL_P
Feb 11 at 13:38
• because it is not possible to preserve the state of a quantum register among runs, it is not possible to do that on user-side. I updated the first paragraph to clarify that. Feb 11 at 13:44
• Thanks, but if I use init_qubits=False for the second circuit with a very small rep_delay parameter value, wouldn't it be possible to preserve the state? or that preserving state between executions is just completely impossible?
– AL_P
Feb 11 at 13:48
• the user-server-user cycle is way too long relative to the decoherence time. Decoherence destroys everything. The challenge is to bring CPU/QPU very closely (as is planned in the roadmap for 2022) to be able to classically compute inside the decoherence window. Feb 11 at 13:56