diff --git a/CHANGELOG.md b/CHANGELOG.md index 624c3b6e52aae0008d0c62ec32d9190a29071896..4f39ae62fa1eaf293dd4dd08dccab0aa6fb4e702 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,14 @@ # Changelog All notable changes to Pulselib will be documented in this file. -## \[1.3.5] - 2022-03-@@ +## \[1.3.6] - 2022-03-@@ ### Added - Added argument reset_time to wait() +## \[1.3.5] - 2022-03-29 +### Fixed +- Error when rendering section with low sample rate extends into segment with high sample rate. + ## \[1.3.4] - 2022-03-23 ### Improved - QuantumSequencer use waveform with low sample rate for long DC compensation pulse. diff --git a/pulse_lib/keysight/M3202A_uploader.py b/pulse_lib/keysight/M3202A_uploader.py index 7645c8cfe86350ad56cb3d343c6c46621dc00cbf..05fb99365ef8b8bd027170638fe298bc54c0bf00 100644 --- a/pulse_lib/keysight/M3202A_uploader.py +++ b/pulse_lib/keysight/M3202A_uploader.py @@ -500,7 +500,10 @@ class UploadAggregator: # create welding region if sample rate increases if sample_rate_next != 0 and sample_rate_next > sample_rate: - n_pre = round((section.t_end - (seg.t_end - max_pre_start_ns)) * section.sample_rate) + # The current section should end before the next segment starts: + # - subtract any extension into the next segment + # - align boundary with truncation + n_pre = int(np.ceil((section.t_end - (seg.t_end - max_pre_start_ns)) * section.sample_rate)) section.npt -= n_pre section.align(extend=False) diff --git a/pulse_lib/keysight/qs_uploader.py b/pulse_lib/keysight/qs_uploader.py index 1d172af0e1f5c489192ca3afb11868de9d7abb45..a66fb8840994e7b034bde07bdaca37e6905fcb89 100644 --- a/pulse_lib/keysight/qs_uploader.py +++ b/pulse_lib/keysight/qs_uploader.py @@ -600,7 +600,10 @@ class UploadAggregator: # create welding region if sample rate increases if sample_rate_next != 0 and sample_rate_next > sample_rate: - n_pre = round((section.t_end - (seg.t_end - max_pre_start_ns)) * section.sample_rate) + # The current section should end before the next segment starts: + # - subtract any extension into the next segment + # - align boundary with truncation + n_pre = int(np.ceil((section.t_end - (seg.t_end - max_pre_start_ns)) * section.sample_rate)) section.npt -= n_pre section.align(extend=False)