Skip to content

Commit 670e3bc

Browse files
committed
Correct type annotation in LinspaceVM
1 parent d49877b commit 670e3bc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

qupulse/program/linspace.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def __init__(self, channels: int):
419419
self.time = TimeType(0)
420420
self.registers = tuple({} for _ in range(channels))
421421

422-
self.history: List[Tuple[TimeType, Tuple[float, ...]]] = []
422+
self.history: List[Tuple[TimeType, List[float]]] = []
423423

424424
self.commands = None
425425
self.label_targets = None
@@ -430,9 +430,13 @@ def change_state(self, cmd: Union[Set, Increment, Wait, Play]):
430430
if isinstance(cmd, Play):
431431
raise NotImplementedError("TODO: Implement arbitrary waveform simulation")
432432
elif isinstance(cmd, Wait):
433-
self.history.append(
434-
(self.time, self.current_values.copy())
435-
)
433+
if self.history and self.history[-1][1] == self.current_values:
434+
# do not create noop entries
435+
pass
436+
else:
437+
self.history.append(
438+
(self.time, self.current_values.copy())
439+
)
436440
self.time += cmd.duration
437441
elif isinstance(cmd, Set):
438442
self.current_values[cmd.channel] = cmd.value

0 commit comments

Comments
 (0)