Skip to content

Conversation

@yitchen-tim
Copy link
Contributor

@yitchen-tim yitchen-tim commented Feb 22, 2024

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 calling AwsDevice.get_devices(). In order to enable more general usage of adding noise model to a device, this PR add a set_noise_model method.

  • Add set_noise_model method to Device class.
  • Add tests and repurpose some tests.

Testing done:
tox

Merge Checklist

Put an x in 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

  • I have added tests that prove my fix is effective or that my feature works (if appropriate)
  • I have checked that my tests are not configured for a specific region or account (if appropriate)

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@yitchen-tim yitchen-tim requested a review from a team as a code owner February 22, 2024 21:18
@codecov
Copy link

codecov bot commented Feb 22, 2024

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (a76c4e2) to head (c0ea894).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 127 to 129
if noise_model:
self._validate_device_noise_model_support(noise_model)
self._noise_model = noise_model
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated!

Copy link
Contributor Author

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
Copy link
Member

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

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.

2 participants