-
Notifications
You must be signed in to change notification settings - Fork 9
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
fix!: correctly compute duration for erfsquare
waveform templates
#406
base: main
Are you sure you want to change the base?
Conversation
|
The duration of an `erf_square` waveform is the sum of its duration *and* of its left and right padding.
This is only relevant when computing durations
e973b19
to
0e5bb8c
Compare
Curious what others think, but I think this is okay because it adds a fix without adding tech debt that gets in the way of a more holistic future fix. I do wonder if we should rip the band-aid off and rally around either |
Good start, but I'd propose two changes:
The "most correct" fix, I think, is to actually compute every waveform's IQs and then count samples. However, that is more computationally expensive and thus not necessarily superior to this approach. So let me propose a middle ground: unit tests which assert, for some varied parameters in all supported templates, that this |
@kalzoo: I agree with your changes, but/and I think that the unit tests belong in a separate PR; to write them correctly, we have to handle parsing |
…`_` in `erf_square`
@kalzoo Sorry, I claimed to have pushed changes yesterday but it looks like they didn't actually go through. They went through now |
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 forerfsquare
, though; theduration
parameter just specifies the duration of the active pulse, and thepadleft
andpadright
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 theerfsquare
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:
erfsquare
, but our test cases call iterf_square
padleft
andpadright
, but ourErfSquare
type calls thempad_left
andpad_right
.As implemented, any mix of the underscoreless and underscoreful names can be used.
Closes #405.