PennyLane
  • Why PennyLane
  • Getting Started
  • Documentation
  • Ecosystem
Install
Install
  1. Blog/
  2. Announcements/
  3. Error mitigation with Mitiq and PennyLane

November 29, 2021

Error mitigation with Mitiq and PennyLane

We are excited to announce that PennyLane is now integrated with Mitiq, a software toolkit from the Unitary Fund for mitigating errors on quantum hardware. You can now bring error mitigation to noisy circuits in PennyLane! 📢🚫

Mitiq and PennyLane

If you have ever run a circuit on current quantum hardware, you’ll have noticed a significant amount of noise in your results. Although the long-term plan of quantum computing is to work towards error-corrected hardware, we still need to get the most out of today’s devices. The goal of error mitigation is to minimize the effects of noise by executing a family of related circuits on hardware and using the results to estimate an error-free value.

As of version 0.19 of PennyLane and version 0.11 of Mitiq, you can now get to grips with error mitigation in PennyLane with Mitiq as a backend. The easiest way to get started is through the mitigate_with_zne circuit transform, which provides access to the zero-noise extrapolation (ZNE) method of error mitigation. If you have a noisy device dev_noisy, a mitigated circuit can be constructed by simply adding the mitigate_with_zne decorator:

import pennylane as qml from mitiq.zne.scaling import fold_global as folding from mitiq.zne.inference import RichardsonFactory extrapolate = RichardsonFactory.extrapolate scale_factors = [1, 2, 3] n_wires = 4 @qml.transforms.mitigate_with_zne(scale_factors, folding, extrapolate) @qml.qnode(dev_noisy) def circuit(w1, w2): qml.SimplifiedTwoDesign(w1, w2, wires=range(n_wires)) return qml.expval(qml.PauliZ(0))

Now executions of circuit will be error-mitigated automatically! The code above leverages the fold_global and RichardsonFactory functionality available in Mitiq.

If you’d like to know more, you can check out our error mitigation demo to gain a greater understanding of how things work behind the scenes. This demo also showcases the use of error mitigation for a more practical task in quantum chemistry: calculating the potential energy surface of molecular hydrogen.

mitigation_qchem

As showcased in this plot, error mitigation lets us get closer to the ideal noise-free surface. 👨‍🔬🧪⚗️👍

The Mitiq and PennyLane teams will keep working to make error mitigation as easy as possible. Let us know about your experiences and we’ll be happy to help!

About the author

Last modified: August 06, 2024

Related Blog Posts

PennyLane

PennyLane is an open-source software framework for quantum machine learning, quantum chemistry, and quantum computing, with the ability to run on all hardware. Built with ❤️ by Xanadu.

Stay updated with our newsletter

For researchers

  • Research
  • Features
  • Demos
  • Compilation
  • Datasets
  • Performance
  • Learn
  • Videos
  • Documentation
  • Teach

For learners

  • Learn
  • Codebook
  • Teach
  • Videos
  • Challenges
  • Demos
  • Compilation
  • Glossary

For developers

  • Features
  • Documentation
  • API
  • GitHub
  • Datasets
  • Demos
  • Compilation
  • Performance
  • Devices
  • Catalyst

© Copyright 2025 | Xanadu | All rights reserved

TensorFlow, the TensorFlow logo and any related marks are trademarks of Google Inc.

Privacy Policy|Terms of Service|Cookie Policy|Code of Conduct