Qblox bin counter algorithm #1119
Closed
alecandido
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
The looping function had to be amended.
In the end, it was possible to recover the original behavior, with a single loss: one further conditional instruction has to be introduced. def loop(loops: list[Loop], singleshot: bool = False) -> npt.NDArray[np.int64]:
global r0, r1
lp = loops[0]
els = []
rx = lp[0]
while rx > 0:
if len(loops) == 1:
els.append(r0)
r0 += 1
else:
els.append(loop(loops[1:], singleshot=singleshot))
if lp[1] and not singleshot:
if rx > 1:
r0 = r1
rx -= 1
if lp[1]:
r1 = r0
return np.array(els) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Beta Was this translation helpful? Give feedback.
All reactions