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

Deprecate QauntumScript.output_dim #6577

Merged
merged 29 commits into from
Nov 14, 2024
Merged

Conversation

JerryChen97
Copy link
Contributor

@JerryChen97 JerryChen97 commented Nov 12, 2024

Context:
This property is now slightly wrong, and is only used by parameter_shift_cv.py.
Description of the Change:

  • Deprecated the property in the original src, qml.tape.qscript.py::QuantumScript
  • DeprecateWarning the tests in test_qscript.py
  • Removed the tests in test_tape.py and test_legacy_device.py
  • Modified the original method and moved to qml.gradients.parameter_shift_cv.py which is the only module using this property

Benefits:

  • Less redundancy

Possible Drawbacks:
Potential uncovered usecases of this property inside or outside PL

Related GitHub Issues:

Related Shortcut Stories:
[sc-74594]

@JerryChen97 JerryChen97 self-assigned this Nov 12, 2024
@JerryChen97 JerryChen97 marked this pull request as ready for review November 12, 2024 22:21
@JerryChen97 JerryChen97 requested a review from albi3ro November 12, 2024 22:21
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.29%. Comparing base (51c1436) to head (8d0897b).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6577   +/-   ##
=======================================
  Coverage   99.29%   99.29%           
=======================================
  Files         454      454           
  Lines       43262    43264    +2     
=======================================
+ Hits        42959    42961    +2     
  Misses        303      303           

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

tests/tape/test_qscript.py Outdated Show resolved Hide resolved
@lillian542 lillian542 self-requested a review November 13, 2024 15:28
@JerryChen97
Copy link
Contributor Author

@albi3ro @lillian542

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.

❤️

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!

@Alex-Preciado Alex-Preciado enabled auto-merge (squash) November 14, 2024 20:41
@Alex-Preciado Alex-Preciado merged commit a0e69cc into master Nov 14, 2024
46 checks passed
@Alex-Preciado Alex-Preciado deleted the Depr-QuantumScript.output_dim branch November 14, 2024 22:07
JerryChen97 added a commit that referenced this pull request Jan 15, 2025
**Context:**
The property `output_dim` of `QuantumScript` has been deprecated in
previous round, [sc-74594]
#6577. Now we would love to
remove it entirely.

**Description of the Change:**
 - Remove property `output_dim` along with its tests, warnings, etc.
 - Remove the detached attribute `_output_dim` after previous removal.
- Remove the detached private method `_update_output_dim` which used to
be strictly only helping update property `output_dim`.

**Benefits:**
Cleaner codebase with less redundancies.

**Possible Drawbacks:**
Not known. Perhaps some nuances hidden in some uncovered cornercase
tests. Anyways potential drawback won't affect any current feature in
principle.

**Related GitHub Issues:**
[sc-82150]

---------

Co-authored-by: lillian542 <[email protected]>
willjmax pushed a commit that referenced this pull request Feb 4, 2025
**Context:**
The property `output_dim` of `QuantumScript` has been deprecated in
previous round, [sc-74594]
#6577. Now we would love to
remove it entirely.

**Description of the Change:**
 - Remove property `output_dim` along with its tests, warnings, etc.
 - Remove the detached attribute `_output_dim` after previous removal.
- Remove the detached private method `_update_output_dim` which used to
be strictly only helping update property `output_dim`.

**Benefits:**
Cleaner codebase with less redundancies.

**Possible Drawbacks:**
Not known. Perhaps some nuances hidden in some uncovered cornercase
tests. Anyways potential drawback won't affect any current feature in
principle.

**Related GitHub Issues:**
[sc-82150]

---------

Co-authored-by: lillian542 <[email protected]>
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.

4 participants