-
Notifications
You must be signed in to change notification settings - Fork 34
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
[RFC] Unify Pulse Commands and Instructions #12
[RFC] Unify Pulse Commands and Instructions #12
Conversation
Comment on names: These are used for visualization, so, if pulses and instructions both have names, one becomes unused, so I would prefer only one of the two to have a name. Between the two, it seems to make more sense for |
So excited for this! It will be a grand improvement to the Pulse API! ❤️ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving bc the substance is all 👍👍
Remaining comments are: names
field, and the import path deprecation, since we will want to rename commands/
To reviewers: Plan right now is to start this on 2/24, so please make comments before then :) |
I agree with this refactoring. It will make the API more user-friendly while minimizing the negative impact on performance. Removing commands (except for Regarding If thinking only about visualization, I think I think the reason why the current |
We can allow the pulse to have a name. |
Start: Qiskit/qiskit#3862 |
I like this RFC. It will help make the pulse API easier to use. I also agree that pulses should have names. This will make it easier for users to keep track of their pulses. Judging from the RFC it looks like |
The RFC looks good. I have few comments: (1) Since aquire is now defined for each channel as well as other instructions, I prefer property name ‘channel’ rather than array like ‘channels’. This benefits to remove overhead of syntax verification because we cannot insert multiple channels to Play for example. I also prefer to keep memory and register slot to be separated to avoid multiple type checking in assembler. (2) Can we integrate insert operation? E.g. decorator taking instruction and t0 so as to ‘Play(pulse, d0, 100)’ for example. |
@nkanazawa1989, for (2), I think no need for it, you can do `Play(pulse, d0) << 100’ instead. |
This will be accomplished with the builder interface we will be defined shortly. I expect we will define a canonical Schedule (what currently exists) and then extend the instructions with scheduling directives that will be removed in a rescheduling canonicalization pass. The other option is to produce Schedules that have these scheduled properties and then combine them in the builder as we did for our hackathon implementation. |
Channels is a property for every
No this would not be an instruction then. We will incorporate such behavior in the builder interface. |
Is there any instruction taking multiple channels? |
@nkanazawa1989 only sort of. MemorySlots are technically channels, but even Acquire instructions are being migrated to only accept one AcquireChannel and one MemorySlot -- which is still only one physical channel. |
Some of the recent discussion has been regarding timing rather than Instruction/Command unification. I'm calling out of scope on that, especially in light of this: Qiskit/qiskit#3749 When we have relatively timed instructions, most of the considerations you all have brought up above change slightly or dramatically. E.g. accepting |
@lcapelluto if we can say they are one physical channel, the property name should be channel. The singular form explicitly presents the design of instructions - single instruction is uniquely mapped to one physical channel. |
We cannot say this. We may have synchronization directives such as a barrier that may take multiple channels. I am not comfortable restricting us to this assumption at this time. We should revisit in the future. If one truly requires a singular |
Command
s were initially created so as to allow pulses to be only defined once as aSamplePulse
and then have their usage tracked based on the class instance through equality checking. To enable this, everyInstruction
instance was defined as containing aCommand
and itsChannel
operands that the command would be applied to. This resulted in a confusing API as one must first define a command and then call it with a channel to emit an instruction. We propose a way of gracefully unifyingCommand
s andInstruction
s to make pulse programming more straightforward and in-line with traditional instruction sets.The implementation of this RFC will be tracked by the Terra issue