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

Add option to unitary synthesis plugin interface for user config #7252

Merged
merged 2 commits into from
Nov 11, 2021

Conversation

mtreinish
Copy link
Member

Summary

This commit adds a new option to the unitary synthesis plugin interface
for plugins to accept free form user config. Two potential synthesis
plugins both have asked for an interface where a user can pass
configuration options through to the plugin to tune how the plugin runs.
To enable this, this commit adds a new kwarg to transpile() to pass a
configuration dictionary straight through to the plugin. As this is a
custom thing for each plugin the burden is on the plugin author to
define how this dictionary is used, implement using it, and documenting
it's use.

Details and comments

This commit adds a new option to the unitary synthesis plugin interface
for plugins to accept free form user config. Two potential synthesis
plugins both have asked for an interface where a user can pass
configuration options through to the plugin to tune how the plugin runs.
To enable this, this commit adds a new kwarg to transpile() to pass a
configuration dictionary straight through to the plugin. As this is a
custom thing for each plugin the burden is on the plugin author to
define how this dictionary is used, implement using it, and documenting
it's use.
@mtreinish mtreinish added the Changelog: None Do not include in changelog label Nov 10, 2021
@mtreinish mtreinish added this to the 0.19 milestone Nov 10, 2021
@mtreinish mtreinish requested a review from a team as a code owner November 10, 2021 16:35
@mtreinish
Copy link
Member Author

@edyounis @adekusar-drl this should add the interface you were both asking for to enable users to tweak unitary synthesis plugins. Does this work for what you need?

@coveralls
Copy link

coveralls commented Nov 10, 2021

Pull Request Test Coverage Report for Build 1446347607

  • 12 of 12 (100.0%) changed or added relevant lines in 7 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.002%) to 82.483%

Files with Coverage Reduction New Missed Lines %
qiskit/extensions/quantum_initializer/uc.py 2 88.65%
Totals Coverage Status
Change from base Build 1444528657: 0.002%
Covered Lines: 49638
Relevant Lines: 60180

💛 - Coveralls

@edyounis
Copy link

Yeah, this will work for BQSKit. Thanks for implementing it.

@adekusar-drl
Copy link
Contributor

@mtreinish Thanks a lot! Yes, this is really nice to see!

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.

Mostly looks good to me - one comment about the keyword management within the run step, but it's not 100% necessary, since I think the way it's written won't actually cause problems (at the moment, at least!).

qiskit/transpiler/passes/synthesis/unitary_synthesis.py Outdated Show resolved Hide resolved
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 to me!

@mergify mergify bot merged commit 2db1685 into Qiskit:main Nov 11, 2021
@mtreinish mtreinish deleted the unitary-synthesis-plugin-args branch November 11, 2021 11:33
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants