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

Assert properties not specifics of DenseLayout results (backport #10901) #10907

Merged
merged 3 commits into from
Sep 29, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Sep 27, 2023

This is an automatic backport of pull request #10901 done by Mergify.


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

`DenseLayout` is a deterministic pass, so there's no risk of RNG
manipulations changing the output.  Internally, however, the use of the
sparse-matrix bandwidth-reduction algorithm in Scipy's
`reverse_cuthill_mckee` uses `numpy.argsort` internally with the
unstable default sorting algorithm, which means the output _can_ be
dependent on the way that sort is implemented.  The arrays that are
sorted are directly related to the input coupling map, and are likely to
include degeneracies, which pose problems when the implementation of the
unstable sort changes.  This was the case moving from Numpy 1.24 to
Numpy 1.25.

This commit instead changes the tests from asserting that a precise
layout was returned to asserting that the returned layout contains only
a connected subgraph of qubits.  The "most" connected component that
`DenseLayout` finds must be _at least_ connected, though this assertion
is not quite as strong as finding the _densest_.  The extra test
accounts for this weakening.

(cherry picked from commit 0f66cdf)
@mergify mergify bot requested a review from a team as a code owner September 27, 2023 18:27
@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

@github-actions github-actions bot added type: qa Issues and PRs that relate to testing and code quality Changelog: None Do not include in changelog labels Sep 27, 2023
@github-actions github-actions bot added this to the 0.25.2 milestone Sep 27, 2023
jakelishman
jakelishman previously approved these changes Sep 27, 2023
@1ucian0 1ucian0 modified the milestones: 0.25.2, 0.25.3 Sep 28, 2023
jakelishman
jakelishman previously approved these changes Sep 29, 2023
@coveralls
Copy link

coveralls commented Sep 29, 2023

Pull Request Test Coverage Report for Build 6355449092

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 11 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.003%) to 87.25%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/expr.rs 1 93.76%
crates/qasm2/src/lex.rs 4 90.66%
crates/qasm2/src/parse.rs 6 97.6%
Totals Coverage Status
Change from base Build 6283029946: -0.003%
Covered Lines: 74128
Relevant Lines: 84960

💛 - Coveralls

@jakelishman jakelishman added this pull request to the merge queue Sep 29, 2023
Merged via the queue into stable/0.25 with commit f03e430 Sep 29, 2023
@mergify mergify bot deleted the mergify/bp/stable/0.25/pr-10901 branch September 29, 2023 21:21
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 type: qa Issues and PRs that relate to testing and code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants