-
Notifications
You must be signed in to change notification settings - Fork 139
Add set_noise_model method to Device #893
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #893 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 162 162
Lines 10450 10449 -1
Branches 1296 1294 -2
=========================================
- Hits 10450 10449 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/braket/devices/device.py
Outdated
| if noise_model: | ||
| self._validate_device_noise_model_support(noise_model) | ||
| self._noise_model = noise_model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to do the if check if the method explicitly takes a noise model. As well, should this raise a warning if there's already a noise model attached? Alternatively, the method can be update_noise_model, in which case it will be pretty clear that the model will be overwritten.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @speller26 could you review this PR again? I think it'd be good to get it merged before UnitaryHack
| self._frames = None | ||
| if noise_model: | ||
| self._validate_device_noise_model_support(noise_model) | ||
| self._noise_model = noise_model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validation still makes sense here
Issue #, if available:
qiskit-community/qiskit-braket-provider#89
Description of changes:
There are different ways to initiate a device beside initializing
AwsDevice, such as callingAwsDevice.get_devices(). In order to enable more general usage of adding noise model to a device, this PR add aset_noise_modelmethod.set_noise_modelmethod to Device class.Testing done:
tox
Merge Checklist
Put an
xin the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.