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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
304 commits
Select commit Hold shift + click to select a range
f24227e
format
Min-Li Jul 10, 2023
ead2103
format
Min-Li Jul 10, 2023
5b3049e
format
Min-Li Jul 10, 2023
991c56e
format
Min-Li Jul 10, 2023
ab1187c
format
Min-Li Jul 10, 2023
a00b5f1
format
Min-Li Jul 10, 2023
af9b008
format
Min-Li Jul 10, 2023
14721ca
format
Min-Li Jul 10, 2023
4e09495
format
Min-Li Jul 10, 2023
5961251
format
Min-Li Jul 10, 2023
0cd305e
format
Min-Li Jul 10, 2023
0363f41
format
Min-Li Jul 10, 2023
cd34192
format
Min-Li Jul 11, 2023
510dfb0
Restructure
Min-Li Jul 12, 2023
20a331c
Restructure
Min-Li Jul 12, 2023
8e67d54
Rename
Min-Li Jul 12, 2023
2f1f9fb
Address Nate's comments
Min-Li Jul 12, 2023
ec534e5
Rename numpy typing
Min-Li Jul 12, 2023
e37f483
NDArray[np.complex_] typing somehow breaks the classical shadow resul…
Min-Li Jul 12, 2023
e574cce
reformat
Min-Li Jul 12, 2023
3ff0cff
rename numpy typing
Min-Li Jul 12, 2023
6dd9238
rename numpy typing
Min-Li Jul 12, 2023
4c672fb
Optional qiskit import
Min-Li Jul 12, 2023
33346da
Update docstring for shadow_utils
Min-Li Jul 12, 2023
6ad3057
Update doc
Min-Li Jul 12, 2023
da06674
debug
Min-Li Jul 12, 2023
6c1b106
reformat
Min-Li Jul 12, 2023
990145c
optional import
Min-Li Jul 12, 2023
372c814
Update docs/source/apidoc.md
Min-Li Jul 13, 2023
a574ee8
Update mitiq/shadows/quantum_processing.py
Min-Li Jul 13, 2023
d782c56
Update mitiq/shadows/test/test_quantum_processing.py
Min-Li Jul 13, 2023
9135f2f
Update mitiq/shadows/test/test_quantum_processing.py
Min-Li Jul 13, 2023
35a3a9a
Update mitiq/shadows/test/test_quantum_processing.py
Min-Li Jul 13, 2023
4f1da6f
add doc and header.
Min-Li Jul 13, 2023
85620d5
add doc and header.
Min-Li Jul 13, 2023
1b01d10
add doc and header.
Min-Li Jul 13, 2023
89b6e3e
remove type description in the doc string in the files
Min-Li Jul 13, 2023
9c9cec4
fix test functions
Min-Li Jul 13, 2023
3743ede
fix test functions
Min-Li Jul 13, 2023
2a2c65d
fix test functions
Min-Li Jul 13, 2023
e20db21
fix test functions
Min-Li Jul 13, 2023
e727d75
Update mitiq/shadows/quantum_processing.py
Min-Li Jul 14, 2023
fec3a14
Update mitiq/shadows/quantum_processing.py
Min-Li Jul 14, 2023
d1c0cbc
Update mitiq/shadows/quantum_processing.py
Min-Li Jul 14, 2023
c94e2bb
Update mitiq/shadows/quantum_processing.py
Min-Li Jul 14, 2023
d20f10d
Update mitiq/shadows/quantum_processing.py
Min-Li Jul 14, 2023
3202133
Sampling Function -> Executor (User-defined)
Min-Li Jul 14, 2023
ba201d0
update doc strings
Min-Li Jul 14, 2023
2735825
Resolve test coverage issue
Min-Li Jul 14, 2023
9e69e8e
Add headers to files
Min-Li Jul 14, 2023
ccb9a2f
Update mitiq/shadows/quantum_processing.py
Min-Li Jul 15, 2023
e808163
Update mitiq/shadows/test/test_quantum_processing.py
Min-Li Jul 15, 2023
1c55c68
address comments
Min-Li Jul 15, 2023
3c567f6
reformat
Min-Li Jul 15, 2023
237c71e
Update mitiq/shadows/quantum_processing.py
Min-Li Jul 17, 2023
ff7fa1a
Update mitiq/shadows/test/test_quantum_processing.py
Min-Li Jul 17, 2023
f35294b
reformat
Min-Li Jul 17, 2023
67f551d
Update mitiq/shadows/quantum_processing.py
Min-Li Jul 17, 2023
91978c8
reformat and apply Andrea's suggestion.
Min-Li Jul 17, 2023
985cf58
reformat and apply Andrea's suggestion.
Min-Li Jul 17, 2023
47e59c4
Update mitiq/shadows/shadows_utils.py
Min-Li Jul 17, 2023
4ea99bd
Update mitiq/shadows/shadows_utils.py
Min-Li Jul 17, 2023
36d5a2f
reformat and apply Andrea's suggestion.
Min-Li Jul 17, 2023
d862184
add test function requested by Codecov
Min-Li Jul 17, 2023
3c1765b
add test function requested by Codecov
Min-Li Jul 17, 2023
0292310
add test function requested by Codecov
Min-Li Jul 18, 2023
9a7e5ec
remove `pytest.fixture`
natestemen Jul 18, 2023
3ec3522
reformat
Min-Li Jul 18, 2023
77da824
remove trailing comma
natestemen Jul 18, 2023
ed4ae21
Merge branch 'shadows/post-processing' into shadows/classical-shadows
Min-Li Jul 18, 2023
63686fe
Merge branch 'shadows/quantum-processing' into shadows/classical-shadows
Min-Li Jul 18, 2023
924dea4
Merge branch 'shadows/utils' into shadows/classical-shadows
Min-Li Jul 18, 2023
39a8d20
add shadows.py, which is the main function (interface) for users to c…
Min-Li Jul 18, 2023
89e84e8
change docstring
Min-Li Jul 19, 2023
c066d78
Merge branch 'shadows/utils' into shadows/shadows
Min-Li Jul 19, 2023
fbea926
remove and add a test function, add the assert lines for measurement …
Min-Li Jul 20, 2023
69dc723
add an error lines for measurement `
Min-Li Jul 21, 2023
5ebbdd8
removed all test w.r.t time linearity, and power law.
Min-Li Jul 21, 2023
014de97
Apply suggestions from code review
Min-Li Jul 21, 2023
206b28f
Update mitiq/shadows/quantum_processing.py
Min-Li Jul 21, 2023
b4af7ec
Update mitiq/shadows/shadows_utils.py
Min-Li Jul 21, 2023
4a80a02
Update mitiq/shadows/shadows_utils.py
Min-Li Jul 21, 2023
a1f38a0
Update mitiq/shadows/shadows_utils.py
Min-Li Jul 21, 2023
2dc89bc
Update mitiq/shadows/shadows_utils.py
Min-Li Jul 21, 2023
55566db
Update mitiq/shadows/shadows_utils.py
Min-Li Jul 21, 2023
a73d0ef
modify API-doc; rename functions; pull out `shadow_norm` from `n_meas…
Min-Li Jul 22, 2023
00b2ddd
modify API-doc; rename functions; pull out `shadow_norm` from `n_meas…
Min-Li Jul 22, 2023
9d9a700
modify API Doc
Min-Li Jul 22, 2023
4341be5
modify for Andrea and Nate's comments
Min-Li Jul 23, 2023
ccb4902
Add util function `transform_to_cirq_paulistring` and test
Min-Li Jul 23, 2023
8a66d31
Merge branch 'shadows/utils' into shadows/post-processing
Min-Li Jul 23, 2023
641255f
make 'expectation_estimation_shadow' compatible with str, mitiq.Pauli…
Min-Li Jul 23, 2023
3016cac
resolve cirq PauliString typing issue
Min-Li Jul 23, 2023
7631680
Merge branch 'shadows/utils' into shadows/post-processing
Min-Li Jul 23, 2023
35e6c18
resolve cirq PauliString typing issue
Min-Li Jul 23, 2023
4546d89
resolve cirq PauliString typing issue
Min-Li Jul 23, 2023
c009d42
Merge branch 'shadows/post-processing' into shadows/shadows
Min-Li Jul 23, 2023
0b25bb5
Merge branch 'shadows/quantum-processing' into shadows/shadows
Min-Li Jul 23, 2023
99285bc
renaming; delete shadows_example.ipynb
Min-Li Jul 23, 2023
dea65c8
local commit
Min-Li Jul 24, 2023
dc5858c
check format
Min-Li Jul 25, 2023
f3ab218
reformate
Min-Li Jul 25, 2023
9b53363
Merge branch 'master' into shadows/shadows
Min-Li Jul 27, 2023
0d7d026
add an optional arg "qubits"; use bitstring as measurement result ins…
Min-Li Jul 31, 2023
bc30895
add few functions for robust shadow estimation
Min-Li Jul 31, 2023
7998866
Merge branch 'patch/shadows_utils' into patch/classical_postprocessing
Min-Li Jul 31, 2023
d8244f0
add few functions for robust shadow estimation.
Min-Li Jul 31, 2023
69b80c0
Merge branch 'patch/shadows_utils' into shadows/shadows
Min-Li Jul 31, 2023
971de0a
Merge branch 'patch/quantum_processing' into shadows/shadows
Min-Li Jul 31, 2023
aac2a46
Merge branch 'patch/classical_postprocessing' into shadows/shadows
Min-Li Jul 31, 2023
d82e8c8
Add few functions for robust shadow estimation. Split calibration sta…
Min-Li Jul 31, 2023
f0011f4
Minor change: assert -> error
Min-Li Jul 31, 2023
6aa3155
reformat
Min-Li Jul 31, 2023
e8b5d6b
reformat
Min-Li Jul 31, 2023
3f25383
Merge branch 'patch/shadows_utils' into patch/classical_postprocessing
Min-Li Jul 31, 2023
6ed576f
reformat
Min-Li Jul 31, 2023
49e59fe
Merge branch 'patch/classical_postprocessing' into shadows/shadows
Min-Li Jul 31, 2023
3d861c4
Merge branch 'patch/quantum_processing' into shadows/shadows
Min-Li Jul 31, 2023
204a561
reformat
Min-Li Jul 31, 2023
e38131d
reformat
Min-Li Jul 31, 2023
2022db9
reformat
Min-Li Jul 31, 2023
2888955
Merge branch 'patch/quantum_processing' into shadows/shadows
Min-Li Jul 31, 2023
3f2dbc0
Merge branch 'patch/classical_postprocessing' into shadows/shadows
Min-Li Jul 31, 2023
30106e1
reformat
Min-Li Jul 31, 2023
d123669
Create shadows tutorial
Min-Li Aug 1, 2023
e49b717
Update mitiq/shadows/quantum_processing.py
Min-Li Aug 2, 2023
15d1b49
local commit
Min-Li Aug 2, 2023
0a4bb5d
address Nate's comments
Min-Li Aug 2, 2023
9ee2201
update RShadows tutorial
Min-Li Aug 4, 2023
9e70859
update refs.bib
Min-Li Aug 4, 2023
99890fe
Update mitiq/shadows/quantum_processing.py
Misty-W Aug 4, 2023
d42c83d
update part of examples, haven't finished
Min-Li Aug 6, 2023
6137dce
reorder plots
Min-Li Aug 6, 2023
7f02fb9
reorder plots
Min-Li Aug 7, 2023
0fb1359
Update rshadows notebook
Min-Li Aug 7, 2023
cdc8d64
Update rshadows notebook
Min-Li Aug 7, 2023
2103233
Updates
Min-Li Aug 8, 2023
6f16a72
reformat
Min-Li Aug 8, 2023
a9bbb9d
address comments
Min-Li Aug 8, 2023
4814b0b
address comments
Min-Li Aug 8, 2023
6717821
address comments
Min-Li Aug 8, 2023
e8cbe0e
Merge branch 'patch/shadows_utils' into patch/classical_postprocessing
Min-Li Aug 8, 2023
ced7569
update several functions and address comments
Min-Li Aug 8, 2023
257476f
Merge branch 'patch/shadows_utils' into shadows/shadows
Min-Li Aug 8, 2023
70040de
Merge branch 'patch/quantum_processing' into shadows/shadows
Min-Li Aug 8, 2023
0aed8f0
Merge branch 'patch/classical_postprocessing' into shadows/shadows
Min-Li Aug 8, 2023
4492579
update several functions
Min-Li Aug 8, 2023
24eb1e0
Update functions add some optional Args.
Min-Li Aug 8, 2023
9211831
minor modify tqdm
Min-Li Aug 8, 2023
d6c2738
update plots
Min-Li Aug 8, 2023
75e048c
Apply suggestions from code review
Misty-W Aug 8, 2023
3196f48
local commit
Min-Li Aug 8, 2023
53c2914
Update mitiq/shadows/quantum_processing.py
Misty-W Aug 8, 2023
342ff21
address comments
Min-Li Aug 8, 2023
33d77e3
Merge branch 'patch/shadows_utils' into patch/classical_postprocessing
Min-Li Aug 8, 2023
f2772c1
address comments
Min-Li Aug 8, 2023
6ec546e
address Misty's comments
Min-Li Aug 8, 2023
1f644cd
address Misty's comments
Min-Li Aug 8, 2023
112c948
address comments
Min-Li Aug 8, 2023
200e64e
address comments
Min-Li Aug 8, 2023
01ee040
address comments
Min-Li Aug 8, 2023
62eef06
address Andrea's comments
Min-Li Aug 8, 2023
052bde6
address Andrea's comments
Min-Li Aug 8, 2023
ed3ed09
Revert "address Andrea's comments"
Min-Li Aug 8, 2023
d0f118d
address Andrea's commenfts
Min-Li Aug 8, 2023
c0cdaf9
Merge branch 'patch/shadows_utils' into patch/classical_postprocessing
Min-Li Aug 8, 2023
032e729
change name
Min-Li Aug 8, 2023
d10a7d8
Merge branch 'patch/classical_postprocessing' into shadows/shadows
Min-Li Aug 8, 2023
03dfb4d
Merge branch 'patch/quantum_processing' into shadows/shadows
Min-Li Aug 8, 2023
d976b95
minor change doc strings
Min-Li Aug 8, 2023
835afef
add doc strings
Min-Li Aug 8, 2023
e19b7cf
Merge branch 'patch/shadows_utils' into patch/classical_postprocessing
Min-Li Aug 8, 2023
2871173
Merge branch 'patch/classical_postprocessing' into shadows/shadows
Min-Li Aug 8, 2023
ba5cace
Merge branch 'shadows/shadows' into shadows/shadows_tutorial
Min-Li Aug 8, 2023
d2fde47
add doc strings
Min-Li Aug 10, 2023
067007f
address Andrea's comments.
Min-Li Aug 10, 2023
1ba3c39
address Andrea's comments.
Min-Li Aug 10, 2023
9ca46f7
address Andrea's comments.
Min-Li Aug 10, 2023
3e147d2
address Andrea's comments.
Min-Li Aug 10, 2023
a983921
Merge branch 'patch/shadows_utils' into shadows/shadows
Min-Li Aug 10, 2023
a16fb68
Merge branch 'patch/classical_postprocessing' into shadows/shadows
Min-Li Aug 10, 2023
291dd08
Merge branch 'master' into patch/classical_postprocessing
Min-Li Aug 11, 2023
3231caa
apply `isort`
natestemen Aug 11, 2023
98b1fab
revert math formatting change
natestemen Aug 11, 2023
d02e5e6
Merge branch 'patch/classical_postprocessing' into shadows/shadows
Min-Li Aug 11, 2023
eb01b2b
update shadows.py
Min-Li Aug 11, 2023
31324c8
update test_shadows.py
Min-Li Aug 11, 2023
70b1863
resolve conflicts
Min-Li Aug 11, 2023
bf5ef89
Merge branch 'master' into shadows/shadows
Min-Li Aug 11, 2023
281fa54
minor change inputs
Min-Li Aug 11, 2023
b84aaf8
Update docs/source/apidoc.md
Min-Li Aug 13, 2023
e3750ad
Update mitiq/shadows/test/test_shadows.py
Min-Li Aug 13, 2023
933a3fa
Update mitiq/shadows/test/test_shadows.py
Min-Li Aug 13, 2023
51e14ca
Update mitiq/shadows/test/test_shadows.py
Min-Li Aug 13, 2023
a02f646
address Nate's comments
Min-Li Aug 13, 2023
e48867f
address Nate's comments
Min-Li Aug 13, 2023
4ade952
Merge branch 'shadows/shadows' into shadows/shadows_tutorial
Min-Li Aug 13, 2023
4e65601
local commit
Min-Li Aug 13, 2023
fb0f861
change doc strings
Min-Li Aug 13, 2023
8e9e3e7
Merge branch 'shadows/shadows' into shadows/shadows_tutorial
Min-Li Aug 13, 2023
9441b45
Fetch saved data (for rshadows
Min-Li Aug 13, 2023
dff57a5
Fetch saved data (for rshadows
Min-Li Aug 14, 2023
0a201d7
rename guide file, and add examples
Min-Li Aug 14, 2023
6cdafc0
Apply suggestions from code review
Min-Li Aug 14, 2023
3f458b9
correct some indent.
Min-Li Aug 14, 2023
c5f7850
apply Andrea's comments
Min-Li Aug 14, 2023
d14e207
apply Andrea's comments change rshadows to use_calibration
Min-Li Aug 14, 2023
7016c28
apply Andrea's comments change rshadows to use_calibration
Min-Li Aug 14, 2023
aff5cc1
minor change
Min-Li Aug 15, 2023
bf33f76
Add corresponding and authorship
Min-Li Aug 15, 2023
5092df5
Merge branch 'shadows/shadows' into shadows/shadows_tutorial
Min-Li Aug 15, 2023
f48ea25
local commit
Min-Li Aug 15, 2023
06c1fbd
minor change on test shadows
Min-Li Aug 15, 2023
f3750e5
Merge branch 'shadows/shadows' into shadows/shadows_tutorial
Min-Li Aug 15, 2023
357620e
Apply suggestions from code review
Min-Li Aug 15, 2023
5c11c91
minor change on Error types
Min-Li Aug 15, 2023
ea92292
minor change on Error types and address Nate's comments
Min-Li Aug 15, 2023
d341960
Merge branch 'shadows/shadows' into shadows/shadows_tutorial
Min-Li Aug 15, 2023
6cc85d7
reformat
Min-Li Aug 15, 2023
5515b4f
address comments from all.
Min-Li Aug 15, 2023
09e5183
Merge branch 'shadows/shadows' into shadows/shadows_tutorial
Min-Li Aug 15, 2023
970f446
reformat markdown file
Min-Li Aug 15, 2023
4c98d5b
Address Misty's comments
Min-Li Aug 16, 2023
cb3ddf9
Merge branch 'shadows/shadows' into shadows/shadows_tutorial
Min-Li Aug 16, 2023
f4960a9
reformat all notebook cells
Min-Li Aug 16, 2023
ffe7187
reformat all notebook cells
Min-Li Aug 17, 2023
4d9c903
Update docs/source/guide/shadows-1-intro.md
Min-Li Aug 21, 2023
2ebc9c9
Update docs/source/guide/shadows-1-intro.md
Min-Li Aug 21, 2023
5b09099
Update docs/source/guide/shadows-1-intro.md
Min-Li Aug 21, 2023
67478e0
Update docs/source/guide/shadows-1-intro.md
Min-Li Aug 21, 2023
a745028
Update docs/source/guide/shadows-1-intro.md
Min-Li Aug 21, 2023
dab73ac
Update docs/source/guide/shadows-1-intro.md
Min-Li Aug 21, 2023
fe17663
Update docs/source/guide/shadows-1-intro.md
Min-Li Aug 21, 2023
1840903
address Andrea's comments.
Min-Li Aug 21, 2023
82d1583
Apply suggestions from code review
Min-Li Aug 21, 2023
0a1f6c6
Apply suggestions from code review
Min-Li Aug 21, 2023
2b3d64f
address Andrea's comments.
Min-Li Aug 21, 2023
1c838f1
Fix tqdm bar in make docs
Min-Li Aug 21, 2023
02de776
Fix tqdm bar in make docs
Min-Li Aug 21, 2023
37088e6
[Debug] Change workflow file to let it print error messages during "m…
Min-Li Aug 22, 2023
70ad800
Add seaborn to dev_requirements.txt for plots in shadows/rshadows exa…
Min-Li Aug 22, 2023
ae2a28f
Merge branch 'master' into shadows/shadows_tutorial
Min-Li Aug 22, 2023
c81c8d4
Add seaborn to dev_requirements.txt for plots in shadows/rshadows exa…
Min-Li Aug 22, 2023
421a6c6
Debug doc building
Min-Li Aug 22, 2023
8c78200
remove Debug doc
Min-Li Aug 23, 2023
35b0bf1
Change typos
Min-Li Aug 24, 2023
4ccafce
Merge branch 'master' into shadows/shadows_tutorial
nathanshammah Sep 15, 2023
2b6fca0
Update docs/source/guide/cdr-5-theory.md
nathanshammah Sep 15, 2023
2736883
import operator_ptm_vector_rep from mitiq.utils
andreamari Sep 18, 2023
5c714e0
Change from mitiq.utils import operator_ptm_vector_rep
Min-Li Sep 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Nick Gardner
Nathaniel T. Stemen
Nathan Shammah
Will J. Zeng
Min Li

L-P-B
Paul Chung
Expand Down
1 change: 1 addition & 0 deletions dev_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ pyscf==2.3.0; sys_platform != 'win32'
openfermion==1.5.1; sys_platform != 'win32'
openfermionpyscf==0.5; sys_platform != 'win32'
bqskit[ext]==1.0.4
seaborn~=0.12.2
stim==1.12.0
stimcirq==1.12.0
Binary file added docs/source/_thumbnails/rshadow_protocol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_thumbnails/shadow-tutorial.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ def get_incollection_template(self, e):
"examples/learning-depolarizing-noise": "_static/learn-depolarizing.png",
"examples/pec_tutorial": "_static/pec-tutorial.png",
"examples/scaling": "_static/scaling.png",
"examples/shadows_tutorial": "_static/shadow-tutorial.png",
"examples/rshadows_tutorial": "_static/rshadow_protocol.png",
"examples/ddd_tutorial": "_static/ddd-tutorial.png",
"examples/ddd_on_ibmq_ghz": "_static/ddd_qiskit_ghz_plot.png",
"examples/calibration-tutorial": "_static/calibration.png",
Expand Down
2 changes: 2 additions & 0 deletions docs/source/examples/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ ZNE with BQSKit compiled circuits <bqskit.md>
ZNE on Stim backend with Cirq: Logical randomized benchmarking circuits <zne_logical_rb_cirq_stim.md>
PEC on a Braket simulator: Mirror circuits <pec_tutorial.md>
PEC with Cirq: Learning representations <learning-depolarizing-noise.md>
Classical Shadows with Cirq: State Reconstruction and Observable Estimation <shadows_tutorial.md>
Robust Shadow Estimation with Cirq: Pauli Twirling Calibration of Classical Shadows <rshadows_tutorial.md>
DDD with Cirq: Mirror circuits <ddd_tutorial.md>
DDD with Qiskit: GHZ circuits <ddd_on_ibmq_ghz.md>
GGI Summer School ZNE Hands-On Tutorial <ggi_summer_school_unsolved.md>
Expand Down
620 changes: 620 additions & 0 deletions docs/source/examples/rshadows_tutorial.md

Large diffs are not rendered by default.

Loading