Qiskit – Practical open source framework for quantum computing
Quantum Error Mitigation
Quantum error mitigation paves the way for commercial use of quantum computers, and it is an important technique for using today's quantum computers without fault-tolerant qubits. Qiskit supports quantum error mitigation through the use of a correction matrix to improve the quality of the results. A simple example of measurement error mitigation will illustrate this technique.
A simpler form of noise can be generated by the final measurement in the circuit (Listing 6). At this point, one of the possible bit strings is extracted; this is not an exact process due to the noise caused by the measurement, among other things. Again the GHZ circuit is used as an example. You have already seen the simulation of a noise-free result. When run on a real quantum computer, the noise is clearly seen in the broader distribution, which includes probabilities of the incorrect states (Figure 6).
Listing 6
Plotting the Results
from qiskit.visualization import plot_histogram qdev = my_provider.get_backend( 'ibmq_lima' ) results = execute( qc, qdev, shots=10000 ).result() noisy_counts = results.get_counts() print( noisy_counts ) plot_histogram( noisy_counts )
In the simple case of an error-mitigation concept, the individual eight basic states resulting from the three qubits of the GHZ circuit are now traversed (Listing 7).
Listing 7
Traversing the Basic States
from qiskit.utils.mitigation import * qr = QuantumRegister( 2 ) meas_calibs, state_labels = complete_meas_cal( qr=qr, circlabel='mcal' ) for circuit in meas_calibs: print('Circuit',circuit.name) print(circuit) print()
As an example, Figure 7 shows three of the eight circuits. The correction matrix from Figure 8 can be calculated from the individual measurement results; this takes the deviations into account. This correction is then applied to the measurement results from the sample circuit (Listing 8). Figure 9 clearly shows that the measurement error mitigation method corrects the errors caused by noise in a very good way.
Listing 8
Create Correction Matrix
from qiskit.compiler import transpile, assemble t_qc = transpile( meas_calibs, qdev ) qobj = assemble( t_qc, shots=10000 ) cal_results = qdev.run( qobj, shots=10000 ).result() meas_fitter = CompleteMeasFitter( cal_results, state_labels, circlabel='mcal' ) array_to_latex( meas_fitter.cal_matrix ) # Get the filter object meas_filter = meas_fitter.filter # Results with mitigation mitigated_results = meas_filter.apply( results ) mitigated_counts = mitigated_results.get_counts() noisy_counts = results.get_counts() plot_histogram( [ noisy_counts, mitigated_counts ], legend=[ 'noisy', 'mitigated' ] )
Because the cost of additional measurements to determine the correction matrix grows exponentially with the number of qubits, this method has been further refined, resulting in effective error mitigation even if a larger number of qubits is used.
In Qiskit, this advanced method shows up in the output resulting from Sampler
primitives (quasi-probabilities). Again using the simple circuit for the GHZ state, the calculation with Sampler
on the non-noise free QASM simulator is shown in Listing 9. The almost uniform probability distribution of the two correct states is shown here in the quasi-probability distribution.
Listing 9
Refined Method
service = QiskitRuntimeService() with Sampler( circuits=[qc], service=service, options={ "backend": "ibmq_qasm_simulator" } ) as sampler: result = sampler( circuits=[0], shots=10000 ) print( result ) SamplerResult( quasi_dists=[{'000': 0.4944, '111': 0.5056}], metadata=['shots': 10000}] )
One focus of current research on quantum error mitigation is on more advanced, general-purpose methods. Zero-Noise Extrapolation (ZNE) and Probabilistic Error Cancellation (PEC) are both promising techniques. In ZNE, you work directly with noise amplification in the circuit; in PEC, you identify the noise using randomly selected instances of noisy circuits. A blog post by IBM Research on the utility value of these methods provides a more detailed overview [12].
Conclusions
Qiskit is the effort of a large community to make quantum computing technology understandable and applicable and get it ready for production. Community contributions, such as meetups or an annual summer school, are essential to the project's continued development. This article is intended as another example of how you can take your first steps in quantum computing.
Infos
- IBM Quantum Development Roadmap: https://research.ibm.com/blog/ibm-quantum-roadmap-2025
- Qiskit projects: https://qiskit.org/ecosystem/
- AQT: https://www.aqt.eu
- Qiskit Terra: https://github.com/Qiskit/qiskit-terra
- Grover's search algorithm: https://towardsdatascience.com/grovers-search-algorithm-simplified-4d4266bae29e
- VQE: https://grove-docs.readthedocs.io/en/latest/vqe.html
- QAOA:https://pennylane.ai/qml/demos/tutorial_qaoa_intro.html
- IBM Quantum Account: https://quantum-computing.ibm.com
- Qiskit Runtime: https://quantum-computing.ibm.com/lab/docs/iql/runtime/
- Quantum games instructions: http://fun-with-quantum.org
- Team Quantimize: https://quantimize.de
- IBM Research Blog: https://research.ibm.com/blog/gammabar-for-quantum-advantage
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Red Hat Adds New Deployment Option for Enterprise Linux Platforms
Red Hat has re-imagined enterprise Linux for an AI future with Image Mode.
-
OSJH and LPI Release 2024 Open Source Pros Job Survey Results
See what open source professionals look for in a new role.
-
Proton 9.0-1 Released to Improve Gaming with Steam
The latest release of Proton 9 adds several improvements and fixes an issue that has been problematic for Linux users.
-
So Long Neofetch and Thanks for the Info
Today is a day that every Linux user who enjoys bragging about their system(s) will mourn, as Neofetch has come to an end.
-
Ubuntu 24.04 Comes with a “Flaw"
If you're thinking you might want to upgrade from your current Ubuntu release to the latest, there's something you might want to consider before doing so.
-
Canonical Releases Ubuntu 24.04
After a brief pause because of the XZ vulnerability, Ubuntu 24.04 is now available for install.
-
Linux Servers Targeted by Akira Ransomware
A group of bad actors who have already extorted $42 million have their sights set on the Linux platform.
-
TUXEDO Computers Unveils Linux Laptop Featuring AMD Ryzen CPU
This latest release is the first laptop to include the new CPU from Ryzen and Linux preinstalled.
-
XZ Gets the All-Clear
The back door xz vulnerability has been officially reverted for Fedora 40 and versions 38 and 39 were never affected.
-
Canonical Collaborates with Qualcomm on New Venture
This new joint effort is geared toward bringing Ubuntu and Ubuntu Core to Qualcomm-powered devices.