Status: Complete

Planned Preprint: “Beyond Gate Count: A Cross-Layer Analysis of Quantum Circuit Optimization and Pulse Fidelity”

Overview

A production-quality C++ quantum circuit optimizer designed to study cross-layer compilation: how gate-level optimization metrics (circuit depth, gate count) translate to pulse-level fidelity. This project bridges the CUDA Quantum Simulator for validation and QubitPulseOpt for pulse-aware analysis.

Key Research Question: Do circuits with fewer gates actually have higher pulse-level fidelity? Initial evidence suggests gate merging can create arbitrary rotation angles that are harder to implement, potentially reducing fidelity despite “better” gate counts.

Architecture

OpeOnpSOQCtAuAiiPBtSPrmaRpMacisEuruzst3siaeR/.ettsoE0riuxIotpIRnionnrpgtutHD4TOaAopnGpptd-aoi-bslmwasoirsegziesyetd:-dtaeicwcnnaaitnrrrececereucmlqiuelutrdabsitifiaitovtoreenm,asdrpieecpmspoiucrmnleemgansuttetinaopttnaairtoosinreo,rnpmuelrsgeingge,nefroaltdiionng

Key Features

Parser

  • OpenQASM 3.0 Parser: Hand-written recursive descent parser with error recovery
  • Supports standard gate set, qubit declarations, and circuit structure

Intermediate Representation

  • DAG-based IR: Nodes represent gates, edges represent qubit dependencies
  • Enables topological traversal for optimization
  • Similar to how LLVM uses SSA for data flow analysis

Optimization Passes

  • Identity Cancellation: X·X = I, H·H = I, etc.
  • Gate Commutation: Reorder gates to enable further cancellations
  • Rotation Merging: Rz(θ₁)·Rz(θ₂) = Rz(θ₁ + θ₂)
  • Constant Folding: Simplify known-value operations

Qubit Routing

  • SABRE Algorithm: State-of-the-art routing for NISQ devices
  • Multiple Topologies: Linear, grid, heavy-hex support
  • Minimizes SWAP overhead for hardware constraints

Testing

  • 340 Unit Tests: Comprehensive coverage across parser, IR, passes, and routing
  • GoogleTest framework with CI integration

Cross-Layer Analysis Pipeline

VAQnEaqlCucyiausrndictasuu-Q:imqut-ubCCcaior(introfrtPrsrcuuesoumll-mi-saLtsetaq-iOeyuompeaputgrntlatiatFumteimiod-zrmeveelqrtiert)iycsAnwailtyMVMhseaeialapssisuudulrarsetee:e::fdpiecudpoletrslhrei,etcfygtiandteeeslsictoyunt

Technology Stack

  • Language: C++17
  • Build: CMake
  • Parser: Hand-written recursive descent (OpenQASM 3.0)
  • IR Design: DAG-based (LLVM-inspired)
  • Routing: SABRE algorithm
  • Testing: GoogleTest (340 tests)

Why Build From Scratch?

Building a quantum compiler from scratch (rather than using Qiskit/TKET) demonstrates understanding of compiler infrastructure fundamentals. More importantly, owning the implementation allows precise control over optimization decisions—essential for studying cross-layer fidelity effects.

This project directly supports my PhD application narrative: “I build the software control stack to make noisy quantum hardware perform like a reliable computer.”