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

Fix bug in rabi 2D fit #997

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Fix bug in rabi 2D fit #997

merged 1 commit into from
Oct 7, 2024

Conversation

andrea-pasquale
Copy link
Contributor

@andrea-pasquale andrea-pasquale commented Oct 2, 2024

Closes #991.

I would like to add a test to verify that the code works properly.
I don't know if this is feasible unless we use some regressions.

Checklist:

  • Reviewers confirm new code works as expected.
  • Tests are passing.
  • Coverage does not decrease.
  • Documentation is updated.
  • Compatibility with Qibo modules (Please edit this section if the current pull request is not compatible with the following branches).
    • Qibo: master
    • Qibolab: 0.1
    • Qibolab_platforms_qrc: main

@andrea-pasquale andrea-pasquale marked this pull request as ready for review October 2, 2024 15:04
Copy link

codecov bot commented Oct 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.50%. Comparing base (c77f563) to head (3377b87).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #997      +/-   ##
==========================================
- Coverage   97.56%   97.50%   -0.06%     
==========================================
  Files         123      123              
  Lines        9714     9714              
==========================================
- Hits         9477     9472       -5     
- Misses        237      242       +5     
Flag Coverage Δ
unittests 97.50% <100.00%> (-0.06%) ⬇️

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

Files with missing lines Coverage Δ
src/qibocal/protocols/rabi/amplitude_frequency.py 97.91% <100.00%> (ø)
...bocal/protocols/rabi/amplitude_frequency_signal.py 98.36% <100.00%> (ø)
src/qibocal/protocols/rabi/length_frequency.py 97.93% <100.00%> (ø)
.../qibocal/protocols/rabi/length_frequency_signal.py 98.37% <100.00%> (-1.63%) ⬇️

... and 1 file with indirect coverage changes

@alecandido
Copy link
Member

I would like to add a test to verify that the code works properly.
I don't know if this is feasible unless we use some regressions.

I believe the best approach (in this and other cases) is truly a closure test: generate the data manually, as you expect they should be, with little or no noise (to make the fit simpler) and check that the fit is able to determine the parameters used in the data generation.

@andrea-pasquale
Copy link
Contributor Author

Thanks for the approvals. Before merging I want to add a test following @alecandido's suggestion.

@alecandido
Copy link
Member

Thanks for the approvals. Before merging I want to add a test following @alecandido's suggestion.

That's a correct approach, and I should encourage it.

However, if this is a bug fix, it may be more practical to just this PR as it is, and lift the suggestion to an issue, such that the test can be introduced as soon as there will be resources available to do that (i.e. decoupling it from the urgency of the bug fix itself).

@Edoardo-Pedicillo Edoardo-Pedicillo added this to the Qibocal 0.1.1 milestone Oct 3, 2024
@Edoardo-Pedicillo
Copy link
Contributor

I have opened #1000 regarding the test issue, so we can merge this PR

@Edoardo-Pedicillo Edoardo-Pedicillo added this pull request to the merge queue Oct 7, 2024
Merged via the queue into main with commit 2a7062c Oct 7, 2024
21 checks passed
@Edoardo-Pedicillo Edoardo-Pedicillo deleted the fix_rabi_2D_fit branch October 7, 2024 11:13
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.

Rabi Amplitude-Frequency fit error
4 participants