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

update usages of ControlledQubitUnitary in tests #1047

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

JerryChen97
Copy link
Contributor

@JerryChen97 JerryChen97 commented Jan 23, 2025

Context:
Due to the deprecations of ControlledQubitUnitary input args PennyLaneAI/pennylane#6839 PennyLaneAI/pennylane#6840, we need to update several tests of lightning that use deprecated interfaces.

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:
[sc-80842]

Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.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.

@JerryChen97 JerryChen97 self-assigned this Jan 23, 2025
@JerryChen97 JerryChen97 added the do not merge Do not merge PR until this label is removed label Jan 23, 2025
@JerryChen97
Copy link
Contributor Author

Do not merge, until the PL deprecation PR's 6839 6840 get merged

Copy link

codecov bot commented Jan 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.36%. Comparing base (25e6517) to head (58890f5).

❗ There is a different number of reports uploaded between BASE (25e6517) and HEAD (58890f5). Click for more details.

HEAD has 9 uploads less than BASE
Flag BASE (25e6517) HEAD (58890f5)
13 4
Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1047       +/-   ##
===========================================
- Coverage   97.15%   27.36%   -69.79%     
===========================================
  Files         233       29      -204     
  Lines       39079     2646    -36433     
===========================================
- Hits        37966      724    -37242     
- Misses       1113     1922      +809     

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

@JerryChen97
Copy link
Contributor Author

@AmintorDusko Here I investigated the ControlledQubitUnitary occurences that will be affected soon after PL merges the corresponding deprecations. Even though right now I marked it do-not-merge, still want to update with you incase similar urgent hotfix will be needed when the merge happens.

Current test fails are expected.

@JerryChen97 JerryChen97 requested a review from astralcai January 23, 2025 22:17
@@ -844,7 +844,7 @@ def test_cnot_controlled_qubit_unitary(self, control_wires, target_wires, tol, l
tape = qml.tape.QuantumScript(
[
qml.StatePrep(init_state, wires=range(n_qubits)),
qml.ControlledQubitUnitary(U, control_wires=control_wires, wires=target_wires),
qml.ControlledQubitUnitary(U, wires=control_wires+target_wires),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
qml.ControlledQubitUnitary(U, wires=control_wires+target_wires),
qml.ControlledQubitUnitary(U, wires=control_wires + target_wires),

@@ -450,8 +450,7 @@ def circuit():
qml.StatePrep(init_state, wires=range(n_qubits))
qml.ControlledQubitUnitary(
U,
control_wires=control_wires,
wires=target_wires,
wires=control_wires+target_wires,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
wires=control_wires+target_wires,
wires=control_wires + target_wires,

@@ -617,7 +616,7 @@ def test_cnot_controlled_qubit_unitary(control_wires, target_wires, tol):

def circuit():
qml.StatePrep(init_state, wires=range(n_qubits))
qml.ControlledQubitUnitary(U, control_wires=control_wires, wires=target_wires)
qml.ControlledQubitUnitary(U, wires=control_wires+target_wires)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
qml.ControlledQubitUnitary(U, wires=control_wires+target_wires)
qml.ControlledQubitUnitary(U, wires=control_wires + target_wires)

@AmintorDusko
Copy link
Contributor

Thank you @JerryChen97 for tagging me! We are evaluating the situation. cc: @tomlqc, @maliasadi

@AmintorDusko Here I investigated the ControlledQubitUnitary occurences that will be affected soon after PL merges the corresponding deprecations. Even though right now I marked it do-not-merge, still want to update with you incase similar urgent hotfix will be needed when the merge happens.

Current test fails are expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do not merge Do not merge PR until this label is removed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants