Quantum Netlist Compiler (QNC) Overview
- Quantum Netlist Compiler (QNC) is a three-stage quantum compiler that converts arbitrary unitaries, state vectors, or circuits into hardware-ready OpenQASM netlists.
- It employs recursive Givens rotations for decomposition combined with hardware-aware mapping and shortest-path routing to meet coupling constraints.
- Circuit optimizations such as gate coalescing and cancellation reduce gate counts and execution time, enhancing fidelity on superconducting backends.
The Quantum Netlist Compiler (QNC) is a three-stage quantum compiler that directly translates arbitrary unitary operators, target state vectors, or OpenQASM-2.0 circuits into hardware-executable, optimized OpenQASM-2.0 netlists. It is designed to bridge high-level algorithmic descriptions and quantum hardware constraints, enabling the efficient deployment of quantum algorithms on physical machines—primarily superconducting backends such as those in IBM’s quantum ecosystem. QNC distinguishes itself by supporting arbitrary unitaries, combining recursive decomposition, hardware-aware gate mapping, and circuit-level optimizations for both correctness and practical fidelity (Aktar et al., 2022).
1. Input Modalities and Compiler Architecture
QNC accepts three forms of input: an arbitrary unitary matrix , an -qubit state vector , or an existing OpenQASM-2.0 circuit. The compilation process is organized into three stages:
- Stage I: Decomposition
- For unitary input , QNC undertakes a sequence of two-level “Givens” rotations such that , where each affects a two-dimensional subspace.
- For state preparation, a unitary is found so , and is then decomposed analogously.
- Stage II: Mapping & Routing
- Physical hardware is modeled as an undirected graph , with physical qubits and edges representing allowed two-qubit couplings.
- Logical-to-physical qubit permutation is user-specified. For multi-qubit gates without direct hardware adjacency, shortest-path routing with Floyd–Warshall precomputation is used, inserting sequences of CNOTs to traverse coupling constraints.
- Stage III: Optimization
- Local circuit optimizations are performed: gate coalescing (combining sequential single-qubit rotations), cancellation of inverse operations, commutation relations for further reduction, and gate folding to decrease total gate count and depth.
- Internally, all transformations act on a Netlist data structure, where each entry (“GateRecord”) encodes the gate type (e.g., U1, U2, U3, CX), operated qubits, parameters , and a timing estimate in nanoseconds.
QNC targets IBM-style gate sets and outputs circuits in standard OpenQASM-2.0, with estimated timing to check against coherence budgets (Aktar et al., 2022).
2. Recursive Unitary Decomposition via Givens Rotations
The decomposition of arbitrary unitaries within QNC is governed by a recursive Givens-rotation scheme:
- For each column of a given -qubit unitary , lower off-diagonal elements are iteratively zeroed using two-level rotations working in the subspaces of the standard basis vectors .
- Each two-level rotation is constructed as
and nullifies in the th column.
- The cumulative transformation yields , producing a sequence of two-level unitaries sufficient for exact synthesis modulo floating-point arithmetic.
- To minimize controls, QNC uses basis-orderings such as Gray code: , ensuring adjacent pivots involve single-bit flips and thus fewer control qubits in multi-controlled gates.
- Each two-level rotation maps to a multi-controlled single-qubit gate, expanded into elementary operations using established gate decomposition procedures.
Currently, all decompositions are exact; there is no approximation except for floating-point rounding. There is provision in the design for future special-case optimization of structured operators such as the Quantum Fourier Transform (QFT) or sparse Hamiltonians (Aktar et al., 2022).
3. Hardware Mapping, Routing, and OpenQASM-2.0 Generation
QNC renders compiled circuits in OpenQASM-2.0 format. It uses the following target gate set, directly matching IBM’s superconducting backends:
- The generated prologue includes:
1 2 3 4
OPENQASM 2.0; include "qelib1.inc"; qreg q[n]; creg c[n];
- Each GateRecord is translated as:
1 2
U3(theta,phi,lambda) q[i]; CX q[i],q[j];
- Physical qubit placement is handled via a permutation array, and CNOT routing is achieved by substituting non-adjacent CNOTs with sequences mapped along the minimal path in . For each non-directly connected CX, QNC emits chains such as:
if and are not adjacent but both are adjacent to (Aktar et al., 2022).
- Each gate is tagged with an estimated physical duration, enabling hardware-aware fits to device-specific and coherence constraints for circuit validity assessment.
4. Circuit and Routing Optimization Techniques
QNC implements a selection of local circuit optimizations:
- Gate Coalescing: Sequential single-qubit rotations on the same wire are multiplied:
where .
- Gate Cancellation: Immediate pairs of inverse CX gates are canceled directly.
- Commutation: gates commute through CXs on the target line, exposing further opportunities for simplification.
Planned extensions include SWAP/cost-driven routing, where a cost function based on total circuit duration is minimized by dynamic qubit permutation, preparing QNC for integration of advanced peephole and lookahead optimization strategies (Aktar et al., 2022).
5. Benchmarking and Comparative Evaluation
QNC was evaluated on standard quantum algorithm benchmarks—Bernstein–Vazirani (2, 4, and 6 qubits), QFT (2–4 qubits), arbitrary state preparation (2–4 qubits), Grover’s 2-qubit oracle, Bell, Toffoli, and Fredkin circuits. The compiled circuits targeted IBM backends (Sydney, Melbourne, Rome) and QASM simulation.
Key experimental outcomes:
- Simulator success rate: 100% across all benchmarks.
- On hardware, success probabilities ranged from approximately 25% (4-qubit arbitrary state preparation) to 85% (2-qubit QFT), indicating coherence-limited fidelity.
- Compared to high-optimization runs of Qiskit, t|ket〉, and staq, QNC yielded comparable or slightly superior success rates for smaller circuits, attributable to aggressive rotation coalescing.
Sample execution success rates on IBMQ27 Sydney:
| Benchmark | QNC | Qiskit(opt) | t |ket〉 | staq | |-------------|-----|-------------|-------|------| | BV2 | 97% | 96% | 95% | 94% | | QFT3 | 82% | 80% | 78% | 76% | | Grover(2) | 88% | 89% | 87% | 85% | | Toffoli | 55% | 58% | 56% | 52% |
Example QFT3 metrics: QNC circuits used 13 gates (depth 9), Qiskit circuits used 11 gates (depth 8) (Aktar et al., 2022).
6. Strengths, Limitations, and Future Directions
QNC’s primary strengths include the ability to compile arbitrary unitaries or states without the need for template libraries, a modular and extensible C++17 codebase, a built-in timing model for physical-duration estimation, and competitive performance metrics versus industry-standard compilers.
Identified limitations:
- Scaling: The worst-case gate count scales as for unstructured operators; no specialized shortcuts are currently applied for circuits with recognizable algebraic structure (e.g., QFT, sparse Hamiltonian evolution).
- Routing and optimization: Presently implements only shortest-path routing; lacks advanced dynamic qubit remapping and deep lookahead.
- Target compatibility: Currently limited to IBM-style gate sets and coupling graphs without support for other backend technologies.
Planned research extensions aim to introduce specialized decompositions for standard subcircuits (e.g., QFT, GHZ, Dicke), integrate noise-aware placement and routing utilizing calibration data, extend optimization via more sophisticated peephole and cost-model-based routing strategies, and broaden backend support to include architectures such as Rigetti and IonQ through parametric timing and gate specs.
QNC thus occupies a unique position among quantum compilation tools, enabling the end-to-end transformation of high-level quantum linear algebra directly to hardware-legal gate sequences, with a transparent optimization and performance modeling framework. Its public code availability facilitates experimental adoption and future advances in quantum software toolchain research (Aktar et al., 2022).