bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim
classSquinQubitToStim¶source
bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim
Bases: RewriteRule
NOTE this require address analysis result to be wrapped before using this rule.
class SquinQubitToStimmethodrewrite_Statement¶source
bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_Statement
def rewrite_Statement(node: ir.Statement) -> RewriteResultParameters
| Name | Type | Description |
|---|---|---|
node | ir.Statement |
Returns
RewriteResult
methodrewrite_Reset¶source
bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_Reset
def rewrite_Reset(stmt: qubit.stmts.Reset) -> RewriteResultParameters
| Name | Type | Description |
|---|---|---|
stmt | qubit.stmts.Reset |
Returns
RewriteResult
methodrewrite_SingleQubitGate¶source
bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_SingleQubitGate
Signature
def rewrite_SingleQubitGate(stmt: gate.stmts.SingleQubitGate) -> RewriteResultRewrite single qubit gate nodes to their stim equivalent statements. Address Analysis should have been run along with Wrap Analysis before this rewrite is applied.
Parameters
| Name | Type | Description |
|---|---|---|
stmt | gate.stmts.SingleQubitGate |
Returns
RewriteResult
methodrewrite_ControlledGate¶source
bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_ControlledGate
Signature
def rewrite_ControlledGate(stmt: gate.stmts.ControlledGate) -> RewriteResultRewrite controlled gate nodes to their stim equivalent statements. Address Analysis should have been run along with Wrap Analysis before this rewrite is applied.
Parameters
| Name | Type | Description |
|---|---|---|
stmt | gate.stmts.ControlledGate |
Returns
RewriteResult
methodrewrite_RotationGate¶source
bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_RotationGate
def rewrite_RotationGate(stmt: gate.stmts.RotationGate) -> RewriteResultRewrite rotation gate nodes (Rx, Ry, Rz) to stim rotation gate statements. Emits as I[R_X/R_Y/R_Z(theta=…)] in Stim annotation format. Address Analysis should have been run along with Wrap Analysis before this rewrite is applied.
Parameters
| Name | Type | Description |
|---|---|---|
stmt | gate.stmts.RotationGate |
Returns
RewriteResult
methodrewrite_U3Gate¶source
bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_U3Gate
def rewrite_U3Gate(stmt: gate.stmts.U3) -> RewriteResultRewrite U3 gate nodes to stim U3 gate statements. Emits as I[U3(theta=…, phi=…, lambda=…)] in Stim annotation format. Address Analysis should have been run along with Wrap Analysis before this rewrite is applied.
Parameters
| Name | Type | Description |
|---|---|---|
stmt | gate.stmts.U3 |
Returns
RewriteResult