question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Write a Pulse Schedule Transformation that reduces all pulse channels to a single Waveform

See original GitHub issue

What is the expected enhancement?

As noted in this Slack conversation there is a desire to be able to reduce all PulseChannels in a Schedule/ScheduleBlock into a single waveform. This means compressing all Play/ShiftPhase/SetPhase/ShiftFrequency/SetFrequency instructions into a single Waveform and also recursively unrolling internally Calls.

It should be noted that there is likely relevant routines in the plotter which does similar transformations.

This could be added as a new transform module here.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
nkanazawa1989commented, Aug 30, 2021

This is what the plotter calls https://github.com/Qiskit/qiskit-terra/blob/75e06dc915f764ea4e5c1a57097e980e9d01b119/qiskit/pulse/transforms/base_transforms.py#L25-L28 (flattening Call and other high-level transformations are done by this pass)

The target_qobj_transform is called here https://github.com/Qiskit/qiskit-terra/blob/75e06dc915f764ea4e5c1a57097e980e9d01b119/qiskit/visualization/pulse_v2/core.py#L254

Actually, ShiftFrequency and SetFrequency do affect the waveform. Indeed, a waveform needs to get phase factor (exp(i f_d t)) associated with its frame to be played. The frame is rotating at the frequency f which is defined by the backend.defaults().qubit_freq_est, otherwise updated by the SetFrequency and ShiftFrequency. This phase factor is usually computed by the backend control electronics (either by a software or hardware), but the pulse plotter is missing to emulate this behavior. I guess @taalexander needs this option also on the front end.

Usually we don’t need to compute the frame on front end, however, if we need a custom frame such as qudit, we need to compute it. This is the relevant WIP PR: #5977. Apart from this, such frame computation might be necessary for the pulse simulator (it usually uses a rotating frame Hamiltonian to avoid fine dt step, and waveform in the lab frame is not necessary), or necessary for pulse plotter to understand how the waveform look like on the actual hardware.

Here, you need to add multiple transform passes that

  • convert ParametricPulses into Waveform
  • apply phase shift, set phase instruction to the waveform
  • apply frequency shift, set frequency instruction to update frame associated with channels, then get phase factor at t
  • optionally apply carrier wave (emulating the mixer)

Then you can create new transform that generates low-level waveform data.

1reaction
snsunxcommented, Jun 1, 2022

Hi @1ucian0, sorry I got busy with some other stuff and haven’t been working on this. I unassigned myself and please feel free to assign this issue to others.

Read more comments on GitHub >

github_iconTop Results From Across the Web

qiskit.pulse.channels
Qiskit-Pulse is a pulse-level quantum programming kit. This lower level of programming offers the user more control than programming with QuantumCircuit s.
Read more >
The benefits of high-resolution pulses for quantum computers
Shorter samples, i.e. higher resolution, allow users to create more versatile pulse shapes. Figure 1: (a) The control pulses are generated by ...
Read more >
programming quantum computers through the cloud with pulses
A scheduler compiles a circuit program to a pulse program, as depicted in figure 1. Scheduling requires system dependent information, most ...
Read more >
Chapter 5 Signal Encoding Techniques
Discrete, discontinuous voltage pulses; Each pulse is a signal element; Binary data encoded into signal elements. Terms (1). Unipolar. All signal elements ...
Read more >
MATLAB stft - Short-time Fourier transform - MathWorks
The short-time Fourier transform is invertible. · The istft function inverts the STFT of a signal. · Under a specific set of circumstances...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found