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

[QInfo broadcasting (1/3)] Support for qml.math density matrix functions #4173

Merged
merged 14 commits into from
May 26, 2023

Conversation

eddddddy
Copy link
Contributor

Currently the quantum information functions in qml.math and the QNode transforms in qml.qinfo do not support broadcasting. Support for this will be added in a sequence of 3 PRs, of which this is the first. The individual aims of the PRs are roughly:

  1. (current) Split qml.math.reduced_dm into two functions, qml.math.reduced_dm_from_sv and qml.math.reduced_dm_from_dm, each of which supports broadcasting. Also begin a deprecation cycle for qml.math.reduced_dm.
  2. Support broadcasting for each of the remaining quantum info functions in qml.math. Also change their signatures to accept only a density matrix, and begin a deprecation cycle for passing in state vectors.
  3. Support broadcasting for the qml.qinfo QNode transforms.

@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.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 May 25, 2023

Codecov Report

Merging #4173 (1af71bf) into master (233eec7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4173   +/-   ##
=======================================
  Coverage   99.77%   99.77%           
=======================================
  Files         340      340           
  Lines       30566    30595   +29     
=======================================
+ Hits        30496    30525   +29     
  Misses         70       70           
Impacted Files Coverage Δ
pennylane/math/__init__.py 100.00% <ø> (ø)
pennylane/_qubit_device.py 99.29% <100.00%> (ø)
pennylane/devices/default_mixed.py 100.00% <100.00%> (ø)
pennylane/math/quantum.py 100.00% <100.00%> (ø)
pennylane/measurements/state.py 100.00% <100.00%> (ø)
pennylane/qinfo/transforms.py 100.00% <100.00%> (ø)

@eddddddy eddddddy added the review-ready 👌 PRs which are ready for review by someone from the core team. label May 25, 2023
@eddddddy eddddddy requested review from a team and dwierichs May 26, 2023 13:47
Copy link
Contributor

@timmysilv timmysilv left a comment

Choose a reason for hiding this comment

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

looks great! just a couple of comments

pennylane/math/quantum.py Outdated Show resolved Hide resolved
pennylane/qinfo/transforms.py Outdated Show resolved Hide resolved
Copy link
Contributor

@mudit2812 mudit2812 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. I think the ongoing discussions should be finished before merging to clear up the roadmap for the broadcasting and potential DensityMatrixMP changes, but otherwise this PR looks merge-ready to me beyond non-blocking suggestions.

pennylane/math/quantum.py Outdated Show resolved Hide resolved
pennylane/qinfo/transforms.py Outdated Show resolved Hide resolved
Co-authored-by: Christina Lee <christina@xanadu.ai>
pennylane/math/quantum.py Outdated Show resolved Hide resolved
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.

Thanks !

Copy link
Contributor

@timmysilv timmysilv left a comment

Choose a reason for hiding this comment

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

thanks!

@eddddddy eddddddy enabled auto-merge (squash) May 26, 2023 21:08
@eddddddy eddddddy merged commit 6ab9dda into master May 26, 2023
@eddddddy eddddddy deleted the dm_broadcast branch May 26, 2023 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready 👌 PRs which are ready for review by someone from the core team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants