Skip to content

Support broadcasting in simulate and preprocess#4244

Merged
timmysilv merged 12 commits intomasterfrom
simulate_broadcast
Jun 16, 2023
Merged

Support broadcasting in simulate and preprocess#4244
timmysilv merged 12 commits intomasterfrom
simulate_broadcast

Conversation

@eddddddy
Copy link
Copy Markdown
Contributor

To be merged after #4238

Context:
Part of the development of the new qubit device in PennyLane.

Description of the Change:
Support broadcasting in the simulate function and in the preprocessing functions in devices/qubit/preprocess.py. Built-in PennyLane broadcasting will now used when executing qscripts in the new device, unless the execution config specifies gradient_method="adjoint", in which case qml.transforms.broadcast_expand will still be used to split executions.

@github-actions
Copy link
Copy Markdown
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
Copy Markdown

codecov bot commented Jun 13, 2023

Codecov Report

Merging #4244 (66e9471) into master (fae4714) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4244   +/-   ##
=======================================
  Coverage   99.79%   99.79%           
=======================================
  Files         352      352           
  Lines       31983    32012   +29     
=======================================
+ Hits        31916    31945   +29     
  Misses         67       67           
Impacted Files Coverage Δ
pennylane/devices/qubit/preprocess.py 100.00% <100.00%> (ø)
pennylane/devices/qubit/simulate.py 100.00% <100.00%> (ø)
pennylane/ops/functions/bind_new_parameters.py 100.00% <100.00%> (ø)

@timmysilv timmysilv added this to the v0.31 milestone Jun 15, 2023
@timmysilv timmysilv requested a review from a team June 15, 2023 15:31
Copy link
Copy Markdown
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 to me! I left a non-blocking suggestion.

Base automatically changed from state_measure_broadcast to master June 16, 2023 00:15
@eddddddy
Copy link
Copy Markdown
Contributor Author

[sc-40107]

@timmysilv timmysilv added the merge-ready ✔️ All tests pass and the PR is ready to be merged. label Jun 16, 2023
@timmysilv timmysilv enabled auto-merge (squash) June 16, 2023 21:20
@timmysilv timmysilv merged commit 9256e47 into master Jun 16, 2023
@timmysilv timmysilv deleted the simulate_broadcast branch June 16, 2023 21:48
frederikwilde pushed a commit that referenced this pull request Jul 5, 2023
* Support broadcasting in state measurements

* docs for is_state_batched

* Support broadcasting in sample measurements

* Support broadcastingin simulate and preprocess

---------

Co-authored-by: Matthew Silverman <matthews@xanadu.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-ready ✔️ All tests pass and the PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants