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

Document generate_preset_pass_manager supports list for initial_layout #12214

Merged

Conversation

mtreinish
Copy link
Member

Summary

This commit updates the documentation for the
generate_preset_pass_manager() function to clearly indicate that the function will accept a integer list for the initial_layout field. This already was supported but it wasn't documented. As it's now a documented part of the API a unittest is added to ensure we don't regress this functionality in the future.

Details and comments

Fixes #11690

This commit updates the documentation for the
generate_preset_pass_manager() function to clearly indicate that the
function will accept a integer list for the initial_layout field. This
already was supported but it wasn't documented. As it's now a documented
part of the API a unittest is added to ensure we don't regress this
functionality in the future.

Fixes Qiskit#11690
@mtreinish mtreinish added documentation Something is not clear or an error documentation Changelog: None Do not include in changelog mod: transpiler Issues and PRs related to Transpiler labels Apr 18, 2024
@mtreinish mtreinish added this to the 1.1.0 milestone Apr 18, 2024
@mtreinish mtreinish requested a review from a team as a code owner April 18, 2024 21:08
@qiskit-bot
Copy link
Collaborator

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 8744705876

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 6 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.006%) to 89.282%

Files with Coverage Reduction New Missed Lines %
crates/qasm2/src/lex.rs 6 92.11%
Totals Coverage Status
Change from base Build 8740672466: -0.006%
Covered Lines: 60325
Relevant Lines: 67567

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

Looks fine to me, and good to test/document the expected behaviour of the int list.

tqc_obj = pm_list.run(qc)
self.assertIsInstance(pm_list, PassManager)
self.assertIsInstance(pm_object, PassManager)
self.assertEqual(tqc_list, tqc_obj)
Copy link
Member

Choose a reason for hiding this comment

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

We don't actually formally compare layouts in QuantumCircuit.__eq__ because we immediately convert to DAGCircuit, which doesn't have a layout field, but we do compare qubit positions, so this should be a fine test.

@jakelishman jakelishman enabled auto-merge April 18, 2024 21:32
@jakelishman jakelishman added this pull request to the merge queue Apr 18, 2024
Merged via the queue into Qiskit:main with commit ff7ba3f Apr 18, 2024
12 checks passed
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 documentation Something is not clear or an error documentation mod: transpiler Issues and PRs related to Transpiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

generate_preset_pass_manager should take initial_layout as a list
4 participants