-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
unexpected behaviour of pad/MemorySlot has same prefix as MeasureChannel #7078
Comments
hi @stuckmar thanks for raising this issue, it is currently unclear if @lcapelluto may have some additional thoughts too |
Hello I want to assigned for this issue. I am new in qiskit but I am interested in Qiskit so may you inform me about issue? I hope this issue is suitable for me. |
Hi @Osmanilge I think the best way to assess If the issue is suitable for you, have a look to the suggested solution. If it sounds like greek, check a different one less obscure. Otherwise, let me know and I can assign it to you! |
Hey @Osmanilge, are you still working on this issue? Let us know if you need any help 😃 If you’re not working on this anymore let us know and we will un-assign you so others can pick it up. |
I am really sorry. I could not realize I am assigned for this issue. I will look this issue if you want me to still assigned otherwise if it needs to finished quickly , you can un-assign me. |
Don't worry about it - it's not urgent, and you were never formally assigned. If something becomes urgent for us, we can solve things in-house as well. If you'd like to work on the issue and have time to do so, let us know, otherwise no worries. |
Please could I be assigned to this? I have put in a PR. |
@pollyshaw Sure, I have assigned you. Thanks for making the contribution! |
Please see my comment here. |
@taalexander @nkanazawa1989 Isn't the problem really that here:
|
Oh, you're right! This should appear in Qiskit programs and thus memory slot and register slot are actually scheduled. Probably we need to update this method to return only acquire channel? Since these slots are always sync with the acquire channel and thus even not visualized. I don't think removing them breaks code execution. Anyways, in Qobj converter, each instruction kind is separately handled and the memory slots are generated in a part of acquire serialization. So missing timeslot for memory slot should be fine. |
OK it sounds like I should revert these changes and instead change the implementation of Acquire.channels(). Will do so tomorrow. |
…l and don't apply a delay to it if True RegisterSlot and MemorySlot have this set to False. The default implementation in Channel sets it to True.
…emove check from Delay.
…l and don't apply a delay to it if True RegisterSlot and MemorySlot have this set to False. The default implementation in Channel sets it to True.
…e.Channel RegisterSlot, MemorySlot and SnapshotChannel now derive from this class. There are some tests to fix.
…l and don't apply a delay to it if True RegisterSlot and MemorySlot have this set to False. The default implementation in Channel sets it to True.
…emove check from Delay.
@nkanazawa1989 Thanks for approving this! Is there anything else I need to do now? I don't seem to have a 'merge' button so perhaps a contributor needs to merge it. |
I'll merge if other people are happy with the changes (or don't plan to review). @wshanks @taalexander ? |
…#8166) * Fixes #7078: Add is_schedulable property to qiskit.pulse.Channel and don't apply a delay to it if True RegisterSlot and MemorySlot have this set to False. The default implementation in Channel sets it to True. * Fixes #7078: Introduce ClassicalIOChannel as a subclass of pulse.Channel RegisterSlot, MemorySlot and SnapshotChannel now derive from this class. There are some tests to fix. * Fixes #7078: Make Acquire.channels only return the channel * Fixes #7078: Execute black * Fixes #7078: Put slots in new tuple in acquire * Fixes #7078: Add is_schedulable property to qiskit.pulse.Channel and don't apply a delay to it if True RegisterSlot and MemorySlot have this set to False. The default implementation in Channel sets it to True. * Fixes #7078: Remove is_schedulable property from qiskit.pulse.channel * Fixes #7078: Put checks in SetPhase, ShiftPhase and SetPhase. Remove check from Delay. * Fixes #7078: Add unit tests for restrictions on Classical IO channels * Fixes #7078: Add unit tests for abstract nature of ClassicalIOChannel * Fixes #7078: Tidying after self-review. * Fixes #7078: Add release note. * Fixes #7078: remove typo Co-authored-by: Naoki Kanazawa <nkanazawa1989@gmail.com>
congrats @pollyshaw ! Thanks for your contribution :) |
Information
What is the current behavior?
Starting with a Schedule containing an Acquire, with the Acquire using a MemorySlot, and any Delay or Pulse, which is longer than that of the Acquire. Now using the pad function on this Schedule will return a Schedule, which contains Delays on both the AcquireChannel and MemorySlot. When the padded schedule is now assembled and converted, using the QobjToInstructionConverter and again a new schedule is created from the converted instructions, the new Schedule does not contain a Delay on the AcquireChannel, nor on the MemorySlot, but a Delay on the MeasureChannel with the same index as the MemorySlot used.
Steps to reproduce the problem
Now sched and sched2 contain different instructions:
((0, Acquire(3, AcquireChannel(0), MemorySlot(0))),
(0, Play(Constant(duration=4, amp=(0.1+0j)), DriveChannel(0))),
(3, Delay(1, AcquireChannel(0))),
(3, Delay(1, MemorySlot(0))))
((0, Acquire(3, AcquireChannel(0), MemorySlot(0))),
(0,
Play(Constant(duration=4, amp=(0.1+0j), name='constant_e3a2'), DriveChannel(0), name='constant_e3a2')),
(3, Delay(1, MeasureChannel(0))))
What is the expected behavior?
Assembling, converting, and creating a Schedule should return the same Schedule, which was assembled.
Suggested solutions
First, I am not sure if it is expected from the pad function to create Delays on AcquireChannels and MemorySlots. Since both of them are not PulseChannels and the assembled Qobj does not contain the Delay on the AcquireChannel.
Second, the prefix of the MemorySlot is 'm', which is the same as for MeasureChannel. Therefore, the conversion of these channels happen. I suggest a different prefix for MemorySlot, for example 's'. Then in qiskit\qobj\converters\pulse_instruction.py the get_channel method of QobjToInstructionConverter needs to be expanded to include MemorySlots, if Delays make sense on MemorySlots. Alternatively, a Delay on a MemorySlot could be skipped entirely by the assembler, similiar how it is done with Delays on AcquireChannels.
The text was updated successfully, but these errors were encountered: