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

Deduplicate SliceOrInt #11844

Merged
merged 2 commits into from
Feb 21, 2024
Merged

Deduplicate SliceOrInt #11844

merged 2 commits into from
Feb 21, 2024

Conversation

mtreinish
Copy link
Member

Summary

After doing some post-merge analysis on the impact of #11842 it turns out the enum being modified in that PR was duplicated in the rust code unnecessarily. The same enum was already defined in the euler_one_qubit_decomposer module for it's custom 1 qubit gate sequence return type. This commit updates the code so it just use the one defined in the circuit data module that has the fix from #11842 applied already.

Details and comments

After doing some post-merge analysis on the impact of Qiskit#11842 it turns
out the enum being modified in that PR was duplicated in the rust code
unnecessarily. The same enum was already defined in the
euler_one_qubit_decomposer module for it's custom 1 qubit gate sequence
return type. This commit updates the code so it just use the one
defined in the circuit data module that has the fix from Qiskit#11842 applied
already.
@mtreinish mtreinish added stable backport potential The bug might be minimal and/or import enough to be port to stable performance Changelog: None Do not include in changelog Rust This PR or issue is related to Rust code in the repository labels Feb 20, 2024
@mtreinish mtreinish requested a review from a team as a code owner February 20, 2024 21:18
@qiskit-bot
Copy link
Collaborator

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

@coveralls
Copy link

coveralls commented Feb 20, 2024

Pull Request Test Coverage Report for Build 7990217158

Details

  • 0 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • 17 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.02%) to 89.284%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 5 92.19%
crates/qasm2/src/parse.rs 12 97.15%
Totals Coverage Status
Change from base Build 7979628151: -0.02%
Covered Lines: 58896
Relevant Lines: 65965

💛 - Coveralls

Copy link
Member

@jakelishman jakelishman left a comment

Choose a reason for hiding this comment

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

Shall we move this to shared object to a more central / less "owned" location, if we're going to use it in multiple places? cargo fmt's also complaining.

@mtreinish
Copy link
Member Author

Shall we move this to shared object to a more central / less "owned" location, if we're going to use it in multiple places? cargo fmt's also complaining.

Done in: 5c35995

Copy link
Member

@jakelishman jakelishman 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, thanks for spotting the duplication.

@jakelishman jakelishman added this pull request to the merge queue Feb 21, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Feb 21, 2024
@jakelishman jakelishman added this pull request to the merge queue Feb 21, 2024
Merged via the queue into Qiskit:main with commit 802ac51 Feb 21, 2024
11 of 12 checks passed
mergify bot pushed a commit that referenced this pull request Feb 21, 2024
* Deduplicate SliceOrInt

After doing some post-merge analysis on the impact of #11842 it turns
out the enum being modified in that PR was duplicated in the rust code
unnecessarily. The same enum was already defined in the
euler_one_qubit_decomposer module for it's custom 1 qubit gate sequence
return type. This commit updates the code so it just use the one
defined in the circuit data module that has the fix from #11842 applied
already.

* Move enum to common location

(cherry picked from commit 802ac51)
github-merge-queue bot pushed a commit that referenced this pull request Feb 21, 2024
* Deduplicate SliceOrInt

After doing some post-merge analysis on the impact of #11842 it turns
out the enum being modified in that PR was duplicated in the rust code
unnecessarily. The same enum was already defined in the
euler_one_qubit_decomposer module for it's custom 1 qubit gate sequence
return type. This commit updates the code so it just use the one
defined in the circuit data module that has the fix from #11842 applied
already.

* Move enum to common location

(cherry picked from commit 802ac51)

Co-authored-by: Matthew Treinish <mtreinish@kortar.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: None Do not include in changelog performance Rust This PR or issue is related to Rust code in the repository 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.

4 participants