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

Reduce measurement cost using qubit-wise commutativity #95

Merged
merged 35 commits into from
Apr 29, 2024
Merged

Reduce measurement cost using qubit-wise commutativity #95

merged 35 commits into from
Apr 29, 2024

Conversation

chmwzc
Copy link
Contributor

@chmwzc chmwzc commented Apr 9, 2024

Reduce the measurement cost of VQE by grouping Hamiltonian terms that commute qubit-wise, and obtaining their expectation value with a single set of measurements.

Reference paper: https://arxiv.org/abs/1907.03358

Checklist:

  • Code (17 Apr - Currently refactoring)
  • Documentation
  • Example/Tutorial

Copy link

codecov bot commented Apr 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (81239b2) to head (4693517).

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #95   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           12        12           
  Lines          587       620   +33     
=========================================
+ Hits           587       620   +33     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@chmwzc
Copy link
Contributor Author

chmwzc commented Apr 11, 2024

Note: I renamed expectation.py because I don't think it having the same name as the main function inside (expectation) was very nice. E.g. it's not clear what would import qibochem.measurement.expectation as expectation give, the module or the function.

Other than that, I think this is done, but I'll do a bit more testing locally to be sure .

@yjmaxpayne yjmaxpayne added this to the Qibochem 0.0.3 milestone Apr 16, 2024
@yjmaxpayne yjmaxpayne added new features enhancement New feature or request labels Apr 16, 2024
@chmwzc chmwzc marked this pull request as ready for review April 26, 2024 03:17
@chmwzc
Copy link
Contributor Author

chmwzc commented Apr 26, 2024

The figures in the tutorial are ugly, but I wanted to finish this before the meeting early next week (A bit tired of working on this too 😛). Will redraw nicer looking figures to replace them in future👍

@damarkian
Copy link
Contributor

The figures in the tutorial are ugly, but I wanted to finish this before the meeting early next week (A bit tired of working on this too 😛). Will redraw nicer looking figures to replace them in future👍

How's this?

bk_ham_graph

h2_terms

Copy link
Contributor

@damarkian damarkian left a comment

Choose a reason for hiding this comment

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

Added some small modifications to the expectations from shots tutorial. Rendering by sphinx now looks ok.

@damarkian damarkian merged commit c1c3cde into main Apr 29, 2024
7 checks passed
@damarkian damarkian deleted the qwc branch April 29, 2024 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants