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 PL-Lightning to support new features in PL #179

Merged
merged 6 commits into from
Nov 23, 2021

Conversation

maliasadi
Copy link
Member

@maliasadi maliasadi commented Nov 19, 2021

Context:
Current PL-Lightning is not compatible with new features in PL and as the result almost all gates and adjoint_jacobian tests are FAILED. This PR updates the PL-lightning along with all tests to support new features in PL.

Description of the Change:

  1. In PL, previously, op was defined as a list of operations' inits and this test function worked properly as values of op.num_params and op.num_wires were known for each operation. Now, with the recent updates, these values are not known and one must pass arguments a priori. Hence, each operation is being applied here with each op call without any needs on passing args and wires.
  2. In PL, JacobianTape (and all the other tape subclasses!) are being deprecated in favour of the functions in the qml.gradients subpackage.

These files are mainly updated:

  • lightning_qubit.py
  • tests/test_gates.py
  • tests/test_adjoint_jacobian.py

Benefits:
PL-Lightning is compatible with new features in PL and there shouldn't be any failed tests

Related GitHub Issues:
n/a

@maliasadi maliasadi requested a review from mlxd November 19, 2021 03:37
@github-actions
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.

@codecov
Copy link

codecov bot commented Nov 19, 2021

Codecov Report

Merging #179 (4e8e813) into master (cf4e47e) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 4e8e813 differs from pull request most recent head c073e10. Consider uploading reports for the commit c073e10 to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##            master      #179   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          182       184    +2     
=========================================
+ Hits           182       184    +2     
Impacted Files Coverage Δ
pennylane_lightning/lightning_qubit.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cf4e47e...c073e10. Read the comment docs.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 19, 2021

Test Report (C++) on Ubuntu

       1 files  ±0         1 suites  ±0   0s ⏱️ ±0s
   345 tests ±0     345 ✔️ ±0  0 💤 ±0  0 ±0 
1 919 runs  ±0  1 919 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit c073e10. ± Comparison against base commit cf4e47e.

♻️ This comment has been updated with latest results.

Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Nice one Ali. Just a few small questions

tests/test_adjoint_jacobian.py Show resolved Hide resolved
tests/test_adjoint_jacobian.py Show resolved Hide resolved
tests/test_adjoint_jacobian.py Show resolved Hide resolved
@mlxd mlxd self-requested a review November 23, 2021 09:28
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

💯 Great job @maliasadi

@maliasadi maliasadi merged commit 45e99b6 into master Nov 23, 2021
@maliasadi maliasadi deleted the lightning-test-fails-update-pl20-dev branch November 23, 2021 18:39
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.

3 participants