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

Parameters updater #1086

Merged
merged 6 commits into from
Nov 8, 2024
Merged

Parameters updater #1086

merged 6 commits into from
Nov 8, 2024

Conversation

alecandido
Copy link
Member

This is aiming to supersede #1061, providing a method and an associated syntax to update Platform parameters.

Copy link

codecov bot commented Oct 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.84%. Comparing base (f74c334) to head (f2850cd).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1086      +/-   ##
==========================================
+ Coverage   50.55%   50.84%   +0.28%     
==========================================
  Files          63       63              
  Lines        2886     2903      +17     
==========================================
+ Hits         1459     1476      +17     
  Misses       1427     1427              
Flag Coverage Δ
unittests 50.84% <100.00%> (+0.28%) ⬆️

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.

@stavros11
Copy link
Member

Also, since this is creating a new Parameters object (there's no other way, since that is frozen), the way to actually update the platform would be the following:

platform.parameters = platform.parameters.update(...)

right?

@alecandido
Copy link
Member Author

Also, since this is creating a new Parameters object (there's no other way, since that is frozen), the way to actually update the platform would be the following:

platform.parameters = platform.parameters.update(...)

right?

Definitely.

In this sense, we can make a couple of improvements regarding the UI, renaming Parameters.update() to Parameters.replace() (standard Python nomenclature) and expose a Platform.update() method to apply this operation in-place.

@alecandido alecandido marked this pull request as ready for review November 6, 2024 17:37
@alecandido alecandido requested a review from stavros11 November 6, 2024 17:37
@alecandido
Copy link
Member Author

Ok, I have to admit that I've been a bit lazy with tests, since I'm only using dummy to test, and dummy has only int qubits' names.
However, that should be the most challenging path, so it should be good enough for the time being.

Any tests' extension is of course welcome (in case anyone feels we definitely need more). Even clear proposals are welcome (but the effort to directly implement them should be comparable in size... in any case, I'm happy to do that, if needed).

Copy link
Member

@stavros11 stavros11 left a comment

Choose a reason for hiding this comment

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

Thanks @alecandido. I think we can merge this so that I restart working on qiboteam/qibocal#996 using it.

Ok, I have to admit that I've been a bit lazy with tests, since I'm only using dummy to test, and dummy has only int qubits' names. However, that should be the most challenging path, so it should be good enough for the time being.

I think testing on dummy is sufficient in this case, since this functionality is expected to behave the same on all platforms. True about string qubits, maybe an easy way to address this and other similar issues is to add a "dummy_strings" (and make our life more miserable), or just add some qubits with string names in the current dummy.

@alecandido
Copy link
Member Author

I think testing on dummy is sufficient in this case, since this functionality is expected to behave the same on all platforms. True about string qubits, maybe an easy way to address this and other similar issues is to add a "dummy_strings" (and make our life more miserable), or just add some qubits with string names in the current dummy.

I could just add a minimal platform with string names in the tests. But since it's not that essential, I'll save it for later.

@alecandido alecandido merged commit ed8b3cc into main Nov 8, 2024
28 checks passed
@stavros11 stavros11 deleted the update-params-simple branch November 8, 2024 12:58
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.

2 participants