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

Make Optimize1qGatesSimpleCommuation and Optimize1qGatesDecomposition passes Target aware #7990

Closed

Conversation

TheGupta2012
Copy link
Contributor

Summary

Make Optimize1qGatesSimpleCommuation (O1QC) and Optimize1qGatesDecomposition (O1QD) passes Target aware, in continuation of #7113

Details and comments

  • This PR tries to make the above passes target aware by introducing target as a parameter

Optimize1qGatesSimpleCommuation

  • O1QC did not have any direct dependence to the target (as far as I could figure out) but depended indirectly through O1QD

Optimize1qGatesDecomposition

  • In O1QD, three major changes were introduced -
    • In the constructor, decomposers were checked for the target.operation_names instead of the basis_set. This is beacuse if target was provided, then decomposition was required for the operations supported by it.
    • In _substitution_checks, gates were checked for whether they were supported by target or not as target support should supersede the basis_set
    • In run method, again check for the optimization of u3 gate was changed. It included check for whether the qubit on which u3 was being performed, whether it was supported by target or not. If it was, then relevant optimization was done including some additional checks for u1 and u2 gates.

Note

  • The test for the changes hasn't been added yet as I wasn't exactly sure if this was the correct way to do the target introduction. Would love to know if this was somewhat correct or not!

@TheGupta2012 TheGupta2012 requested a review from a team as a code owner April 27, 2022 11:45
@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:

  • @Qiskit/terra-core

@coveralls
Copy link

Pull Request Test Coverage Report for Build 2232867480

  • 31 of 44 (70.45%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.01%) to 84.315%

Changes Missing Coverage Covered Lines Changed/Added Lines %
qiskit/transpiler/passes/optimization/optimize_1q_commutation.py 5 6 83.33%
qiskit/transpiler/passes/optimization/optimize_1q_decomposition.py 25 37 67.57%
Totals Coverage Status
Change from base Build 2231814429: -0.01%
Covered Lines: 54538
Relevant Lines: 64684

💛 - Coveralls

@HuangJunye HuangJunye added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Jun 21, 2022
@mtreinish
Copy link
Member

Thanks for opening this, I apologize that it sat for so long without review. I know we talked about this PR offline together and discussed some changes to be made but I never circled back to check on the status, which is my bad. In the meantime another PR implementing the same thing was recently opened in #8917 and I think is taking a better approach for making these passes target aware, including factoring in the error rates as the selection heuristic. So I'm going to close this PR as I feel it's been superseded by #8917 now. But, please feel free to re-open this if you disagree or I'm missing something and we can continue to discuss it.

@mtreinish mtreinish closed this Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community PR PRs from contributors that are not 'members' of the Qiskit repo
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants