-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
qpy does not support Discriminator
and Kernel
#10050
Comments
Thanks Will. As we discussed offline, we tend to remove them from acquire instruction arguments unless we receive user request. Keeping them in the acquire instruction indicates we can write a single quantum circuit including different kernels and discriminators, e.g. mid-circuit measurement, which is likely unrealistic. Instead of adding QPY support, we should deprecate them and define alternative path to describe kernel and descriminator. In OpenPulse grammar, capture instruction is sort of arbitrary, but they show nice example of defining descriminator. defcalgrammar "openpulse";
cal {
// Use a boxcar function to generate IQ data from raw waveform
extern boxcar(waveform input) -> complex[float[64]];
// Use a linear discriminator to generate bits from IQ data
extern discriminate(complex[float[64]] iq) -> bit;
...
}
defcal measure $0 -> bit {
...
waveform raw_output = capture_v1(capture_frame, 16000dt);
// Kernel and discriminate
complex[float[32]] iq = boxcar(raw_output);
bit result = discriminate(iq);
return result;
} https://openqasm.com/language/openpulse.html#capture-instruction |
@wshanks @nkanazawa1989 |
Yes, please go ahead! I talked again with @wshanks , and decided to add QPY support of kernel and discriminator rather than dropping them from the acquire instruction. Do you think you can still handle this issue? Feel free to reach me out if you need any help :) I implemented QPY support of another instruction with this PR. Just FYI |
@nkanazawa1989 Thank you so much! 🙇
I will see in more detail if I can do so 😄 |
@nkanazawa1989 I would like to know whether this approach of mine appropriately follows the convention and/or the rule of |
Environment
What is happening?
Trying to serialize with qpy a circuit with a pulse gate which includes an
Acquire
instruction with aDiscriminator
orKernel
fails. The error is:and similar for
Kernel
.Note this means that with qiskit-ibm-provider pulse gates with discriminators or kernels are not currently supported since circuits must be serialized with qpy.
How can we reproduce the issue?
Here are reproducers for
Discriminator
:and
Kernel
:What should happen?
Discriminator
andKernel
should be serializable with qpy. Since they are part of the circuit, they are already JSON serializable to support the old qobj path.Any suggestions?
No response
The text was updated successfully, but these errors were encountered: