qiskit-community / qiskit-ionq

Qiskit provider for IonQ backends
https://qiskit-community.github.io/qiskit-ionq/
Apache License 2.0
41 stars 22 forks source link

Support qiskit `transpile()` with IonQ native gateset #92

Open Cynocracy opened 2 years ago

Cynocracy commented 2 years ago

We can support in-qiskit transpilation to our native gateset, now that native gates are supported.

This would be a good task for someone with deep experience/understanding of quantum circuits.

ColemanCollins commented 2 years ago

This issue has been given a bounty as part of unitaryhack 2022. A PR closing the issue by a unitary hack participant will result in a cash prize!

Feel free to comment on this issue to discuss approach and solutions, or find us on the Qiskit Slack at #partners-ionq.

I believe the main thrust of work here is in providing appropriate decompositions (or even more advanced ones, see this paper) for a universal gateset that already works with the transpiler, e.g. CNOT and rotations. See this page for a lot more on our native gateset, and this one for the gateset in qiskit specificxally.

Note that some or all of this of this work may/should/could happen upstream in the main qiskit repo — we are happy to cover the bounty (or a secondary bounty) however the solution shakes out.

mtreinish commented 2 years ago

Just for reference there is documentation on how to do this in a backend implementation: https://qiskit.org/documentation/apidoc/providers.html#custom-basis-gates

Ideally you wouldn't need to do anything in qiskit-terra but there are still some gaps in the backend/transpiler interface around integrating optimization with custom backend specific gates so passes like Optimize1qGatesDecomposition and UnitarySynthesis (which are used to simplify the circuit after translation) can work in a custom gate set (this should hopefully be getting addressed over the next couple of releases). But to start if you follow the steps from the documentation guide the transpile() will at least generate valid circuits.