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

Validate wires on circuit before executing on new device; add repr to new device #4562

Merged
merged 5 commits into from
Sep 1, 2023

Conversation

timmysilv
Copy link
Contributor

Context:
There are some little things that would be nice to have on the new device. Here are 2 of them.

Description of the Change:

  • If DQ2 has wires set on it, make sure all circuits running on the device only use those wires
  • Added a device repr similar to the old device. The only difference is that if wires or shots are None, I exclude them from the repr. And if they are both None, then I hide the whole parenthesis component of details.

Benefits:

  • The new device can't mistakenly run circuits that it shouldn't be able to
  • Users see a more meaningful repr when printing a device

@timmysilv timmysilv requested a review from a team August 31, 2023 19:15
Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

Looks good to me 🎉

@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (930c558) 99.65% compared to head (7df0178) 99.65%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4562   +/-   ##
=======================================
  Coverage   99.65%   99.65%           
=======================================
  Files         376      376           
  Lines       33103    33114   +11     
=======================================
+ Hits        32990    33001   +11     
  Misses        113      113           
Files Changed Coverage Δ
pennylane/devices/experimental/default_qubit_2.py 100.00% <100.00%> (ø)
pennylane/devices/experimental/device_api.py 98.63% <100.00%> (+0.16%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

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

Some minor comments, but nothing blocking 👍

@timmysilv timmysilv enabled auto-merge (squash) September 1, 2023 14:20
@timmysilv timmysilv merged commit 8adc449 into master Sep 1, 2023
39 checks passed
@timmysilv timmysilv deleted the validate-wires-new-device branch September 1, 2023 14: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.

None yet

3 participants