NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Codar: A Contextual Duration-Aware Qubit Mapping for Various NISQ Devices

Haowei Deng, Yu Zhang, Quanxi LiDAC 2020

TL;DR

Quantum computers, especially those in the Noisy Intermediate-Scale Quantum (NISQ) era, have limited qubit connectivity, requiring complex compilation steps. This paper introduces CODAR, a novel qubit mapping algorithm that accounts for both the context of quantum operations and their varying durations. CODAR significantly speeds up quantum programs by up to 1.258x on average while maintaining circuit fidelity, outperforming existing methods.

What Problem Does This Paper Address?

Quantum computers, particularly those in the NISQ era, are characterized by limited connectivity between qubits. This means that two-qubit gates, which are fundamental for quantum computation, can only be applied to specific pairs of physical qubits. To execute a quantum program, logical qubits in the program must be mapped to physical qubits on the device. This mapping process often requires inserting "SWAP" operations to move qubits around, which can increase the circuit's depth and execution time, and potentially introduce errors.

Previous qubit mapping algorithms often make a simplifying assumption: they treat all quantum gates as having the same execution duration. This is a significant drawback because, in reality, different types of gates (e.g., CNOT vs. T gates) have different durations, and this variation can be exploited to improve performance. Furthermore, these algorithms often overlook the "context" of operations – how the execution of one gate might affect the availability or timing of subsequent gates. This paper addresses the challenge of creating more efficient qubit mappings by considering both the varying durations of quantum gates and the contextual dependencies between operations, aiming to extract more parallelism from quantum programs.

Methods

The core of this work is the COntext-sensitive and Duration-Aware Remapping algorithm (CODAR). CODAR builds upon a novel abstraction called the Multi-architecture Adaptive Quantum Abstract Machine (maQAM).

Here's a breakdown of the key methods:

  • maQAM Abstraction: This framework models quantum devices with configurable parameters, including qubit connectivity (as a graph) and the durations of different gate types. This allows CODAR to be adaptable to various NISQ architectures.
  • Qubit Lock Mechanism: This is a crucial innovation. CODAR assigns a "tend" (time until next free) to each physical qubit. When a gate occupies a qubit, its "tend" is updated based on the gate's duration. This mechanism allows CODAR to know precisely when a qubit will become available, preventing operations from being scheduled on busy qubits and thus avoiding unnecessary delays. This directly addresses the varying gate durations.
  • Commutativity Detection: CODAR identifies "Commutative Forward" (CF) gates. These are gates that can be executed in parallel with other gates, even if they share qubits, provided they commute. By identifying CF gates, CODAR can expose more opportunities for parallelism and look ahead in the program's execution.
  • Heuristic Cost Function for SWAP: When SWAP operations are necessary due to connectivity limitations, CODAR uses a heuristic cost function to select the "best" SWAP. This function has two components:
  • Basic Priority (Hbasic): This prioritizes SWAPs that reduce the overall distance between qubits that need to interact for future gates.
  • Fine Priority (Hfine): For 2D lattice architectures, this component further refines the SWAP selection by considering the horizontal and vertical distances, aiming to maintain routing flexibility and improve future parallelism.

CODAR's algorithm iteratively selects directly executable gates, applies them, and then, for non-executable gates, identifies candidate SWAPs. It prioritizes SWAPs based on the heuristic cost function, inserts them, and updates qubit locks, repeating until the circuit is fully mapped.

Datasets

The paper does not introduce new datasets. Instead, it uses a collection of 71 benchmarks sourced from:

  • IBM Qiskit and RevLib.
  • Quantum algorithms compiled from ScaffCC and Quipper.
  • Benchmarks previously used for evaluating the SABRE algorithm.

These benchmarks range in size from 3 to 36 qubits and up to 30,000 gates. The experiments were conducted on simulated hardware models representing IBM Q16 Melbourne, IBM Q20 Tokyo, a 6x6 grid, and Google's 54-qubit Sycamore processor.

Key Insights and Ideas

  • Gate Duration Matters: The most significant insight is that ignoring gate duration differences leads to suboptimal qubit mappings. By accounting for how long each gate takes, CODAR can schedule operations more efficiently and exploit parallelism that would otherwise be missed.
  • Qubit Lock for Temporal Awareness: The "qubit lock" mechanism is a clever way to manage temporal dependencies. It provides a precise, duration-aware way to track qubit availability, which is crucial for optimizing schedules in NISQ devices.
  • Contextual Awareness Unlocks Parallelism: Identifying Commutative Forward (CF) gates and considering program context allows CODAR to make smarter decisions about SWAP insertions, leading to better parallelism and reduced execution time.
  • Heuristics for SWAP Optimization: The dual-priority heuristic (Hbasic and Hfine) for selecting SWAP gates is a practical approach to balance immediate benefits (reducing gate distance) with long-term flexibility (maintaining routing options).

Key Results

  • Speedup: CODAR achieves an average speedup ratio of 1.212 to 1.258 across four different architectures (IBM Q16 Melbourne, Enfield 6x6, IBM Q20 Tokyo, and Google Q54 Sycamore) compared to the SABRE algorithm.
  • Fidelity Maintenance: Despite potentially inserting more SWAP gates than some other algorithms, CODAR maintains circuit fidelity. In simulations using a noisy quantum virtual machine (OriginQ), CODAR either matches or outperforms SABRE in fidelity, especially when noise is dominated by qubit dephasing.
  • Adaptability: The maQAM abstraction and CODAR's design allow it to be applied to various NISQ device architectures.

Limitations and Future Work

  • SWAP Overhead: While CODAR focuses on speedup and fidelity, it may insert more SWAP gates than algorithms solely focused on minimizing SWAP count. The paper acknowledges this trade-off.
  • Heuristic Nature: CODAR is a heuristic algorithm, meaning it aims for good solutions but doesn't guarantee optimality. The performance of the heuristic cost function could potentially be further improved.
  • Future Work: The authors suggest that further exploration of gate commutation relations and more sophisticated heuristic cost functions could lead to even better performance. Additionally, extending CODAR to handle more complex noise models and device-specific constraints would be valuable.

Summary updated

BibTeX
@inproceedings{deng2020codar,
  author = {Haowei Deng and Yu Zhang and Quanxi Li},
  title = {{Codar: A Contextual Duration-Aware Qubit Mapping for Various NISQ Devices}},
  booktitle = {DAC},
  year = {2020},
  doi = {10.1109/dac18072.2020.9218561},
}
Figure