Using debiasing with Qiskit
Learn how to use IonQ’s error mitigation techniques with Qiskit
Introduction
IonQ’s default error mitigation strategy is debiasing, a compiler-level error mitigation strategy that works by creating and running many symmetric variations of a given circuit. Results from the different circuit executions are aggregated to minimize the impact of some types of noise. Aggregation is performed via averaging and via sharpening (plurality voting) and the aggregated results from either strategy can be retrieved, depending on the specific application. This technique is very general and doesn’t require additional shot or qubit overhead.
This guide covers when debiasing is applied, how to enable or disable debiasing when submitting a job via Qiskit, and how to retrieve results with averaging or sharpening via Qiskit. For more details about this technique and how it works, refer to our debiasing and sharpening guide.
Error mitigation defaults
For jobs submitted to IonQ QPUs via the IonQ cloud, debiasing is enabled by default for jobs with 500 or more shots, but it can be disabled (as shown below). It is not used for jobs with fewer than 500 shots, and cannot be enabled - at least 500 shots are required in order to obtain a significant number of results for each circuit execution variant.
These default settings and shot cutoffs apply for jobs submitted directly to the IonQ cloud platform, and they may be different for jobs submitted via our cloud partners.
Debiasing is not currently available for jobs run via IonQ’s simulators, including our noisy simulators.
Specifying the debiasing settings
To explicitly specify the debiasing setting for a job, we need to:
- Import
ErrorMitigation
fromqiskit_ionq
- Pass either
error_mitigation=ErrorMitigation.DEBIASING
orerror_mitigation=ErrorMitigation.NO_DEBIASING
when callingbackend.run()
In this example, we’ll disable debiasing for a job with 1000 shots (where it would be enabled by default).
Retrieving and aggregating results
After a job is run with debiasing, there are two options for aggregating the results over the different symmetric variants. You can read more about component-wise averaging, sharpening via plurality voting, and which one to choose in our debiasing guide.
Component-wise averaging computes the mean probabilities over all circuit variants, which preserves the measured probability distribution. This is the default aggregation method used when retrieving the results of a job. Once you have a job (either one that you just submitted, or one retrieved using the job ID and backend.retrieve_job(job_id)
), just get the counts.
The above example might give something like:
Note that job.result().get_counts()
and job.result(sharpen=False).get_counts()
are equivalent.
Sharpening via plurality voting is a different aggregation strategy which takes the highest-probability result from each variant. For circuits where you’re trying to identify one or a few high-probability states, debiasing and sharpening can greatly improve the result quality.
For this example, the sharpened result looks like:
The QPU result included a few measurements of the 10
and 01
states, which can only occur due to error. These were included when the results were aggregated by averaging. However, when sharpening was used, we counted only the highest-probability state from each circuit variant that was run, and these states were always either 00
or 11
.
Additional resources
- Full guide to debiasing and sharpening
- Enhancing quantum computer performance via symmetrization on arXiv (symmetrization is another term for debiasing)
Was this page helpful?