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

Expectation values as native backend arrays #1382

Merged
merged 17 commits into from
Sep 18, 2024

Conversation

BrunoLiegiBastonLiegi
Copy link
Contributor

@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi commented Jul 7, 2024

This updates the expectation values calculation, that are now computed and returned as native arrays of the backend used. This, in turns, begs for updating some of the error mitigation methods accordingly. In particular, as torch was having problems with the scipy.curve_fit I had to implement a custom _curve_fit based on the torch.optim.LBFGS optimizer.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.

Copy link

codecov bot commented Jul 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Please upload report for BASE (master@325190e). Learn more about missing BASE report.
Report is 18 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##             master    #1382   +/-   ##
=========================================
  Coverage          ?   97.11%           
=========================================
  Files             ?       81           
  Lines             ?    11699           
  Branches          ?        0           
=========================================
  Hits              ?    11362           
  Misses            ?      337           
  Partials          ?        0           
Flag Coverage Δ
unittests 97.11% <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.

@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi marked this pull request as ready for review July 9, 2024 19:49
@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi marked this pull request as draft July 22, 2024 07:19
@scarrazza scarrazza added this to the Qibo 0.2.11 milestone Jul 24, 2024
@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi changed the title qiboml models related fixes Expectation values as native backend arrays Sep 12, 2024
Copy link
Contributor

@MatteoRobbiati MatteoRobbiati left a comment

Choose a reason for hiding this comment

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

Thanks! I just left a comment about the optimizer choice.

src/qibo/models/error_mitigation.py Show resolved Hide resolved
@renatomello renatomello self-requested a review September 18, 2024 05:01
@BrunoLiegiBastonLiegi BrunoLiegiBastonLiegi added this pull request to the merge queue Sep 18, 2024
Merged via the queue into master with commit 783a046 Sep 18, 2024
27 checks passed
@renatomello renatomello deleted the qiboml_models_updates branch October 7, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants