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 wires to device api #4538

Merged
merged 10 commits into from
Aug 30, 2023
Merged

Add wires to device api #4538

merged 10 commits into from
Aug 30, 2023

Conversation

timmysilv
Copy link
Contributor

@timmysilv timmysilv commented Aug 28, 2023

Context:
The new device API does not currently accept wires, but users (and thousands, if not millions of tests) have grown to expect it.

Description of the Change:

  • Add device wires as an optional property to the new device API. If nothing is given, dev.wires will be None

Benefits:

  • The new device API is more user-friendly
  • It will be much much easier to port tests to the new default.qubit
  • This will probably be needed for qml.state() + DQ2 improvements coming soon

Possible Drawbacks:
N/A

@timmysilv timmysilv requested a review from a team August 28, 2023 20:53
@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@codecov
Copy link

codecov bot commented Aug 28, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (a6dc1be) 99.66% compared to head (e850d14) 99.66%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4538   +/-   ##
=======================================
  Coverage   99.66%   99.66%           
=======================================
  Files         376      376           
  Lines       33060    33070   +10     
=======================================
+ Hits        32950    32960   +10     
  Misses        110      110           
Files Changed Coverage Δ
pennylane/devices/experimental/default_qubit_2.py 100.00% <100.00%> (ø)
pennylane/devices/experimental/device_api.py 98.46% <100.00%> (+0.27%) ⬆️

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

@timmysilv
Copy link
Contributor Author

I think codecov is comparing against the wrong base?

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!

tests/test_qnode.py Outdated Show resolved Hide resolved
@timmysilv timmysilv changed the title Add wires to device api; add wires property to QNode Add wires to device api Aug 29, 2023
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.

All things old are new again. But at least optional 🤷

@timmysilv timmysilv enabled auto-merge (squash) August 30, 2023 15:47
@timmysilv timmysilv merged commit 90f09d4 into master Aug 30, 2023
39 checks passed
@timmysilv timmysilv deleted the add-wires-to-device-api branch August 30, 2023 16:19
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

5 participants