Skip to content

Handle loss in stim control flow#3459

Merged
joao-boechat merged 5 commits into
mainfrom
joaoboechat/handle-loss-in-stim-control-flow
Jul 17, 2026
Merged

Handle loss in stim control flow#3459
joao-boechat merged 5 commits into
mainfrom
joaoboechat/handle-loss-in-stim-control-flow

Conversation

@joao-boechat

Copy link
Copy Markdown
Contributor

In a REQUIRE statement inside of a PREPARE block, we need to make sure that the targets being required aren't LOSS. If they are, then we have to restart the prepare block instead of just continuing (which is what we currently do).

So for example:

PREPARE {
    LOSS_ERROR(0.2) 0
    M 0
    REQUIRE rec[-1]
}

When plotting the histogram for this, we should only see a 0 result, as the loss leads to a retry.

Meanwhile,

PREPARE {
    LOSS_ERROR(1) 0
    M 0
    REQUIRE rec[-1]
}

should result in an infinite loop as we are always getting loss

@joao-boechat
joao-boechat marked this pull request as ready for review July 14, 2026 23:14
@joao-boechat
joao-boechat force-pushed the joaoboechat/handle-loss-in-stim-control-flow branch from f21e914 to a9917c4 Compare July 16, 2026 00:21
@joao-boechat
joao-boechat added this pull request to the merge queue Jul 17, 2026
Merged via the queue into main with commit f853611 Jul 17, 2026
13 checks passed
@joao-boechat
joao-boechat deleted the joaoboechat/handle-loss-in-stim-control-flow branch July 17, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants