Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix!: correctly compute duration for erfsquare waveform templates #406

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

antalsz
Copy link
Contributor

@antalsz antalsz commented Sep 20, 2024

ScheduledBasicBlock::get_waveform_duration_seconds previously assumed that the duration of all built-in waveforms is equal to their duration parameter. This isn't true for erfsquare, though; the duration parameter just specifies the duration of the active pulse, and the padleft and padright parameters specify silent padding on either side which contribute to the total duration.

This PR updates the computation of the duration to include the padding. This is a breaking change, because now scheduling a program with an erfsquare waveform requires that the erfsquare waveform have these extra parameters and that they be constants. Indeed, some of our very own tests were broken by this.

There is also some inconsistency in names, which this PR papers over by accepting both:

  • The Quil spec calls the waveform erfsquare, but our test cases call it erf_square
  • The Quil spec calls the padding parameters padleft and padright, but our ErfSquare type calls them pad_left and pad_right.

As implemented, any mix of the underscoreless and underscoreful names can be used.

Closes #405.

Copy link

github-actions bot commented Sep 20, 2024

PR Preview Action v1.4.8
🚀 Deployed preview to https://rigetti.github.io/quil-rs/pr-preview/pr-406/
on branch quil-py-docs at 2024-09-20 20:48 UTC

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The computed duration of erfsquare waveform templates is incorrect
1 participant