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 optimal integration weights routine #383

Closed
wants to merge 22 commits into from
Closed

Conversation

Jacfomg
Copy link
Contributor

@Jacfomg Jacfomg commented Jun 6, 2023

Add integration weights. I would say it would need a way to save the fitting, #395, so I can get the integration weights and pass them to the devices.

Need to read a bit to understand what I get from the hardware.

https://arxiv.org/pdf/1711.05336.pdf and its 29 reference.

Checklist:

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

@Jacfomg Jacfomg added do not merge Soft warning to avoid merging a PR for reason provided in the PR deploy on hardware labels Jun 6, 2023
@Jacfomg Jacfomg marked this pull request as draft June 7, 2023 05:54
@Jacfomg Jacfomg mentioned this pull request Jun 12, 2023
@Jacfomg Jacfomg removed the do not merge Soft warning to avoid merging a PR for reason provided in the PR label Jun 12, 2023
@Jacfomg Jacfomg marked this pull request as ready for review June 12, 2023 09:25
@codecov
Copy link

codecov bot commented Jun 12, 2023

Codecov Report

Merging #383 (228d156) into main (e251c80) will increase coverage by 0.08%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #383      +/-   ##
==========================================
+ Coverage   96.77%   96.85%   +0.08%     
==========================================
  Files          48       49       +1     
  Lines        3128     3209      +81     
==========================================
+ Hits         3027     3108      +81     
  Misses        101      101              
Flag Coverage Δ
unittests 96.85% <100.00%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
src/qibocal/protocols/characterization/__init__.py 100.00% <100.00%> (ø)
.../signal_experiments/optimal_integration_weights.py 100.00% <100.00%> (ø)

@Jacfomg Jacfomg marked this pull request as draft June 14, 2023 09:42
@Jacfomg Jacfomg changed the title Add weights tof Add optimal integration weights routine Jun 16, 2023
@Jacfomg Jacfomg changed the base branch from main to save_fit June 16, 2023 08:50
@Jacfomg Jacfomg mentioned this pull request Jun 26, 2023
4 tasks
@Jacfomg Jacfomg marked this pull request as ready for review June 27, 2023 09:12
@Jacfomg Jacfomg mentioned this pull request Jun 27, 2023
4 tasks
Base automatically changed from save_fit to main June 28, 2023 09:48
Copy link
Contributor

@andrea-pasquale andrea-pasquale left a comment

Choose a reason for hiding this comment

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

Thanks @Jacfomg.
LGTM, just a few minor comments.

Comment on lines +37 to +42
for q in self.optimal_integration_weights.keys():
# """Helper function to use np.savez while converting keys into strings."""
np.savez(
path / f"optimal_integration_weights_q{q}.npz",
self.optimal_integration_weights[q],
)
Copy link
Contributor

Choose a reason for hiding this comment

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

The advantage of npz is that you can store multiple arrays. Therefore you don't need a specific file for each qubit. Unless you are doing this on purpose.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, if I have them is separate files I think it will be easier to handle them, at least now. So if you were recalibrating some qubits you can let the files for the others untouched. If not you will need to calibrate them all to have the file, right ?

@Jacfomg Jacfomg marked this pull request as draft July 7, 2023 09:27
@andrea-pasquale andrea-pasquale added this to the Qibocal 0.0.5 milestone Aug 31, 2023
@andrea-pasquale
Copy link
Contributor

I'm closing this as outdated but I will keep the branch, I will also open an issue to keep track of it.

@andrea-pasquale
Copy link
Contributor

@Jacfomg this branch can be deleted since you have already #582 right?

@Jacfomg Jacfomg deleted the add_weights_tof branch January 24, 2024 10:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants