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

QuantumCircuit.decompose() does not take a single gate, but a set of gates to decompose. #6587

Merged
merged 44 commits into from
Jul 14, 2021

Conversation

fs1132429
Copy link
Contributor

@fs1132429 fs1132429 commented Jun 16, 2021

Summary

This pull request resolves #2906 and is an addition to PR #5446. It allows the specification of gates to decompose inside circuit.decompose().

Details and comments

I have changed the variable gates to gates_to_decompose. I have also added fnmatch check to support for * wildcard at the end of the string. I have also added various tests in test_decompose.py.

@fs1132429 fs1132429 requested a review from a team as a code owner June 16, 2021 11:23
1ucian0
1ucian0 previously approved these changes Jul 1, 2021
Copy link
Member

@1ucian0 1ucian0 left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks!

Co-authored-by: septembrr <[email protected]>
Copy link
Contributor

@Cryoris Cryoris left a comment

Choose a reason for hiding this comment

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

That's a great feature, thanks for the addition! I left some comments below.

qiskit/transpiler/passes/basis/decompose.py Outdated Show resolved Hide resolved
qiskit/transpiler/passes/basis/decompose.py Outdated Show resolved Hide resolved
test/python/transpiler/test_decompose.py Outdated Show resolved Hide resolved
test/python/transpiler/test_decompose.py Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: API Change Include in the "Changed" section of the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QuantumCircuit.decompose() should take which gate(s) to decompose
6 participants