-
Notifications
You must be signed in to change notification settings - Fork 65
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: Redefine slope of RampWaveform #644
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with this correction, I just have a suggestion on the docstring
pulser-core/pulser/waveforms.py
Outdated
@@ -533,7 +533,7 @@ class RampWaveform(Waveform): | |||
Args: | |||
duration: The waveform duration (in ns). | |||
start: The initial value (in rad/µs). | |||
stop: The final value (in rad/µs). | |||
stop: The final value at duration - 1 (in rad/µs). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about
stop: The final value at duration - 1 (in rad/µs). | |
stop: The value (in rad/µs) at the final sample. |
And also change start
accordingly.
pulser-core/pulser/waveforms.py
Outdated
start: The initial value (in rad/µs). | ||
stop: The final value at duration - 1 (in rad/µs). | ||
start: The value (in rad/µs) at the initial sample. | ||
stop: The value (in rad/µs) at the initial sample. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small confusion here
stop: The value (in rad/µs) at the initial sample. | |
stop: The value (in rad/µs) at the final sample. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow that was silly sorry about that 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Hi @a-corni and @HGSilveri Do you think there will be some room to discuss changing the sampling behaviour of the ramp in the future? |
Hey @sgrava ! There's always room to discuss :) I agree with you that this definition of slope is counterintuitive, but I think it's more important that the sampling behaviour is in line with all the other waveforms. If the Nonethless, it's also important to note that these differences are most likely negligible at the timescales our devices operate. We shouldn't stress too much about them, in my opinion. |
I also think it's important to have consistence. Changing the behaviour of one Waveform is tricky, since a waveform is usually defined with others, and letting the option to the user to extend the duration of RampWaveforms by 1 would yield an error for the other waveforms. |
Main changes: 21a47f3 Remove Register.rotate() (#642) 20e6765 FIX: Redefine slope of RampWaveform (#644) c2d5b6c Enabling definition of multiple noise channels and noise channels in XY (#647) bcb78cc Enable digital simulation (#652) 0f6e3dd Improve access to output modulation durations (#663) 188d21d Remove deprecated noise arguments (#674) f303138 Adding relaxation noise channel (#675) 716b86b Centralize all backend imports from a single pulser.backends module (#678) 96a8c34 Add hyperfine dephasing rate to NoiseModel (#680) 4981ca6 Add optional default noise models to devices (#676) c695373 Rectangular lattice register and layout (#665)
Fixing the definition of slope, for it to match with our current definition of RampWaveform, as associating [start, start + (start - end)/(duration - 1), ..., end] to [0, 1, ..., duration - 1]
Trying to fix the confusion in the documentation.
@sgrava
Closes #645