Skip to content

Commit

Permalink
Merge branch 'dev/linspace_jumpback_fix' into issues/860_linspace_vm
Browse files Browse the repository at this point in the history
  • Loading branch information
terrorfisch committed Jun 21, 2024
2 parents 025ba8a + ed91fb1 commit 10f13b1
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 @@ -84,7 +84,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 @@ -141,8 +141,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 @@ -233,7 +233,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 10f13b1

Please sign in to comment.