Skip to content

Update multi-product-formula tutorial to conform to new template#5170

Open
henryzou50 wants to merge 21 commits into
mainfrom
mpf-update
Open

Update multi-product-formula tutorial to conform to new template#5170
henryzou50 wants to merge 21 commits into
mainfrom
mpf-update

Conversation

@henryzou50

Copy link
Copy Markdown
Collaborator

Summary

Brings multi-product-formula.ipynb in line with new tutorial template and the conventions established by recent tutorial updates.

Both the small-scale simulator example and the large-scale hardware example now follow the standard four-step layout. Labels match content: Step 2 = transpile/optimize, Step 3 = execute, Step 4 = post-process (compute MPF coefficients and combine). Previously, Step 2 was doing execution and Step 3 was doing post-processing.

Other changes:

  • Background section rewritten to focus on the Trotter-step (k) vs. circuit-depth trade-off rather than the PF order. r and k_j are introduced on first appearance, eta_n / chi exponents are made explicit for symmetric vs. non-symmetric PFs, and the "stability" paragraph is replaced with a derivation-based explanation of why t/k_min <~ 1 matters.
  • Prerequisites point to the compilation-methods tutorial and SuzukiTrotter / LieTrotter API pages (the previous links were mismatched).
  • Requirements trimmed (removed unused quimb / qiskit-quimb).
  • Per-cell narrative restored for the LSE inspection cells, identity_factory / Néel MPS setup, and the dynamic-coefficients loop.
  • Small-scale post-plot commentary corrected: no longer reads as if MPFs work better at t/k > 1, and the sampling-error formula sigma_MPF^2 = sum_j x_j^2 sigma_{k_j}^2 is given explicitly.
  • Large-scale section corrected: the misleading "Steps 1-4 combined" header is dropped (that cell is only Step 1), the inline comment on the k=6 baseline is fixed (depth-comparable single-circuit run, not one that matches the MPF's effective Trotter error), and the results discussion is rewritten against the latest hardware run (dynamic MPF beats every individual product formula; exact-static MPF is worst because ||x||_1 = 5.63 amplifies hardware noise).
  • TeNPy unit_cell_width UserWarning suppressed in the Setup cell. The default is correct for Chain lattices, which is what CouplingMap.from_line(...) produces here.
  • cspell:ignore extended with the new technical / LaTeX terms.

Acknowledgments

Thanks to Boseong for the detailed review of the prior draft. The descriptions, Step-label fixes, and several of the Background corrections above incorporate that feedback directly.

- Restructure both the small-scale simulator example and the large-scale
  hardware example so each section follows the four-step template
  (Step 2 = transpile, Step 3 = execute, Step 4 = post-process). The
  previous labeling had Step 2 doing execution and Step 3 doing
  post-processing.
- Rewrite the Background section to address review feedback: focus on
  the trade-off between Trotter step count k and circuit depth (rather
  than PF order), introduce r and k_j on first appearance, give the
  explicit eta_n / chi exponent pattern for symmetric vs non-symmetric
  PFs, and replace the stability paragraph with a derivation-based
  explanation of why t/k_min <~ 1 matters.
- Fix Prerequisites links (point to the compilation-methods tutorial and
  SuzukiTrotter / LieTrotter API pages instead of the mismatched course
  URLs) and tighten the Requirements list.
- Restore the per-code-cell narrative that had been trimmed from earlier
  passes (LSE inspection, identity_factory / Neel MPS setup, dynamic-
  coefficients loop).
- Correct the small-scale post-plot commentary so it no longer reads as
  if MPFs work better at t/k > 1, and expand the sampling-error
  explanation with the explicit sigma_MPF^2 = sum x_j^2 sigma_{k_j}^2
  formula.
- Correct the large-scale section: drop the misleading "Steps 1-4
  combined" header (the cell is only Step 1), fix the inline comment
  on the k=6 baseline (it is a depth-comparable single-circuit run, not
  one that matches the MPF's effective Trotter error), and rewrite the
  results discussion to match the new run (dynamic MPF beats every
  individual product formula here; exact-static MPF is worst because
  ||x||_1 = 5.63 amplifies hardware noise).
- Suppress TeNPy's unit_cell_width future-API UserWarning in the Setup
  cell. The default is correct for Chain lattices, which is what
  CouplingMap.from_line(...) produces.
- Extend cspell:ignore with the new technical / LaTeX terms.
@henryzou50 henryzou50 requested a review from a team May 26, 2026 18:54
@qiskit-bot

Copy link
Copy Markdown
Contributor

One or more of the following people are relevant to this code:

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

"\n",
"where $\\chi$ is the order of the symmetric PF and $s_p = \\left( 4 - 4^{1/(2p-1)} \\right)^{-1}$. For long time-evolutions, one can split the time interval $t$ into $k$ intervals, called Trotter steps, of duration $t/k$ and approximate the time-evolution in each interval with a $\\chi$ order product formula $S_{\\chi}$. Thus, the PF of order $\\chi$ for time-evolution operator over $k$ Trotter steps is:\n",
"where $\\langle A \\rangle_{k_j}(t)$ is the expectation value of an observable $A$ at time $t$ estimated from a Trotter circuit with $k_j$ steps, and the coefficients $\\{x_j\\}_{j=1}^r$ are chosen so that the leading Trotter-error terms in the combination cancel. We will revisit this expression in [Step 4](#step-4-post-process-and-return-result-in-desired-classical-format), where we evaluate it explicitly to combine our Trotter results. The key practical point is that the deepest circuit in the MPF only needs $k_{\\max}$ steps, which is much smaller than the single $k$ that would be required to reach the same effective Trotter error directly. The shallower circuits make the MPF approach better suited to noisy hardware.\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Which step 4 should this link to, since we have two headers with this same title?

Also - should the step names ever change, I suggest future-proofing it with this syntax on the line right before the relevant step 4:
<span id="step-4-or-whatever-anchor-name-you-want"></span>
and then you can use [Step 4](#step-4-or-whatever-anchor-name-you-want) to call it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Oh this should link to step 4 of the small scale example. I just pushed a change for that and did your suggestion! That is good to know and thanks!

Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
"\n",
"- **Trotter error.** The individual product formulas (grey markers) deviate from the exact curve more and more as time grows, with the largest deviation for $k=1$ &mdash; that circuit is the shallowest, but it is also already in the regime where $t/k \\gtrsim 1$, so the leading $1/k^{2}$ error term is large. The MPF combinations (colored markers) cancel several of these leading Trotter-error terms, so they track the exact curve much more closely than any single $k_j$ circuit. The remaining gap reflects the higher-order Trotter terms that the MPF does *not* cancel: an order-$2$, $r=3$ static MPF only kills the first two error orders, and at large $t/k_{\\min}$ the uncancelled tail eventually dominates &mdash; so MPF is not a free pass to use very shallow circuits at arbitrary times.\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"- **Trotter error.** The individual product formulas (grey markers) deviate from the exact curve more and more as time grows, with the largest deviation for $k=1$ &mdash; that circuit is the shallowest, but it is also already in the regime where $t/k \\gtrsim 1$, so the leading $1/k^{2}$ error term is large. The MPF combinations (colored markers) cancel several of these leading Trotter-error terms, so they track the exact curve much more closely than any single $k_j$ circuit. The remaining gap reflects the higher-order Trotter terms that the MPF does *not* cancel: an order-$2$, $r=3$ static MPF only kills the first two error orders, and at large $t/k_{\\min}$ the uncancelled tail eventually dominates &mdash; so MPF is not a free pass to use very shallow circuits at arbitrary times.\n",
"- **Trotter error.** The individual product formulas (grey markers) deviate from the exact curve more and more as time grows. The $k=1$ circuit has the largest deviation and is the shallowest, but it is also already in the regime where $t/k \\gtrsim 1$, so the leading $1/k^{2}$ error term is large. The MPF combinations (colored markers) cancel several of these leading Trotter-error terms, so they track the exact curve much more closely than any single $k_j$ circuit. The remaining gap reflects the higher-order Trotter terms that the MPF does *not* cancel: an order-$2$, $r=3$ static MPF only kills the first two error orders, and at large $t/k_{\\min}$ the uncanceled tail eventually dominates &mdash; so MPF does not necessarily invite using very shallow circuits at arbitrary times.\n",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

With translations in mind, I tried rewriting the last sentence to avoid colloquialisms, but perhaps you can come up with something better?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Good point, I went with: "so MPF does not guarantee that very shallow circuits remain accurate at arbitrary times." This should read a bit more naturally than "invite using" and should translate cleanly. Also fixed a stray double-backslash in \gtrsim that snuck in. Let me know if you'd prefer different phrasing!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sounds much better, thanks @henryzou50!

Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
Comment thread docs/tutorials/multi-product-formula.ipynb Outdated
@abbycross

Copy link
Copy Markdown
Collaborator

I've finished a copyedit sweep ✅

henryzou50 and others added 4 commits June 2, 2026 14:15
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
henryzou50 and others added 5 commits June 2, 2026 14:17
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
henryzou50 and others added 8 commits June 2, 2026 14:18
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>
Co-authored-by: abbycross <across@us.ibm.com>

@abbycross abbycross left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@nathanearnestnoble nathanearnestnoble left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this tutorial looks good to publish! I am curious for us to evaluate how necessary the backend filtering is for performance and whether we should apply this principle to all of the large scale hardware demos (+ updating backend characterization).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants