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

Make the device API not-experimental #4594

Merged
merged 11 commits into from
Sep 15, 2023
Merged

Make the device API not-experimental #4594

merged 11 commits into from
Sep 15, 2023

Conversation

timmysilv
Copy link
Contributor

@timmysilv timmysilv commented Sep 13, 2023

Context:
DefaultQubit2 is the new DefaultQubit! Let us name it accordingly.

Description of the Change:

  1. Rename the existing DefaultQubit to DefaultQubitLegacy
  2. Move the contents of pennylane/devices/experimental into pennylane/devices
  3. Rename DefaultQubit2 to DefaultQubit

Notes/Follow-up:

  • The short names for DQL and DQ2 are still default.qubit and default.qubit.2 respectively, and default.qubit still results in DQL. I will make that switch in another PR.
  • Some test files still need moving/renaming, but I'll do that in another PR. All files for DQ2 should be at the higher level, and all DQL files should be in a legacy folder with a legacy suffix, so that's next.

To be extra clear about what's happened:

  • the old device API is still qml.Device
  • the new device API is now qml.devices.Device
  • If called directly, qml.devices.DefaultQubit return DQ2. qml.devices.DefaultQubitLegacy returns DQL

Benefits:
The Device API is no longer experimental! Will make the final switch much easier!

Possible Drawbacks:
I'm probably going to screw up merging this into mega-PR #4436

@timmysilv timmysilv changed the title Move experimental up Make the device API not-experimental Sep 13, 2023
doc/releases/changelog-dev.md Show resolved Hide resolved
tests/test_return_types_qnode.py Outdated Show resolved Hide resolved
@timmysilv timmysilv marked this pull request as ready for review September 13, 2023 21:03
@timmysilv timmysilv requested review from trbromley and a team September 13, 2023 21:03
@codecov
Copy link

codecov bot commented Sep 13, 2023

Codecov Report

Patch coverage: 99.82% and project coverage change: -0.01% ⚠️

Comparison is base (5d2742c) 99.64% compared to head (2ab6bd4) 99.64%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4594      +/-   ##
==========================================
- Coverage   99.64%   99.64%   -0.01%     
==========================================
  Files         376      375       -1     
  Lines       33340    33336       -4     
==========================================
- Hits        33221    33217       -4     
  Misses        119      119              
Files Changed Coverage Δ
pennylane/_qubit_device.py 99.43% <ø> (ø)
pennylane/devices/default_mixed.py 100.00% <ø> (ø)
pennylane/devices/device_api.py 98.59% <ø> (ø)
pennylane/devices/execution_config.py 100.00% <ø> (ø)
pennylane/devices/null_qubit.py 100.00% <ø> (ø)
pennylane/interfaces/jax_jit.py 100.00% <ø> (ø)
pennylane/transforms/specs.py 100.00% <ø> (ø)
pennylane/devices/default_qubit_legacy.py 99.71% <99.71%> (ø)
pennylane/debugging.py 100.00% <100.00%> (ø)
pennylane/devices/__init__.py 100.00% <100.00%> (ø)
... and 14 more

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

Copy link
Contributor

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

Thanks @timmysilv, I agree with the changes here.

doc/development/deprecations.rst Show resolved Hide resolved
pennylane/_qubit_device.py Outdated Show resolved Hide resolved
doc/development/deprecations.rst Outdated Show resolved Hide resolved
doc/development/plugins.rst Show resolved Hide resolved
pennylane/_qubit_device.py Outdated Show resolved Hide resolved
timmysilv and others added 2 commits September 14, 2023 10:12
@timmysilv
Copy link
Contributor Author

[sc-44916]

@timmysilv timmysilv merged commit c6ef610 into master Sep 15, 2023
39 checks passed
@timmysilv timmysilv deleted the move-experimental-up branch September 15, 2023 14:15
mudit2812 added a commit that referenced this pull request Sep 15, 2023
**Context:**
DefaultQubit2 is the new DefaultQubit! Let us name it accordingly.

**Description of the Change:**
1. Rename the existing `DefaultQubit` to `DefaultQubitLegacy`
2. Move the contents of `pennylane/devices/experimental` into
`pennylane/devices`
3. Rename `DefaultQubit2` to `DefaultQubit`

Notes/Follow-up:
- The short names for DQL and DQ2 are still `default.qubit` and
`default.qubit.2` respectively, and `default.qubit` still results in
DQL. I will make that switch in another PR.
- Some test files still need moving/renaming, but I'll do that in
another PR. All files for DQ2 should be at the higher level, and all DQL
files should be in a `legacy` folder with a `legacy` suffix, so that's
next.

To be extra clear about what's happened:
- the old device API is still `qml.Device`
- the new device API is now `qml.devices.Device`
- If called directly, `qml.devices.DefaultQubit` return DQ2.
`qml.devices.DefaultQubitLegacy` returns DQL

**Benefits:**
The Device API is no longer experimental! Will make the final switch
much easier!

**Possible Drawbacks:**
I'm probably going to screw up merging this into mega-PR #4436

---------

Co-authored-by: Mudit Pandey <mudit.pandey@xanadu.ai>
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

4 participants