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

FIx 0q operation handling in Statevector #10031

Merged
merged 1 commit into from
Apr 25, 2023

Conversation

jakelishman
Copy link
Member

Summary

The root of the problem was the OpShape producing a "vector-like" shape if it detected that "input size" was 1. If both the input and output dimension are 1, it is instead a 0q operator (scalar).

Details and comments

Fix #10012

The root of the problem was the `OpShape` producing a "vector-like"
shape if it detected that "input size" was 1.  If both the input and
output dimension are 1, it is instead a 0q operator (scalar).
@jakelishman jakelishman added stable backport potential The bug might be minimal and/or import enough to be port to stable Changelog: Bugfix Include in the "Fixed" section of the changelog labels Apr 25, 2023
@jakelishman jakelishman added this to the 0.24.0 milestone Apr 25, 2023
@jakelishman jakelishman requested review from a team and ikkoham as code owners April 25, 2023 15:41
@qiskit-bot
Copy link
Collaborator

Thank you for opening a new pull request.

Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient.

While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone.

One or more of the the following people are requested to review this:

@coveralls
Copy link

Pull Request Test Coverage Report for Build 4799459941

  • 2 of 2 (100.0%) changed or added relevant lines in 1 file are covered.
  • 15 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.01%) to 85.848%

Files with Coverage Reduction New Missed Lines %
qiskit/transpiler/passes/synthesis/unitary_synthesis.py 1 95.37%
crates/qasm2/src/lex.rs 2 91.14%
crates/qasm2/src/parse.rs 12 96.65%
Totals Coverage Status
Change from base Build 4791194653: -0.01%
Covered Lines: 70661
Relevant Lines: 82309

💛 - Coveralls

Copy link
Member

@mtreinish mtreinish left a comment

Choose a reason for hiding this comment

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

LGTM, this seems straightforward to me.

@mtreinish mtreinish added this pull request to the merge queue Apr 25, 2023
Merged via the queue into Qiskit:main with commit a3aa3aa Apr 25, 2023
mergify bot pushed a commit that referenced this pull request Apr 25, 2023
The root of the problem was the `OpShape` producing a "vector-like"
shape if it detected that "input size" was 1.  If both the input and
output dimension are 1, it is instead a 0q operator (scalar).

(cherry picked from commit a3aa3aa)
jakelishman added a commit that referenced this pull request Apr 26, 2023
The root of the problem was the `OpShape` producing a "vector-like"
shape if it detected that "input size" was 1.  If both the input and
output dimension are 1, it is instead a 0q operator (scalar).

(cherry picked from commit a3aa3aa)

Co-authored-by: Jake Lishman <jake.lishman@ibm.com>
@jakelishman jakelishman deleted the fix-0q-statevector branch May 16, 2023 10:05
king-p3nguin pushed a commit to king-p3nguin/qiskit-terra that referenced this pull request May 22, 2023
The root of the problem was the `OpShape` producing a "vector-like"
shape if it detected that "input size" was 1.  If both the input and
output dimension are 1, it is instead a 0q operator (scalar).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: Bugfix Include in the "Fixed" section of the changelog stable backport potential The bug might be minimal and/or import enough to be port to stable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GlobalPhaseGate generates an error when trying to generate Statevector
4 participants