Overview

The on-ramp to the quantum ecosystem.

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.

/ Capabilities

What it provides.

A complete QASM read-write bridge that connects the φCoherent stack to the broader quantum computing ecosystem without information loss.

  • / 01

    Full QASM 2.0 and 3.0 support

    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.

  • / 02

    Five-stage validation pipeline

    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.

  • / 03

    Round-trip fidelity

    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.

  • / 04

    Published benchmark compatibility

    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.

Measured benchmarks (GCC 13, -O3, Linux x86-64)

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.

Related packages
Licensing

Open under AGPLv3.

Published under the GNU AGPLv3 with whitepaper and reference implementation. Commercial licensing is available for closed-source deployments.

← Quantum Stack Commercial License