Skip to content

bloqade.squin.passes.qasm2_to_squin.QASM2ToSquin

← Module overview

classQASM2ToSquinsource

bloqade.squin.passes.qasm2_to_squin.QASM2ToSquin

Bases: Pass

Converts a QASM2 kernel to a Squin kernel.

class QASM2ToSquin

Some gates like qasm2.U1 and U2 are rewritten to squin.u3 gate with the necessary additional values plugged in to maintain equivalence. The same goes for parallel.RZ and glob.UGate. For qasm2.noise gates, they are rewritten to equivalent squin.noise gates.

Note that with the above, not all gates are convertible. For example, there is currently no support for converting a qasm2.CH or qasm2.Swap gate to squin due to the lack of a direct/near-direct equivalent. Furthermore, explicit classical register operations (e.g., creg and accessing/assigning elements from it) are not yet supported.

methodunsafe_runsource

bloqade.squin.passes.qasm2_to_squin.QASM2ToSquin.unsafe_run

def unsafe_run(mt: ir.Method) -> RewriteResult

Parameters

NameTypeDescription
mtir.Method

Returns

RewriteResult

source