unitaryHACK 2025 has come to a close.

🐣🧩 PyQASM

PyQASM is a Python toolkit providing an OpenQASM 3 semantic analyzer and utilities for program analysis and compilation.

OpenQASMĀ is a powerful language for expressing hybrid quantum-classical programs, but it lacks a comprehensive tool supporting the full capabilities of the language. PyQASM addresses this by using the official ANTLR grammar as a reference for OpenQASM 3’s language structure and by leveraging the openqasm3.parser to interact with the official AST. On top of this foundation, it adds high-level utilities such as program validation and unrolling.

In PyQASM, ā€œunrollingā€ (also known as program flatteningĀ orĀ inlining) refers to the process of simplifying a quantum program by expanding custom gate definitions, and flattening complex language constructs such as subroutines, loops, and conditional statements into a linear sequence of basic operations. By converting the program into this simplified format, it becomes easier to perform subsequent transpilation or compilation steps before executing the program on a quantum device.

Resources:

Closed bounties: