-
round_to_sum — Round a list of numbers such that their sum is the rounded sum.
qoolqit.waveforms.utils
module
qoolqit.waveforms.utils
Functions
round_to_sum (values: list[float]) → list[int]
Round a list of numbers such that their sum is the rounded sum.
Σᵢround(aᵢ) = round(Σᵢaᵢ)
Example
>>> round_to_sum([100.3, 100.3, 100.4])>>> [100, 100, 101]