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
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.