Skip to content

Commit

Permalink
fix jump back in linspace
Browse files Browse the repository at this point in the history
  • Loading branch information
Nomos11 committed Jun 20, 2024
1 parent 3ad03a6 commit ed91fb1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion qupulse/program/linspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def _add_iteration_node(self, node: LinSpaceIter):
self.add_node(node.body)

if node.length > 1:
self.iterations[-1] = node.length
self.iterations[-1] = node.length - 1
label, jmp = self.new_loop(node.length - 1)
self.commands.append(label)
self.add_node(node.body)
Expand Down
8 changes: 4 additions & 4 deletions tests/program/linspace_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def setUp(self):

LoopLabel(1, 99),

Increment(0, -2.0, key_0),
Increment(0, -1.99, key_0),
Increment(1, 0.02, key_1),
Wait(TimeType(10 ** 6)),

Expand Down Expand Up @@ -131,8 +131,8 @@ def setUp(self):

LoopLabel(1, 99),

Increment(0, 1e-3 + -200 * 1e-2, key_0),
Increment(1, 0.02 + -200 * -3e-3, key_1),
Increment(0, 1e-3 + -199 * 1e-2, key_0),
Increment(1, 0.02 + -199 * -3e-3, key_1),
Wait(TimeType(10 ** 6)),

LoopLabel(2, 199),
Expand Down Expand Up @@ -223,7 +223,7 @@ def setUp(self):
Set(0, -0.4),
Set(1, -0.3),
Wait(TimeType(10 ** 5)),
Increment(0, -2.0, key_0),
Increment(0, -1.99, key_0),
Increment(1, 0.02, key_1),
Wait(TimeType(10 ** 6)),
Set(0, 0.05),
Expand Down

0 comments on commit ed91fb1

Please sign in to comment.