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

Fix copying the Select template #4551

Merged
merged 9 commits into from Sep 13, 2023
Merged

Fix copying the Select template #4551

merged 9 commits into from Sep 13, 2023

Conversation

DSGuala
Copy link
Contributor

@DSGuala DSGuala commented Aug 29, 2023

Context:
qml.Select could not be copied with copy.copy(qml.Select(...)), resulting in errors with qml.qsvt.

Description of the Change:
Overrode the __copy__ function in qml.Select

Benefits:
Allows qml.Select to be used with qml.qsvt more easily and allows it to be copied.

Possible Drawbacks:
Changes to __copy__ in the base Operator class will no longer affect qml.Select

@DSGuala DSGuala requested a review from Jaybsoni August 29, 2023 20:39
@codecov
Copy link

codecov bot commented Aug 29, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (6ca294c) 99.64% compared to head (2ca4398) 99.64%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4551   +/-   ##
=======================================
  Coverage   99.64%   99.64%           
=======================================
  Files         376      376           
  Lines       33249    33259   +10     
=======================================
+ Hits        33130    33140   +10     
  Misses        119      119           
Files Changed Coverage Δ
pennylane/templates/subroutines/select.py 100.00% <100.00%> (ø)

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

Copy link
Contributor

@Jaybsoni Jaybsoni 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 go with a few small changes

Copy link
Contributor

@obliviateandsurrender obliviateandsurrender left a comment

Choose a reason for hiding this comment

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

:shipit:

@DSGuala DSGuala merged commit 99b4856 into master Sep 13, 2023
39 checks passed
@DSGuala DSGuala deleted the fix_select_copy branch September 13, 2023 21:20
mudit2812 pushed a commit that referenced this pull request Sep 15, 2023
**Context:**
`qml.Select` could not be copied with `copy.copy(qml.Select(...))`,
resulting in errors with `qml.qsvt`.

**Description of the Change:**
Overrode the `__copy__` function in `qml.Select`

**Benefits:**
Allows `qml.Select` to be used with `qml.qsvt` more easily and allows it
to be copied.

**Possible Drawbacks:**
Changes to `__copy__` in the base `Operator` class will no longer affect
`qml.Select`

---------

Co-authored-by: Jay Soni <jbsoni@uwaterloo.ca>
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