bloqade.stim.rewrite.insert_ticks.InsertTicks
← Module overview
class
method
sourcemethod
source
classInsertTicks¶source
bloqade.stim.rewrite.insert_ticks.InsertTicks
Bases: RewriteRule
Insert a ``TICK`` after every Stim operation.
class InsertTicksOperates on a lowered Stim circuit. After each operation statement (gate,
reset, measurement, or noise channel) a
Tick is inserted, so the
rendered diagram’s columns follow program order rather than ASAP packing.
The rule is idempotent — an operation already followed by a TICK is
left untouched — so it is safe under Fixpoint.
methodis_operation¶source
bloqade.stim.rewrite.insert_ticks.InsertTicks.is_operation
def is_operation(stmt: ir.Statement) -> boolWhether the statement is a moment-advancing Stim operation.
Parameters
| Name | Type | Description |
|---|---|---|
stmt | ir.Statement |
Returns
bool
methodrewrite_Statement¶source
bloqade.stim.rewrite.insert_ticks.InsertTicks.rewrite_Statement
def rewrite_Statement(node: ir.Statement) -> RewriteResultInsert a TICK after node when it is an un-ticked operation.
Parameters
| Name | Type | Description |
|---|---|---|
node | ir.Statement |
Returns
RewriteResult