Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introductory tutorial on mid-circuit measurements #1094

Merged
merged 70 commits into from
May 10, 2024
Merged

Introductory tutorial on mid-circuit measurements #1094

merged 70 commits into from
May 10, 2024

Conversation

dwierichs
Copy link
Contributor

@dwierichs dwierichs commented May 7, 2024

Title:
Introduction to mid-circuit measurements

Summary:
In this tutorial, we will dive into the basics of mid-circuit measurements with PennyLane. Readers will learn about

  • basic measurement processes in quantum mechanics,
  • the impact of a measurement on one- and two-qubit systems,
  • postselection and qubit reset, and
  • dynamic quantum circuits powered by conditional operations.

Relevant references:
See demo references and related content, in particular tutorial_how_to_collect_mcm_stats and tutorial_how_to_create_dynamic_mcm_circuits.

Possible Drawbacks:

Related GitHub Issues:


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

  • GOALS — Why are we working on this now?
    This tutorial promotes mid-circuit measurement functionality in PennyLane, which has been extended in recent releases.
    In addition, this tutorial is part of the broader goal of emphasizing MCMs and dynamic circuits in our contents.

  • AUDIENCE — Who is this for?
    Beginners in PennyLane coding that want to learn about mid-circuit measurements

  • KEYWORDS — What words should be included in the marketing post?

    • Mid-circuit measurements
    • Measurements in quantum mechanics
    • Dynamic circuits
  • Which of the following types of documentation is most similar to your file?
    (more details here)

  • Tutorial
  • Demo
  • How-to

[sc-60838]

Copy link
Member

@josh146 josh146 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @dwierichs 😎 Have done a conditional approval!

demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
Copy link
Contributor

@ikurecic ikurecic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the message, @dwierichs !

I looked at it quickly and left some minor comments — this will be a useful short Demo to have, nice work.
Like I mentioned, if the marketing is already all arranged and this is going live today, then you'd just have to rebase so the merge goes to main instead of dev.

demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
demonstrations/tutorial_mcm_introduction.py Outdated Show resolved Hide resolved
@dwierichs dwierichs enabled auto-merge (squash) May 10, 2024 15:22
@dwierichs dwierichs merged commit d07f95c into dev May 10, 2024
10 checks passed
@dwierichs dwierichs deleted the mcm-tutorial branch May 10, 2024 15:30
dwierichs added a commit that referenced this pull request May 16, 2024
**Title:**
Introduction to mid-circuit measurements

**Summary:**
In this tutorial, we will dive into the basics of mid-circuit
measurements with PennyLane. Readers will learn about
- basic measurement processes in quantum mechanics,
- the impact of a measurement on one- and two-qubit systems,
- postselection and qubit reset, and
- dynamic quantum circuits powered by conditional operations.

**Relevant references:**
See demo references and related content, in particular
`tutorial_how_to_collect_mcm_stats` and
`tutorial_how_to_create_dynamic_mcm_circuits`.

**Possible Drawbacks:**

**Related GitHub Issues:**

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

* GOALS — Why are we working on this now?
This tutorial promotes mid-circuit measurement functionality in
PennyLane, which has been extended in recent releases.
In addition, this tutorial is part of the broader goal of emphasizing
MCMs and dynamic circuits in our contents.

* AUDIENCE — Who is this for?
Beginners in PennyLane coding that want to learn about mid-circuit
measurements

* KEYWORDS — What words should be included in the marketing post?
  - Mid-circuit measurements
  - Measurements in quantum mechanics
  - Dynamic circuits

* Which of the following types of documentation is most similar to your
file?
(more details
[here](https://www.notion.so/xanaduai/Different-kinds-of-documentation-69200645fe59442991c71f9e7d8a77f8))
    
- [x] Tutorial
- [ ] Demo
- [ ] How-to

---------

Co-authored-by: Guillermo Alonso-Linaje <[email protected]>
Co-authored-by: Thomas R. Bromley <[email protected]>
Co-authored-by: Korbinian Kottmann <[email protected]>
Co-authored-by: Josh Izaac <[email protected]>
Co-authored-by: Ivana Kurečić <[email protected]>
ikurecic added a commit that referenced this pull request May 16, 2024
#1094 was accidentally merged to `dev` instead of `master`. This PR
applies the squashed commit of #1094 to `master` as well.

Co-authored-by: Guillermo Alonso-Linaje <[email protected]>
Co-authored-by: Thomas R. Bromley <[email protected]>
Co-authored-by: Korbinian Kottmann <[email protected]>
Co-authored-by: Josh Izaac <[email protected]>
Co-authored-by: Ivana Kurečić <[email protected]>
@KetpuntoG KetpuntoG restored the mcm-tutorial branch May 16, 2024 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants