Skip to content

Qasm2 to squin

QASM2ToSquin dataclass

QASM2ToSquin()

Bases: Pass

Converts a QASM2 kernel to a Squin kernel.

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.