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

Support parameter broadcasting with GlobalPhase #5923

Merged
merged 6 commits into from
Jul 30, 2024
Merged

Conversation

dwierichs
Copy link
Contributor

@dwierichs dwierichs commented Jul 1, 2024

Context:
GlobalPhase does not support broadcasting yet.

Description of the Change:
Introduce broadcasting to GlobalPhase, using the code from PauliRot with set(pauli_word) == {"I"}.
The latter falls back to the GlobalPhase implementation.

Also fixes a small bug where the global phase returned by one_qubit_decomposition gains a broadcasting dimension even if the input matrix does not have one.

Benefits:
Broadcasting support & Bug fix
Unlocks #4460

Possible Drawbacks:

Related GitHub Issues:
Implements #5815
Fixes #5880

[sc-65316]

Copy link

codecov bot commented Jul 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.65%. Comparing base (20eed81) to head (096312a).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #5923    +/-   ##
========================================
  Coverage   99.65%   99.65%            
========================================
  Files         430      430            
  Lines       41505    41213   -292     
========================================
- Hits        41362    41072   -290     
+ Misses        143      141     -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dwierichs dwierichs added the review-ready 👌 PRs which are ready for review by someone from the core team. label Jul 1, 2024
@trbromley trbromley requested a review from a team July 29, 2024 13:32
@dwierichs dwierichs requested a review from a team July 29, 2024 19:00
@Alex-Preciado Alex-Preciado requested review from astralcai and removed request for a team July 29, 2024 19:20
Copy link
Contributor

@astralcai astralcai 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, sorry about missing the part where broadcasting is tested for matrix.

@dwierichs dwierichs enabled auto-merge (squash) July 30, 2024 07:50
@dwierichs dwierichs merged commit 0515647 into master Jul 30, 2024
40 checks passed
@dwierichs dwierichs deleted the broadcast-gphase branch July 30, 2024 08:28
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.

[BUG] Calculating the matrix of a broadcasted GlobalPhase with wires
3 participants