qiskit-community / qiskit-braket-provider

Qiskit-Braket provider to execute Qiskit programs on quantum computing hardware devices through Amazon Braket.
https://qiskit-community.github.io/qiskit-braket-provider/
Apache License 2.0
58 stars 45 forks source link

Use device-specific gatesets for transpilation #141

Closed speller26 closed 8 months ago

speller26 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

Alright, approving but feel free to give some thoughts about https://github.com/qiskit-community/qiskit-braket-provider/pull/141#discussion_r1481786603. As for the tests, you are right. I just feel a bit uncomfortable that the transpiler mixes everything and our tests become less specific.