bloqade.stim.rewrite.set_observable_partial.SetObservablePartial
← Module overview
class
method
sourcemethod
source
classSetObservablePartial¶source
bloqade.stim.rewrite.set_observable_partial.SetObservablePartial
Bases: RewriteRule
Rewrite SetObservable using GetRecIdxFromMeasurement placeholders.
class SetObservablePartialInstead of computing record indices from analysis results immediately, this injects GetRecIdxFromMeasurement statements that will be resolved post-analysis. The observable index is assigned by a simple counter based on statement order.
Attributes
| Name | Type | Default | Description |
|---|---|---|---|
observable_count | int | field(default=0, init=False) |
methodrewrite_Statement¶source
bloqade.stim.rewrite.set_observable_partial.SetObservablePartial.rewrite_Statement
def rewrite_Statement(node: ir.Statement) -> RewriteResultParameters
| Name | Type | Description |
|---|---|---|
node | ir.Statement |
Returns
RewriteResult
methodrewrite_SetObservable¶source
bloqade.stim.rewrite.set_observable_partial.SetObservablePartial.rewrite_SetObservable
def rewrite_SetObservable(node: SetObservable) -> RewriteResultParameters
| Name | Type | Description |
|---|---|---|
node | SetObservable |
Returns
RewriteResult