Reads and writes QASM 2.0 and 3.0 — the universal language of quantum computing — enabling circuit exchange with Qiskit, Cirq, and any published benchmark suite.
QASM (Quantum Assembly) is the de facto standard language for describing quantum circuits. Research papers publish benchmark circuits in QASM; platforms like Qiskit and Cirq accept and export it; hardware vendors provide calibration data in QASM format. An implementation that cannot speak QASM is isolated from this ecosystem.
The QASM parser provides a five-stage validation pipeline — tokenize, validate, parse, assemble, and convert — that produces fully-typed φCoherent Circuit objects from any valid QASM input, and serializes any φCoherent Circuit back to QASM for export to external tools.
Both versions of the standard are covered, including all gate types, register definitions, and include directives. Circuits from older tools and the latest research import equally well.
Structured parsing that catches errors at the earliest possible stage and produces helpful diagnostics. Problems are identified and explained, not silently propagated as corrupted circuits.
Converting QASM to a φCoherent Circuit and back to QASM produces an equivalent circuit. Import and export workflows preserve the full meaning of the original, enabling reliable exchange with external platforms.
Any QASM circuit from a research paper or benchmark repository loads directly into the φCoherent stack without modification, making it straightforward to compare stack performance against published baselines.
QASM 2.0 round-trip fidelity: exact (statevector diff = 0.000) for GHZ, BV, and QAOA. Parse latency: GHZ(5) 0.0033 ms, BV(8) 0.0087 ms, QAOA(4q 2-layer) 0.0875 ms. Export latency: GHZ(5) 0.0017 ms. 100–500× faster than Python-based Qiskit for equivalent circuits. QASM 3.0: DynamicCircuit with mid-circuit measurement and classical feed-forward — quantum teleportation circuit parsed, executed, and re-exported correctly. Validator catches out-of-bounds qubit indices, unknown gates, and missing semicolons with line-number error annotations.
Published under the GNU AGPLv3 with whitepaper and reference implementation. Commercial licensing is available for closed-source deployments.