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 Calibration logging for PEC #1873

Merged
merged 11 commits into from
Jul 31, 2023
Merged

Conversation

Misty-W
Copy link
Contributor

@Misty-W Misty-W commented Jun 14, 2023

Description

Add Calibration logging for PEC.

Fixes #1861

A mixture of ZNE and PEC strategies is also supported in a simple way, as the appropriate header is printed initially and when the current technique is different from the previous technique.


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.

@Misty-W Misty-W linked an issue Jun 14, 2023 that may be closed by this pull request
@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch unitaryfund/mitiq/1861-logs-for-pec-calibration

@Misty-W Misty-W changed the title Update logging to work for PEC Add Calibration logging for PEC Jun 14, 2023
@Misty-W Misty-W marked this pull request as ready for review June 15, 2023 20:43
@Misty-W Misty-W requested a review from natestemen June 15, 2023 20:43
@codecov
Copy link

codecov bot commented Jun 15, 2023

Codecov Report

Merging #1873 (c15ba4e) into master (6761302) will increase coverage by 98.53%.
Report is 3 commits behind head on master.
The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           master    #1873       +/-   ##
===========================================
+ Coverage        0   98.53%   +98.53%     
===========================================
  Files           0       79       +79     
  Lines           0     3694     +3694     
===========================================
+ Hits            0     3640     +3640     
- Misses          0       54       +54     
Files Changed Coverage Δ
mitiq/calibration/calibrator.py 98.18% <100.00%> (ø)
mitiq/calibration/settings.py 99.43% <100.00%> (ø)

... and 77 files with indirect coverage changes

@Misty-W Misty-W marked this pull request as draft June 16, 2023 02:29
@Misty-W Misty-W marked this pull request as ready for review June 16, 2023 03:24
@Misty-W
Copy link
Contributor Author

Misty-W commented Jun 16, 2023

@natestemen, thought I'd clarify that this PR is ready for review now (after a few false starts, oops!)

Copy link
Member

@natestemen natestemen left a comment

Choose a reason for hiding this comment

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

Nice work, and good tests. Biggest request is getting the lines to print in a formatted way similar to ZNE, but most other stuff looks good.

mitiq/calibration/settings.py Outdated Show resolved Hide resolved
mitiq/calibration/calibrator.py Outdated Show resolved Hide resolved
mitiq/calibration/calibrator.py Outdated Show resolved Hide resolved
mitiq/calibration/calibrator.py Outdated Show resolved Hide resolved
@Misty-W Misty-W requested a review from natestemen July 6, 2023 04:42
Copy link
Member

@natestemen natestemen left a comment

Choose a reason for hiding this comment

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

When running an example using the light_pec_settings from the tests it's printing out double headers.

Screenshot 2023-07-12 at 2 46 46 PM

The function name is also overflowing it's column. Do you think continuing to use a table here is the right choice if you want to print out the operations? I don't see a way that will fit in a text table.

@Misty-W Misty-W force-pushed the 1861-logs-for-pec-calibration branch from caa1abf to 19318e6 Compare July 25, 2023 23:24
@Misty-W
Copy link
Contributor Author

Misty-W commented Jul 26, 2023

When running an example using the light_pec_settings from the tests it's printing out double headers.

Thanks for pointing this out @natestemen! Not sure how I missed this behavior before, but it turned out that the count determining whether to print the header "initially" was resetting with every "problem" instance.

@Misty-W
Copy link
Contributor Author

Misty-W commented Jul 26, 2023

The function name is also overflowing it's column. Do you think continuing to use a table here is the right choice if you want to print out the operations? I don't see a way that will fit in a text table.

I propose to keep the table and remove the operations, since all 2-qubit op's are represented by default now when running PEC calibration. Working on this change plus some other improvements now.

Add key for noise bias parameter in `Strategy` and propagate through code
Make logging consistent with enhancement extending representations to all 2-qubit gates in circuit
Improve formatting of logging
@natestemen natestemen self-requested a review July 28, 2023 16:03
Copy link
Member

@natestemen natestemen left a comment

Choose a reason for hiding this comment

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

Nice work Misty! Thanks for working to ensure everything fits into the table nicely.

@natestemen natestemen merged commit a882546 into master Jul 31, 2023
21 checks passed
@natestemen natestemen deleted the 1861-logs-for-pec-calibration branch July 31, 2023 05:17
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.

Logs for PEC Calibration
2 participants