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

Add tutorial for error mitigation with Qiskit Runtime Estimator #1313

Merged
merged 19 commits into from
May 14, 2024

Conversation

kevinsung
Copy link
Collaborator

@kevinsung kevinsung commented May 7, 2024

Fixes #1168

kevinsung and others added 6 commits May 6, 2024 21:29
Co-authored-by: Abdullah Ash- Saki <44783187+ashsaki@users.noreply.github.com>
Co-authored-by: Pedro Rivero <pedro.rivero.ramirez@gmail.com>
Co-authored-by: Ritajit Majumdar <majumdar.ritajit@gmail.com>
Co-authored-by: haimeng-zhang <33587226+haimeng-zhang@users.noreply.github.com>
@kevinsung kevinsung requested a review from javabster May 7, 2024 13:29
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@javabster
Copy link
Collaborator

Phenomenal work Kevin!

my comments:

  • I think we might need to come up with a different title for this tutorial, atm it's too similar to the PEA utility notebook title
  • could you add a list of requirements to the top of this notebook (check out some of the other tutorial PRs to see how others have done it)
  • in the intro when you select the efficientSU2 can you mention that this approach is generalisable to many types of circuits, I believe that was an important point from the original notebook.
  • I like how clearly you set the goal of the tutorial in the intro, could you also add that first you will be showing a small example and then scaling it up in the second half
  • Also in the intro, can you mention which of the EM techniques you will be comparing in the rest of the notebook
  • more of a question - is there a reason we shouldn't just show the full 50q example from the start? The code example at the end looks very similar, maybe we could just use that from the get go?
  • in general the explanation of the "scale up" section looks a bit sparse - are there any additional insights you could add there? atm it feels like that section was just lumped in at the end without much thought
  • nice code comments!

Overall I think this is a great simplified version of the notebook, but i think we should definitely follow up with more of a deep dive into the different error mitigation techniques in additional documentation

@abbycross
Copy link
Collaborator

@kevinsung does this recent comment about breaking changes to the Estimator result data for ZNE affect your tutorial?

- list of requirements
- mention approach is generalizable to different circuits
- mention notebook plan of going from 10 to 50 qubits
- list error mitigation techniques in intro
- expand prose in "scaling up" section and add conclusion
@kevinsung
Copy link
Collaborator Author

@kevinsung does this recent comment about breaking changes to the Estimator result data for ZNE affect your tutorial?

I don't think so. I only access the ZNE results using the evs attribute which should be consistent with the non-ZNE results too.

@kevinsung
Copy link
Collaborator Author

@javabster I've addressed your comments. I also added a "Conclusion" section and made a few other minor edits. Please take another look.

@kevinsung kevinsung marked this pull request as ready for review May 13, 2024 15:35
@kevinsung
Copy link
Collaborator Author

more of a question - is there a reason we shouldn't just show the full 50q example from the start? The code example at the end looks very similar, maybe we could just use that from the get go?

The main reason is simply ease of visualization. If you try to draw a 50-qubit circuit it's very slow and the output is too large to view comfortably. Also, in general it's preferable to build and test a workflow on small circuits first (I mention this now in the notebook).

@javabster
Copy link
Collaborator

Looking great! Some last final small things:

  • I really liked the bullet points at the end where you summarised the insights from the results 👏
  • it looks like you used numpy and mpl for the analyse results section, so those packages should be added to the requirements list
  • for the mirror section, that's the same as the "compute-uncompute" technique right? If both terms are used by end users I think it would be good to mention that the mirror stuff is "otherwise known as compute-uncompute..."
  • can you update the patterns subheadings to be in line with what the other tutorials are doing (e.g. analyse results should be post-process results)

@kevinsung
Copy link
Collaborator Author

it looks like you used numpy and mpl for the analyse results section, so those packages should be added to the requirements list

I don't think we should list Numpy and Matplotlib as explicit requirements because that would be redundant and noisy. Numpy is already a dependency of Qiskit (and just about every other Python library that works with numbers). And we already explicitly say Qiskit needs to be installed "with visualization support" which implies Matplotlib. Thoughts?

@javabster
Copy link
Collaborator

I see your point about mpl but when you install qiskit does it also install numpy for you? I thought you had to install that separately

@kevinsung
Copy link
Collaborator Author

I see your point about mpl but when you install qiskit does it also install numpy for you? I thought you had to install that separately

Yes, installing Qiskit installs Numpy too.

@kevinsung
Copy link
Collaborator Author

  • for the mirror section, that's the same as the "compute-uncompute" technique right? If both terms are used by end users I think it would be good to mention that the mirror stuff is "otherwise known as compute-uncompute..."
  • can you update the patterns subheadings to be in line with what the other tutorials are doing (e.g. analyse results should be post-process results)

Done

@nonhermitian
Copy link
Contributor

  • Is it possible to get the error bars on the expectation values?

  • Can the operators be constructed using the sparse list method?

Looks very nice!

@kevinsung
Copy link
Collaborator Author

  • Is it possible to get the error bars on the expectation values?

    • Can the operators be constructed using the sparse list method?

Looks very nice!

Done!

Copy link
Collaborator

@javabster javabster left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@kevinsung kevinsung added this pull request to the merge queue May 14, 2024
@kevinsung kevinsung removed this pull request from the merge queue due to a manual request May 14, 2024
@kevinsung kevinsung force-pushed the kjs/tutorial-error-mitigation-estimator branch from 77f98a8 to 967587c Compare May 14, 2024 17:26
@kevinsung kevinsung enabled auto-merge May 14, 2024 17:27
@kevinsung kevinsung added this pull request to the merge queue May 14, 2024
Merged via the queue into main with commit 622ed0d May 14, 2024
3 checks passed
@kevinsung kevinsung deleted the kjs/tutorial-error-mitigation-estimator branch May 14, 2024 17:29
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.

Add tutorial on error mitigation with Qiskit Runtime Estimator
4 participants