Ifs to stim partial
IfToStimPartial
dataclass
IfToStimPartial()
Bases: RewriteRule
flowchart TD
bloqade.stim.rewrite.ifs_to_stim_partial.IfToStimPartial[IfToStimPartial]
click bloqade.stim.rewrite.ifs_to_stim_partial.IfToStimPartial href "" "bloqade.stim.rewrite.ifs_to_stim_partial.IfToStimPartial"
Rewrite measurement-conditioned IfElse using GetRecIdxFromPredicate.
Accepts the Bool condition directly (result of IsOne/IsZero) and creates GetRecIdxFromPredicate -> GetRecord -> CX/CY/CZ. If the body contains multiple Pauli gates, splits into multiple controlled gates sharing the same GetRecord result.