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

Delay instruction #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jrj-d
Copy link
Contributor

@jrj-d jrj-d commented Apr 14, 2023

Hello,
This PR maps the Qiskit delay instruction to the new delay instruction in the QIS introduced in this PR qir-alliance/pyqir#233.

Using the delay instruction, users will be able to do must-have experiments with qubits like T1 measurements, T2 Ramsey measurements, T2 Hahn measurements, etc.

PR #37 should be merged before this one.

Additionally, this PR is blocked by PR qir-alliance/pyqir#233. A new release of pyqir will be required before merging.

Happy to discuss and thanks for considering it!

@jrj-d
Copy link
Contributor Author

jrj-d commented Apr 14, 2023

Side note: I don't understand how the tests passed in the CI 🤔

Locally I ran tests with pyqir 0.8.0 and with a modified version from PR qir-alliance/pyqir#233. As expected, the former fails and the latter passes.

Please let me know if you understand more 🙏

@idavis
Copy link
Contributor

idavis commented Apr 14, 2023

Thanks @jrj-d . What hardware/simulator are you targeting that supports delays with QIR?

@jrj-d
Copy link
Contributor Author

jrj-d commented Apr 19, 2023

Our own :)
I'm part of Alice&Bob. We offer cat qubits and plan to expose them at the gate level using QIR.

Sorry for not answering sooner, I really must solve this notification issue on GitHub :)

@idavis
Copy link
Contributor

idavis commented Apr 24, 2023

Sorry for the delay, @jrj-d, I've been thinking about this a bit. I think the best course of action to support what you need is to allow qiskit-qir to be extended allowing users to optionally add gate support. I'll see if I can work something out this week to open up this kind of extension.

@jrj-d
Copy link
Contributor Author

jrj-d commented Apr 24, 2023

Thanks @idavis ! Do you mean the user will be able to provide to to_qir_module a list of supported gates to transpile to, as in Qiskit's transpile?

@idavis
Copy link
Contributor

idavis commented Apr 24, 2023

I'm not sure yet. A user would need to be able to either provide a base module with extern definitions or have an opportunity to modify the module. Then being able to opt into defining gates. Perhaps an optional callback that is called given the qargs, cargs, and operation and the user can return a value indicating whether they handled the operation.

@jrj-d
Copy link
Contributor Author

jrj-d commented Apr 24, 2023

Just to make sure I understand correctly: your idea is to make it possible for a user like me to add a delay operation (or any other one) without making a PR to qiskit-qir and pyqir?
I roughly see how to do this on the qiskit-qir side, but not on pyqir/qirlib yet

@idavis
Copy link
Contributor

idavis commented Apr 24, 2023

PyQIR is capable of writing any kind of function including being an extern (another sample) or with a body implementation.

@jrj-d
Copy link
Contributor Author

jrj-d commented May 12, 2023

Hello @idavis , I hope you're well! Have you been able to think about a proper interface to allow the users to extend qiskit-qir? Thanks!

@idavis
Copy link
Contributor

idavis commented May 12, 2023

@jrj-d Sorry, I haven't been able to work on this yet.

* The backend-dependent time unit dt is left untouched
* All other time units (s, ms, us, ns, ps) are converted to us when
  generating QIR
@jrj-d jrj-d force-pushed the add_delay_instruction branch from 96734a9 to 80fe49c Compare May 18, 2023 05:42
jrj-d pushed a commit to Alice-Bob-SW/qiskit-alice-bob-provider that referenced this pull request May 18, 2023
This is made possible by a temporary fork of qiskit-qir.
Discussions to add the delay instruction to the upstream repo (or to
let the user define custom translation rules) are engaged in
microsoft/qiskit-qir#40
jrj-d pushed a commit to Alice-Bob-SW/qiskit-alice-bob-provider that referenced this pull request May 18, 2023
This is made possible by a temporary fork of qiskit-qir.
Discussions to add the delay instruction to the upstream repo (or to
let the user define custom translation rules) are engaged in
microsoft/qiskit-qir#40
jrj-d pushed a commit to Alice-Bob-SW/qiskit-alice-bob-provider that referenced this pull request May 19, 2023
This is made possible by a temporary fork of qiskit-qir.
Discussions to add the delay instruction to the upstream repo (or to
let the user define custom translation rules) are engaged in
microsoft/qiskit-qir#40
@MaxleDrut MaxleDrut deleted the add_delay_instruction branch July 15, 2024 14:08
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