bloqade.squin.passes.qasm2_to_squin.QASM2ToSquin
classQASM2ToSquin¶source
bloqade.squin.passes.qasm2_to_squin.QASM2ToSquin
Bases: Pass
Converts a QASM2 kernel to a Squin kernel.
class QASM2ToSquinSome 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_run¶source
bloqade.squin.passes.qasm2_to_squin.QASM2ToSquin.unsafe_run
def unsafe_run(mt: ir.Method) -> RewriteResultParameters
| Name | Type | Description |
|---|---|---|
mt | ir.Method |
Returns
RewriteResult