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

Unify pulse Commands and Instructions #3750

Closed
2 tasks done
taalexander opened this issue Jan 24, 2020 · 0 comments · Fixed by #4034
Closed
2 tasks done

Unify pulse Commands and Instructions #3750

taalexander opened this issue Jan 24, 2020 · 0 comments · Fixed by #4034
Assignees
Labels
mod: pulse Related to the Pulse module priority: high type: enhancement It's working, but needs polishing

Comments

@taalexander
Copy link
Contributor

taalexander commented Jan 24, 2020

What is the expected enhancement?

Pulse Commands were initially created to allow the pulse to be only defined once as a SamplePulse and then have its usage tracked based on the pulse instance. Every Instruction instance was then defined as containing a Command and its Channel operands that the command is applied to.

This change may result in some breaking changes, but I have a couple of ideas to make this mostly backward compatible.

Requirements for closure of this issue include:

Background and Ideas

I believe this has resulted in a confusing API with many statements that look like

PulseCommand(...)(channel1, channel2, ...)

which yields an instruction. Or called more explicitly:

PulseInstruction(PulseCommand(...), channel1, channel2, ...)

If we were to unify commands with instructions a generic instruction would accept a list of operands that could be either a numeric parameter like a complex or a channel to operate on, eg.:

PulseInstruction(operand1, operand2, ...)

For example, a frame change would go from,

FrameChange(0.0)(DriveChannel(0))

or explicitly,

FrameChangeInstruction(FrameChange(0.0), DriveChannel(0))

to

ShiftPhase(0.0, DriveChannel(0))

where ShiftPhase is of type Instruction.

The current behavior of pulses could be fixed by redefining Pulse as a Type and defining a Play instruction:

random_pulse = SamplePulse(np.random.random(10))
Play(random_pulse, DriveChannel(0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: pulse Related to the Pulse module priority: high type: enhancement It's working, but needs polishing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants