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

Use device-specific gatesets for transpilation #141

Merged
merged 13 commits into from
Feb 7, 2024
Merged

Use device-specific gatesets for transpilation #141

merged 13 commits into from
Feb 7, 2024

Conversation

speller26
Copy link
Collaborator

@speller26 speller26 commented Jan 31, 2024

Summary

Right now, the adapter transpiles circuits to a target gateset of all gates supported by Braket, which can cause problems if the device itself doesn't support a gate. This PR changes the adapter to transpile to the device's target gateset.

Details and comments

For devices that support control modifiers, named controlled gates that are not already in Braket will be translated to the corresponding uncontrolled gate with control modifiers applied.

@speller26 speller26 changed the title Direct support for controlled gates Use device-specific gatesets for transpilation Feb 6, 2024
Copy link
Collaborator

@jcjaskula-aws jcjaskula-aws left a comment

Choose a reason for hiding this comment

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

qiskit_braket_provider/providers/adapter.py Show resolved Hide resolved
qiskit_braket_provider/providers/adapter.py Outdated Show resolved Hide resolved
qiskit_braket_provider/providers/adapter.py Outdated Show resolved Hide resolved
qiskit_braket_provider/providers/adapter.py Outdated Show resolved Hide resolved
qiskit_braket_provider/providers/adapter.py Show resolved Hide resolved
qiskit_braket_provider/providers/adapter.py Outdated Show resolved Hide resolved
@speller26
Copy link
Collaborator Author

As far as tests go, the existing tests actually cover the implementation changes, since the transpiler target gatesets change in the tests too; an incorrect translation will lead to mismatch between the Aer and Braket simulations.

@jcjaskula-aws
Copy link
Collaborator

Alright, approving but feel free to give some thoughts about #141 (comment). As for the tests, you are right. I just feel a bit uncomfortable that the transpiler mixes everything and our tests become less specific.

@jcjaskula-aws jcjaskula-aws merged commit b6f3112 into qiskit-community:main Feb 7, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants