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' ] )
![](/var/linux_magazin/storage/images/issues/2022/265/qiskit/figure-7/812946-1-eng-US/Figure-71_large.png)
![](/var/linux_magazin/storage/images/issues/2022/265/qiskit/figure-8/812949-1-eng-US/Figure-81_large.png)
![](/var/linux_magazin/storage/images/issues/2022/265/qiskit/figure-9/812952-1-eng-US/Figure-91_large.png)
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.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.