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

Improved Documentation and Error-Signaling of VF2PostLayout #11090

Merged
merged 5 commits into from
Nov 3, 2023

Conversation

sbrandhsn
Copy link
Contributor

Summary

Fixes #11089 as discussed with @mtreinish

Details and comments

VF2PostLayout does not return a solution when presented with an already ideal initial layout for a quantum circuit. This PR extends the VF2PostLayout pass by a 'no better solution found' error code for these situations and changes the documentation accordingly.

@sbrandhsn sbrandhsn requested a review from a team as a code owner October 23, 2023 14:32
@qiskit-bot qiskit-bot added the Community PR PRs from contributors that are not 'members' of the Qiskit repo label Oct 23, 2023
@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

@CLAassistant
Copy link

CLAassistant commented Oct 23, 2023

CLA assistant check
All committers have signed the CLA.

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.

Thanks for looking at this! Please could you also add a release note with an "upgrade" note that explains that VF2PostLayout now distinguishes the cases of "nothing better" and "no solution"?

qiskit/transpiler/passes/layout/vf2_post_layout.py Outdated Show resolved Hide resolved
@jakelishman jakelishman added Changelog: API Change Include in the "Changed" section of the changelog mod: transpiler Issues and PRs related to Transpiler and removed Community PR PRs from contributors that are not 'members' of the Qiskit repo labels Oct 23, 2023
@jakelishman jakelishman added this to the 1.0.0 milestone Oct 23, 2023
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.

Sorry for the really long delay in coming back to this (and my misreading of what you'd done in the prior review!). The code looks good to merge to me, I just had a minor comment about the release note.

Comment on lines 4 to 6
VF2PostLayout no distinguishes between 'no solution' and 'no better solution' when determining a
Layout for a given quantum circuit. 'no better solution' is set when the initial layout of a quantum
circuit is also the optimal one, i.e. incurs the least cost in terms of error rates.
Copy link
Member

Choose a reason for hiding this comment

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

Minor: VF2PostLayout and Layout would best as Sphinx cross-references, so users can click them and jump to the full documentation on them. The syntax looks like this:

Suggested change
VF2PostLayout no distinguishes between 'no solution' and 'no better solution' when determining a
Layout for a given quantum circuit. 'no better solution' is set when the initial layout of a quantum
circuit is also the optimal one, i.e. incurs the least cost in terms of error rates.
:class:`.VF2PostLayout` no distinguishes between 'no solution' and 'no better solution' when determining a
:class:`.Layout` for a given quantum circuit. 'no better solution' is set when the initial layout of a quantum
circuit is also the optimal one, i.e. incurs the least cost in terms of error rates.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, I changed it, thanks for the feedback on the release note! :)

@brandhsn
Copy link
Contributor

brandhsn commented Nov 3, 2023

No worries! Thanks for your input, I changed the release notes!

@coveralls
Copy link

Pull Request Test Coverage Report for Build 6743723348

Warning: This coverage report may be inaccurate.

We've detected an issue with your CI configuration that might affect the accuracy of this pull request's coverage report.
To ensure accuracy in future PRs, please see these guidelines.
A quick fix for this PR: rebase it; your next report should be accurate.

  • 6 of 6 (100.0%) changed or added relevant lines in 1 file are covered.
  • 1980 unchanged lines in 132 files lost coverage.
  • Overall coverage increased (+0.002%) to 86.9%

Files with Coverage Reduction New Missed Lines %
qiskit/algorithms/evolvers/real_evolver.py 1 92.31%
qiskit/algorithms/minimum_eigen_solvers/minimum_eigen_solver.py 1 97.78%
qiskit/algorithms/phase_estimators/phase_estimation_result.py 1 96.36%
qiskit/circuit/classicalregister.py 1 90.48%
qiskit/circuit/quantumregister.py 1 93.33%
qiskit/opflow/converters/converter_base.py 1 91.67%
qiskit/opflow/evolutions/evolution_base.py 1 92.31%
qiskit/opflow/expectations/matrix_expectation.py 1 96.15%
qiskit/opflow/gradients/circuit_qfis/circuit_qfi.py 1 93.33%
qiskit/opflow/gradients/gradient_base.py 1 96.15%
Totals Coverage Status
Change from base Build 6612358367: 0.002%
Covered Lines: 74044
Relevant Lines: 85206

💛 - 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.

Thanks for the changes!

@jakelishman jakelishman added this pull request to the merge queue Nov 3, 2023
@jakelishman jakelishman added Changelog: New Feature Include in the "Added" section of the changelog and removed Changelog: API Change Include in the "Changed" section of the changelog labels Nov 3, 2023
@jakelishman jakelishman modified the milestones: 1.0.0, 1.0.0pre1 Nov 3, 2023
Merged via the queue into Qiskit:main with commit 8d77517 Nov 3, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the "Added" section of the changelog mod: transpiler Issues and PRs related to Transpiler
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Expected Output of VF2PostLayout
6 participants