Skip to content

bloqade.stim.passes.hint_const_in_loops.HintLen

← Module overview

classHintLensource

bloqade.stim.passes.hint_const_in_loops.HintLen

Bases: RewriteRule

Hint py.Len results as const from static IList type info.

class HintLen

Kept distinct from HintPureFromConcrete because the length comes from the operand’s type (IList[X, Literal(N)]), not from a const-hinted operand value — useful when the IList itself isn’t const but its length is statically known.

methodrewrite_Statementsource

bloqade.stim.passes.hint_const_in_loops.HintLen.rewrite_Statement

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

Parameters

NameTypeDescription
nodeir.Statement

Returns

RewriteResult

source