Error mitigation functions taking batches of circuits #2656
Labels
feature-request
A request for a feature, tool, or workflow in Mitiq.
needs/agreed-design
Needs a plan of action that is agreed upon to complete.
Issue Description
At the moment, Mitiq's users can apply error mitigation functions only to a single circuit, e.g.,
zne.execute_with_zne(circuit: QPROGRAM, ...)
.Proposed Solution
The proposal here is to allow users to apply error mitigation functions to a list of circuits instead, e.g.,
The idea is that such a function would return
n
expectation values (one for each of the input circuits), each estimated with the QEM technique at hand (zne
in the example.)Why?
The idea is to modify how those functions work under the hood, so that the intermediate circuits coming from all the qem execution calls of the circuits are batched together, and are sent as a batch to the executor (and eventually to the backend). This will improve the time of dispatching and executing jobs for those backend devices that support batch jobs.
Example
Let's consider the simplest non-trivial case of running ZNE on two circuits$2$ , and let's see what would happen under the hood when running
circuit1, circuit2
with a scale factor ofzne.execute_with_zne([circuit1, circuit2], ...)
after this feature is implemented.Let's say
circuit1_a, circuit1_b
andcircuit2_a, circuit2_b
are the intermediate circuits that are generated by ZNE.Then the full batch of 4 circuits
[circuit1_a, circuit1_b, circuit2_a, circuit2_b]
is sent to the backend, and the results are mapped back to the extrapolation functions in order to produce 2 expectation values. This is beneficial since most of the backends can optimize batch execution of circuits.Note
Mitiq already supports batch execution of the intermediate circuits generated by error mitigation of a single circuits, see https://mitiq.readthedocs.io/en/stable/guide/executors.html#batched-execution (mind the difference with what this feature request is about.)
Additional References
Discord thread with Sanket at https://discord.com/channels/764231928676089909/1331001652928446665
Old discussion (with @andreamari) on the topic: #1460
The text was updated successfully, but these errors were encountered: