Skip to content

bloqade.stim.rewrite.ifs_handling.StimSplitIfStmts

← Module overview

classStimSplitIfStmtssource

bloqade.stim.rewrite.ifs_handling.StimSplitIfStmts

Bases: IsIfElseSimplifiable, SplitIfStmts

Splits the then body of an if-else statement into multiple if statements

class StimSplitIfStmts

Given an IfElse with multiple valid statements in the then-body:

this should be rewritten to:

if measure_result

squin.x(q0) squin.y(q1)

if measure_result

squin.x(q0)

if measure_result

squin.y(q1)

methodrewrite_Statementsource

bloqade.stim.rewrite.ifs_handling.StimSplitIfStmts.rewrite_Statement

def rewrite_Statement(node: ir.Statement) -> RewriteResult

Parameters

NameTypeDescription
nodeir.Statement

Returns

RewriteResult

source