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

Allow tensor batching in numerical representations of Operators #2535

Closed
wants to merge 21 commits into from

Conversation

dwierichs
Copy link
Contributor

This is one of multiple PRs that together introduce the capability of tensor-batching, which enables execution of circuits with parameters that have a (single) batch dimension.

  • In this PR, we mostly adapt the Operator and Operation base classes as well as methods related to matrix and eigenvalue representations to handle a batch dimension properly.
  • This does not include the operations in ops/qubit/qchem_ops.py yet.
  • The operations that explicitly support tensor batching are collected in qml.ops.qubit.attributes.supports_tensorbatching.
  • operation labels do not work properly yet with batched parameters, the parameters are skipped in this case.
  • This PR in particular does not modify any device, so that no tensor-batching can be used at circuit level yet.

[sc-18891]

@dwierichs dwierichs changed the title Allow tensor batching in operations Allow tensor batching in numerical representations of Operators May 3, 2022
@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #2535 (fb1b5b9) into parameter-broadcasting-1 (8960bbb) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@                    Coverage Diff                    @@
##           parameter-broadcasting-1    #2535   +/-   ##
=========================================================
  Coverage                     99.58%   99.58%           
=========================================================
  Files                           244      244           
  Lines                         19677    19750   +73     
=========================================================
+ Hits                          19596    19669   +73     
  Misses                           81       81           
Impacted Files Coverage Δ
pennylane/operation.py 96.90% <100.00%> (+0.06%) ⬆️
pennylane/ops/functions/matrix.py 100.00% <100.00%> (ø)
pennylane/ops/qubit/attributes.py 100.00% <100.00%> (ø)
pennylane/ops/qubit/matrix_ops.py 100.00% <100.00%> (ø)
pennylane/ops/qubit/parametric_ops.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 8960bbb...fb1b5b9. Read the comment docs.

@dwierichs dwierichs requested a review from josh146 May 10, 2022 19:09
@josh146 josh146 removed their request for review May 14, 2022 17:20
@josh146
Copy link
Member

josh146 commented May 14, 2022

@dwierichs as discussed I removed my review here; simply re-tag me when you think it is ready for review again :)

@dwierichs dwierichs changed the base branch from master to parameter-broadcasting-1 May 23, 2022 16:48
@dwierichs
Copy link
Contributor Author

Superseded by #2609 .

@dwierichs dwierichs closed this May 24, 2022
@trbromley trbromley deleted the tensor-batching branch March 4, 2024 14:12
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