PennyLaneAI / qml

Introductions to key concepts in quantum programming, as well as tutorials and implementations from cutting-edge quantum computing research.
https://pennylane.ai/qml
Apache License 2.0
517 stars 183 forks source link

[MCM 1/3] How-to: Statistics of mid-circuit measurements #1066

Closed dwierichs closed 3 months ago

dwierichs commented 3 months ago

Title: How to collect statistics of mid-circuit measurements

Summary: PennyLane supports mid-circuit measurements not only to create dynamic circuits with control flow using the measurement results, but also supports a wide range of postprocessing options of the measured values. This how-to explains the usage of qml.measure and briefly compares qml.defer_measurements and qml.dynamic_one_shot. Then it shows how (not) to measure qubit correlations with MCMs, and afterwards walks through the supported postprocessing of MCM values and the allowed return functions such as qml.expval or qml.counts. Finally, ____ is shown as an application for obtaining statistics of MCMs.

Relevant references: N/A

Possible Drawbacks: N/A

Related GitHub Issues: N/A


If you are writing a demonstration, please answer these questions to facilitate the marketing process.

This how-to promotes mid-circuit measurement functionality in PennyLane, which has been extended in recent releases. In particular, it contains a comparison of the brand-new native MCM support via dynamic_one_shot with defer_measurements and can serve to advertise this new feature.

In addition, this how-to is part of the broader goal of emphasizing MCMs and dynamic circuits in our contents.

Typical how-to audience: Fundamental concepts of measurements and quantum computing are known, but the audience may not yet be familiar with PennyLane's syntax for MCMs and returning their outcomes, or they may want to consult this how-to as a reference of how to realize their circuit with MCMs. Anyone really with the goal of coding up a circuit that returns MCM values can be in the audience.

[sc-60836]

github-actions[bot] commented 3 months ago

👋 Hey, looks like you've updated some demos!

🐘 Don't forget to update the dateOfLastModification in the associated metadata files so your changes show up on pennylane.ai.

Please hide this comment once the field(s) are updated. Thanks!

github-actions[bot] commented 3 months ago

Thank you for opening this pull request.

You can find the built site at this link.

Deployment Info:

Note: It may take several minutes for updates to this pull request to be reflected on the deployed site.