-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Custom package and circuit interface #1377
Comments
Hello @refraction-ray, thank you for your interest in Mitiq! |
Thanks @refraction-ray, we'll think about your proposal. Honestly, the solution of your first code snippet doesn't look so bad to me.
Do you have strong arguments in favor of the second approach? |
Thanks for your reply.
Yes, consider the scenario of three parties (user, mypackage developer and mitiq developer) instead of two parties (user and mitiq developer). It is mypackage's developers responsibility to implement mycircuit = mypackage.Circuit()
def executor(mycircuit):
return mypackage.run(mycircuit)
zne.execute_with_zne(mycircuit, executor) |
Ah, now I see the advantage thanks! Sounds interesting to me. |
I personally really like the idea of allowing user-defined |
I'd like to pick this one up, but if anyone wants to collaborate I'm certainly happy to get some new folks involved with Mitiq as well! |
Tagging @unitaryfund/engineering . |
Pre-Request Checklist
Issue Description
Currently, if we want to interface mitiq with quantum packages that not listed in
interfaces
submodule, we can take the following workaround:However, this workflow is not straightforward and error-prone. Since we have defined
from_cirq
andto_cirq
anyway, a better integration would be a hook to register these two methods toconvert_to_mitiq
andconvert_from_mitiq
. Then the above work flow will be simplified toNamely, just native user experience as the currently supported quantum software packages.
Proposed Solution
For now, the extension on
convert_to_mitiq
andconvert_from_mitiq
is impossible since the two function are hand coded if else branch with no user customized fallback. Therefore, a possible API for the hook and the corresponding implementation may be as follows:Additional References
The text was updated successfully, but these errors were encountered: