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

[Classical Shadows 5] Shadows/RShadows tutorial #1945

Merged
merged 304 commits into from
Sep 22, 2023

Conversation

Min-Li
Copy link
Contributor

@Min-Li Min-Li commented Aug 1, 2023

Fixes #1930

-->

Description

Notebook on classical shadow and calibration, state reconstruction, and expectation value estimation
Users guide:
shadows-1-intro.md
shadows-5-theory.md

Examples:
shadows_tutorial.md
rshadows_tutorial.md

I also write a very brief theory intro part for Clifford data regression:
CDR-5-theory.md


License

  • I license this contribution under the terms of the GNU GPL, version 3 and grant Unitary Fund 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.

@nathanshammah
Copy link
Member

nathanshammah commented Sep 18, 2023

Docs build fail due to shadows-1-intro.md with this message:

/home/runner/work/mitiq/mitiq/docs/source/guide/shadows-1-intro.md: WARNING: Executing notebook failed: CellExecutionError [mystnb.exec]
/home/runner/work/mitiq/mitiq/docs/source/guide/shadows-1-intro.md: WARNING: Notebook exception traceback saved in: /home/runner/work/mitiq/mitiq/docs/build/html/reports/guide/shadows-1-intro.err.log [mystnb.exec]
looking for now-outdated files... none found

@natestemen
Copy link
Member

This PR will need to be updated again as #1989 moved some of the functions required in the notebooks to different files. The actual error that's occurring is

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[15], line 1
----> 1 from mitiq.shadows.shadows_utils import operator_ptm_vector_rep
      3 ghz_state = circuit.final_state_vector().reshape(-1, 1)
      4 ghz_true = ghz_state @ ghz_state.conj().T

ImportError: cannot import name 'operator_ptm_vector_rep' from 'mitiq.shadows.shadows_utils' (/home/docs/checkouts/readthedocs.org/user_builds/mitiq/envs/1945/lib/python3.10/site-packages/mitiq/shadows/shadows_utils.py)

You can see this on RTD.

@andreamari
Copy link
Member

There is a link-check error unrelated to this PR. It should go away once #2022 is merged.

@Misty-W
Copy link
Contributor

Misty-W commented Sep 20, 2023

Thanks for finishing this @Min-Li, great work!

Copy link
Member

@nathanshammah nathanshammah left a comment

Choose a reason for hiding this comment

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

Thanks @Min-Li! Massive work, glad to add it to the Mitiq codebase! We are going to open some issues to improve the documentation and reduce the documentation build time.

@nathanshammah nathanshammah merged commit be87d6f into unitaryfund:master Sep 22, 2023
19 checks passed
@Min-Li
Copy link
Contributor Author

Min-Li commented Sep 23, 2023

@nathanshammah Thank you for the positive feedback! I'm glad my work could be a valuable addition to the Mitiq codebase. I look forward to the upcoming issues on improving the documentation and optimizing the build time.

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 example on shadow estimation
5 participants