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

Enhancement: add a Qiskit export #448

Open
nono2357 opened this issue Dec 22, 2019 · 3 comments
Open

Enhancement: add a Qiskit export #448

nono2357 opened this issue Dec 22, 2019 · 3 comments

Comments

@nono2357
Copy link

An export to Qiskit would be a must-have.

@Strilanc
Copy link
Owner

I agree that a QASM export would be good. However, note that this functionality would be a lot of work. For example, QASM doesn't have built-in operations for modular exponentiation on a mix of classical and quantum values. So the export code would need to specify a decomposition for that operation, and all the other complex operations in the toolbox.

There are also concepts in quirk that may not exist in qiskit, such as time dependent gates and post-selection and custom non-unitary operations and the distinction between a detector (collapsing simulation) and a measurement (dephasing simulation).

The quirk import code in cirq is a couple thousand lines of python: https://github.com/quantumlib/Cirq/tree/master/cirq/interop/quirk . That's with support from the target library, so that decompositions are not needed.

@aditya-giri
Copy link

aditya-giri commented Nov 28, 2020

@Strilanc I have a pretty crude of this working on my fork (I'm using it for a different project). However, it only supports the gates that the IQX circuit designer currently supports (X, Y, Z, H, S, T, Sdg, Tdg, Swap, CX, CCX, RX, RY, RZ, SX, SXdg, CRX, CRY, CRZ, Measure). Would you be interested in helping me taking it forward? Perhaps it could be an "experimental" feature that is not (yet) guaranteed to work with the entire set of operations that Quirk supports. Let me know and I'll raise a draft PR if required.

@Strilanc
Copy link
Owner

Cirq has an import-from-quirk feature that you might be able to model this after. It defines custom gates in cirq for gates that otherwise wouldn't be present (like modular exponentiation). I do think that the export functionality should be reliable as long as you only use unitary operations, e.g. incrementing and the QFT should work.

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

No branches or pull requests

3 participants