Skip to content

Commit

Permalink
Fix voltage booking error introduced in the previous fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
matpompili authored Jun 5, 2024
1 parent 6f0d9bb commit 61c37ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]
### Fixed
- control_panel - Fix voltage booking error introduced in the previous fix.
- control_panel - Fix rounding error in `ManualOutputControl` that caused voltage drifts.
- octave_tools - Fix bug when setting calibrate to False in ``get_correction_for_each_LO_and_IF()``.
- unit - ``to_clock_cycles()`` now always returns an integer.
Expand Down
17 changes: 9 additions & 8 deletions qualang_tools/control_panel/manual_output_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,22 +248,23 @@ def set_amplitude(self, element, value, ignore_missing_elements=False):

prev_value = self.analog_data[element]["amplitude"]
if value != 0:
delta_value = (value - prev_value) * (1 / self.ANALOG_WAVEFORM_AMPLITUDE)
delta_value = _round_to_fixed_point_accuracy(delta_value)
if delta_value == 0:
value = (value - prev_value) * (1 / self.ANALOG_WAVEFORM_AMPLITUDE)
value = _round_to_fixed_point_accuracy(value)
if value == 0:
return
self.analog_data[element]["amplitude"] = _floor_to_fixed_point_accuracy(
prev_value + value * self.ANALOG_WAVEFORM_AMPLITUDE
)
else:
delta_value = value
self.analog_data[element]["amplitude"] = _floor_to_fixed_point_accuracy(
prev_value + delta_value * self.ANALOG_WAVEFORM_AMPLITUDE
)
self.analog_data[element]["amplitude"] = 0.0


while not self.analog_job.is_paused():
sleep(0.01)

self.analog_qm.set_io_values(
int(self.analog_elements.index(element)) + len(self.analog_elements),
float(delta_value),
float(value),
)
self.analog_job.resume()

Expand Down

0 comments on commit 61c37ac

Please sign in to comment.