qiskit: Pulse and Schedule plots do not start at t0=0

Information

  • Qiskit Terra version:
  • Python version:
  • Operating system:

What is the current behavior?

As noted in https://github.com/Qiskit/qiskit-terra/pull/3418#pullrequestreview-313349295, the pulse and schedule plots do not start at t=0, nor do they finish at t=t0+duration

Steps to reproduce the problem

import qiskit.pulse as pulse
import qiskit.pulse.pulse_lib as pulse_lib
sched = pulse.Schedule()
sched += pulse_lib.constant(10, 1.0)(pulse.DriveChannel(1))
sched.draw(channels_to_plot=[pulse.DriveChannel(1)])

What is the expected behavior?

They should start and stop at t0(duration)

Suggested solutions

Any ideas @nkanazawa1989?

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 17 (17 by maintainers)

Most upvoted comments

Sure, no problem. If I make progress I will let you know.

On Wed., 8 Jan. 2020, 01:23 Thomas Alexander, notifications@github.com wrote:

@faraimazh https://github.com/faraimazh do you still plan to work on this? Otherwise, I will reassign.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Qiskit/qiskit-terra/issues/3427?email_source=notifications&email_token=AIPNQSRZUQLG54SPKVL575TQ4UFHFA5CNFSM4JKHK5DKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIKUQ3Q#issuecomment-571820142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPNQSUZQ7NXKCDZ7376PCLQ4UFHFANCNFSM4JKHK5DA .

@faraimazh feel free to poke around and comment here if you have any questions!

I looked through the code a little more and it looks like it may be happening within the _draw_channels function. I tried playing around with the code in there, and if I have set the time array’s first entry to 0, then the channel’s figure correctly starts at 0. (Currently, time’s first entry is 0.5, which is the amount of offset we see). I have not been able to reproduce the same fix for the end of the channel’s figure though. Will play around with it a little more.