Skip to content

bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim

← Module overview

classSquinQubitToStimsource

bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim

Bases: RewriteRule

NOTE this require address analysis result to be wrapped before using this rule.

class SquinQubitToStim

methodrewrite_Statementsource

bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_Statement

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

Parameters

NameTypeDescription
nodeir.Statement

Returns

RewriteResult

source

methodrewrite_Resetsource

bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_Reset

def rewrite_Reset(stmt: qubit.stmts.Reset) -> RewriteResult

Parameters

NameTypeDescription
stmtqubit.stmts.Reset

Returns

RewriteResult

source

methodrewrite_SingleQubitGatesource

bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_SingleQubitGate

Signature
def rewrite_SingleQubitGate(stmt: gate.stmts.SingleQubitGate) -> RewriteResult

Rewrite 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

NameTypeDescription
stmtgate.stmts.SingleQubitGate

Returns

RewriteResult

source

methodrewrite_ControlledGatesource

bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_ControlledGate

Signature
def rewrite_ControlledGate(stmt: gate.stmts.ControlledGate) -> RewriteResult

Rewrite controlled gate nodes to their stim equivalent statements. Address Analysis should have been run along with Wrap Analysis before this rewrite is applied.

Parameters

NameTypeDescription
stmtgate.stmts.ControlledGate

Returns

RewriteResult

source

methodrewrite_RotationGatesource

bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_RotationGate

def rewrite_RotationGate(stmt: gate.stmts.RotationGate) -> RewriteResult

Rewrite 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

NameTypeDescription
stmtgate.stmts.RotationGate

Returns

RewriteResult

source

methodrewrite_U3Gatesource

bloqade.stim.rewrite.qubit_to_stim.SquinQubitToStim.rewrite_U3Gate

def rewrite_U3Gate(stmt: gate.stmts.U3) -> RewriteResult

Rewrite 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

NameTypeDescription
stmtgate.stmts.U3

Returns

RewriteResult

source