Skip to content

Add technique composability guide to core concepts (closes #2288)#2970

Open
Rachel-Eva wants to merge 2 commits into
unitaryfoundation:mainfrom
Rachel-Eva:docs/technique-composability-2288
Open

Add technique composability guide to core concepts (closes #2288)#2970
Rachel-Eva wants to merge 2 commits into
unitaryfoundation:mainfrom
Rachel-Eva:docs/technique-composability-2288

Conversation

@Rachel-Eva
Copy link
Copy Markdown

Description

Closes #2288

Adds a new composing-techniques.md page to the Core Concepts section of the user guide.

The page covers:

  • How ZNE acts as the outer framework in most compositions
  • Why techniques have different interfaces (REM's MeasurementResult, PT's N-to-1 flow)
  • When composing can backfire
  • A technique × noise model compatibility table
  • Worked examples for REM + ZNE, DDD + ZNE, PT + ZNE, and PT + DDD + ZNE

License

  • I license this contribution under the terms of the GNU GPL, version 3 and grant Unitary Foundation the right to provide additional permissions as described in section 7 of the GNU GPL, version 3.

Before opening the PR, please ensure you have completed the following where appropriate.

Copy link
Copy Markdown
Member

@natestemen natestemen left a comment

Choose a reason for hiding this comment

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

Thanks for kicking this off! I really like the discussion about technique interfaces and the comments about backfiring. I think the examples are unnecessary since that's what the examples gallery is for. I think we can replace those with links to tutorials that showcase the stacking options.

I think this page would also benefit from a table towards the top of the page that would allow someone to get an idea of which techniques can/cannot stack. I know this depends on whether an observable is being used and maybe a few other factors, but starting with two cases

  1. executor returns bitstrings, and
  2. executor returns expectation values

would be a great start.

- how ZNE acts as the outer framework in most compositions,
- why different techniques have different interfaces and what that means for composing them,
- worked examples for REM + ZNE, DDD + ZNE, PT + ZNE, and a three-technique combination.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a larger comment for this entire page, but also here: Let's not focus too heavily on ZNE here, even though our tutorial gallery does lean towards ZNE. This page should be about stacking two arbitrary techniques that are available in mitiq.

Comment on lines +68 to +72
**REM is different.** REM specifically targets errors that happen during *measurement* — the
readout stage. To correct those errors, it needs the raw measurement data (bitstrings) before
they are turned into an average. This is why an REM executor must return `MeasurementResult`,
not `float`. The mitigation math (applying the inverse confusion matrix) runs directly on those
raw counts. Only after that correction does REM hand a usable result upstream.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The statement that bitstrings are being averaged is incorrect. Please read the REM user guide: https://mitiq.readthedocs.io/en/stable/guide/rem-5-theory.html

Comment on lines +78 to +83
| Technique | `mitigate_executor`? | Executor must return | Returns |
|-----------|:--------------------:|----------------------|---------|
| ZNE | yes | `float` or `QuantumResult` + observable | `float` |
| REM | yes | `MeasurementResult` | `MeasurementResult` |
| DDD | yes | `float` or `QuantumResult` + observable | `float` |
| PT | no — manual loop | any | averaged `float` |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

What about the many other techniques?

Comment on lines +85 to +90
**PT has no `mitigate_executor` at all.** This is structural, not an oversight. Most techniques
follow a 1-to-1 or 1-to-N circuit flow that still ends in a single expectation value —
`mitigate_executor` handles that pattern automatically. PT is N-to-1: it requires generating
many random circuit variants, running all of them, and averaging the results to cancel out
coherent noise. That averaging loop cannot be hidden behind a single executor call, so PT always
requires a manual loop using `zne.construct_circuits` and `pt.generate_pauli_twirl_variants`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this is true. pt.generate_pauli_twirl_variants acts in the same way that xyz.construct_circuits does (1 to N).

extrapolating back to zero. That assumption only holds cleanly for incoherent, Markovian noise
that scales predictably with circuit depth. For coherent noise (systematic over-rotations), gate
folding amplifies the coherent errors unfavourably, and ZNE can make results worse than doing
nothing at all. The `pt_zne` tutorial documents this directly. The fix is to apply PT first to
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Linking to the tutorial will be helpful for the reader if you're referencing it.

channel more symmetric but cannot actually decouple the system from the environment — meaning
the benefit is limited at best. On top of that, gate-level DDD is an approximation of the ideal
pulse-level technique, and some backends internally reschedule gates in ways that can undermine
the sequences. The theory page is explicit: "it may happen that, for some sequences, the final
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Link to the theory page missing.

Comment on lines +513 to +519
| Noise type | ZNE | LRE | REM | DDD | PT | PEC | CDR |
|---|:---:|:---:|:---:|:---:|:---:|:---:|:---:|
| Incoherent gate noise (depolarizing, amplitude damping) | Y | Y | N | partial | partial | Y | Y |
| Coherent gate noise (over-rotations) | partial | partial | N | N | Y | Y | Y |
| Time-correlated (non-Markovian) noise | partial | partial | N | Y | partial | N | N |
| Readout / measurement errors | N | N | Y | N | N | N | N |
| Crosstalk (idle-qubit errors) | N | N | N | Y | partial | N | N |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is a nice table! Replacing Y with ✅ and N` with ❌ might make this a bit easier to skim at a glance.

| Readout / measurement errors | N | N | Y | N | N | N | N |
| Crosstalk (idle-qubit errors) | N | N | N | Y | partial | N | N |

To understand the table, it helps to know a bit about each technique's properties:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is not a page to explain how these techniques work. Lets keep it focused to composition.

@Rachel-Eva
Copy link
Copy Markdown
Author

Thanks for the feedback, I've made changes to the file. Let me know if this version is better.

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.

Technique composability

2 participants