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

Add support for LinearCombination #649

Merged
merged 338 commits into from
Mar 27, 2024
Merged

Conversation

mudit2812
Copy link
Contributor

@mudit2812 mudit2812 commented Mar 19, 2024

Context:
PennyLane is switching to the new Operator Arithmetic as the default. This PR updates Lightning to be compatible with this change.

Description of the Change:

  • Update QuantumScriptSerializer to be smarter with new op math, and to accommodate LinearCombination.
  • Update tests with new fixtures that run tests on both new and old op arithmetic
  • Add support to all devices for detecting Projectors in Sum, Prod, and SProd instances when validating for adjoint diff. This function was the same between LKokkos and LGPU, so I moved this logic to LightningBase.

Benefits:
New op math as the default works with Lightning.

Possible Drawbacks:
Serialization with new op math has some weird nesting. Will be addressed in a follow up PR.

Related GitHub Issues:

Related work in PennyLane:
#5335, #5216, #5269

@mudit2812
Copy link
Contributor Author

cmake had to be pinned due to issues with the latest release. See these commits to see which files were changed and would need to be unpinned eventually.

@maliasadi maliasadi mentioned this pull request Mar 26, 2024
5 tasks
@mudit2812 mudit2812 requested a review from maliasadi March 26, 2024 19:07
Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

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

Nice work @mudit2812!

* Comment triggers.

* pytest -x

* trigger ci

* Do not skip comp for LQ.

* Revert triggers

* Revert changes
@mudit2812 mudit2812 merged commit 044ffe8 into master Mar 27, 2024
87 checks passed
@mudit2812 mudit2812 deleted the feature/linear-combination branch March 27, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:build_wheels Activate wheel building. ci:use-multi-gpu-runner Enable usage of Multi-GPU runner for this Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants