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

LRE failure for chunking #2608

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

LRE failure for chunking #2608

wants to merge 3 commits into from

Conversation

purva-thakre
Copy link
Collaborator

@purva-thakre purva-thakre commented Dec 20, 2024

Description

Noticed in #2601

https://github.com/unitaryfund/mitiq/actions/runs/12433520415/job/34715234002?pr=2601#step:6:4591

Originally, the test was written to confirm chunking a circuit performs worse in certain scenarios. However, this performance varies non-deterministically. Due to this reason, now the test is verifying there is a difference between two expectation values.


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.

Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.73%. Comparing base (2dc8c4f) to head (8b180f2).
Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2608   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files          92       92           
  Lines        4193     4198    +5     
=======================================
+ Hits         4140     4145    +5     
  Misses         53       53           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@purva-thakre
Copy link
Collaborator Author

Converting this back to draft because @natestemen suggested to write a better test.

@purva-thakre purva-thakre marked this pull request as draft December 20, 2024 19:19
@purva-thakre purva-thakre marked this pull request as ready for review January 14, 2025 18:32
@purva-thakre purva-thakre removed the request for review from cosenal January 14, 2025 18:32
assert abs(lre_exp_val - ideal_val) <= abs(noisy_val - ideal_val)
# verify we get an expectation value
assert(lre_exp_val_chunking) > 0

Copy link
Collaborator Author

@purva-thakre purva-thakre Jan 14, 2025

Choose a reason for hiding this comment

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

@natestemen I cannot think of a better test here. Which is why I decided to check the function does provided a non-zero expectation value.

test_layerwise_folding already has a test comparing the number of noise-scaled layers for a chunked and a non-chunked circuit.

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.

1 participant