Table of Contents
Fetching ...

Q-fid: Quantum Circuit Fidelity Improvement with LSTM Networks

Yikai Mao, Shaswot Shresthamali, Masaaki Kondo

TL;DR

Q-fid tackles the challenging problem of estimating quantum-circuit fidelity on NISQ devices amid fluctuating hardware noise and transpilation effects. It introduces an LSTM-based predictor that treats fidelity prediction as time-series forecasting on a text-based circuit representation, augmented by the discrete $R^2$ metric $d-R^2$ to quantify output fidelity. The approach is hardware-agnostic and capable of adapting to device drift without explicit calibration inputs, achieving an average RMSE of $0.0515$ and outperforming mapomatic by up to $24.7x$ in mean fidelity predictions. Practically, Q-fid enables better transpilation decisions and resource savings by prioritizing high-fidelity layouts and dynamically updating its model as hardware conditions change.

Abstract

The fidelity of quantum circuits (QC) is influenced by several factors, including hardware characteristics, calibration status, and the transpilation process, all of which impact their susceptibility to noise. However, existing methods struggle to estimate and compare the noise performance of different circuit layouts due to fluctuating error rates and the absence of a standardized fidelity metric. In this work, Q-fid is introduced, a Long Short-Term Memory (LSTM) based fidelity prediction system accompanied by a novel metric designed to quantify the fidelity of quantum circuits. Q-fid provides an intuitive way to predict the noise performance of Noisy Intermediate-Scale Quantum (NISQ) circuits. This approach frames fidelity prediction as a Time Series Forecasting problem to analyze the tokenized circuits, capturing the causal dependence of the gate sequences and their impact on overall fidelity. Additionally, the model is capable of dynamically adapting to changes in hardware characteristics, ensuring accurate fidelity predictions under varying conditions. Q-fid achieves a high prediction accuracy with an average RMSE of 0.0515, up to 24.7x more accurate than the Qiskit transpile tool mapomatic. By offering a reliable method for fidelity prediction, Q-fid empowers developers to optimize transpilation strategies, leading to more efficient and noise-resilient quantum circuit implementations.

Q-fid: Quantum Circuit Fidelity Improvement with LSTM Networks

TL;DR

Q-fid tackles the challenging problem of estimating quantum-circuit fidelity on NISQ devices amid fluctuating hardware noise and transpilation effects. It introduces an LSTM-based predictor that treats fidelity prediction as time-series forecasting on a text-based circuit representation, augmented by the discrete metric to quantify output fidelity. The approach is hardware-agnostic and capable of adapting to device drift without explicit calibration inputs, achieving an average RMSE of and outperforming mapomatic by up to in mean fidelity predictions. Practically, Q-fid enables better transpilation decisions and resource savings by prioritizing high-fidelity layouts and dynamically updating its model as hardware conditions change.

Abstract

The fidelity of quantum circuits (QC) is influenced by several factors, including hardware characteristics, calibration status, and the transpilation process, all of which impact their susceptibility to noise. However, existing methods struggle to estimate and compare the noise performance of different circuit layouts due to fluctuating error rates and the absence of a standardized fidelity metric. In this work, Q-fid is introduced, a Long Short-Term Memory (LSTM) based fidelity prediction system accompanied by a novel metric designed to quantify the fidelity of quantum circuits. Q-fid provides an intuitive way to predict the noise performance of Noisy Intermediate-Scale Quantum (NISQ) circuits. This approach frames fidelity prediction as a Time Series Forecasting problem to analyze the tokenized circuits, capturing the causal dependence of the gate sequences and their impact on overall fidelity. Additionally, the model is capable of dynamically adapting to changes in hardware characteristics, ensuring accurate fidelity predictions under varying conditions. Q-fid achieves a high prediction accuracy with an average RMSE of 0.0515, up to 24.7x more accurate than the Qiskit transpile tool mapomatic. By offering a reliable method for fidelity prediction, Q-fid empowers developers to optimize transpilation strategies, leading to more efficient and noise-resilient quantum circuit implementations.
Paper Structure (22 sections, 2 equations, 15 figures, 1 table, 2 algorithms)

This paper contains 22 sections, 2 equations, 15 figures, 1 table, 2 algorithms.

Figures (15)

  • Figure 1: Bernstein-Vazirani Algorithm. The expected output is $q_1q_0=$$\ket{10}$ ($q_2$ is not measured). Output distribution after running the circuit for 1,024 times on real hardware (ibm_ nairobi) is plotted on the right, the correct state $\ket{10}$ has been measured 937 times, but the wrong measurements $\ket{00}$ and $\ket{11}$ also appears in the distribution due to noise.
  • Figure 2: (a) Error map of ibm_ nairobi on Dec. 9, 2022, generated by the IBM Q platform ibmq. (b) $T_1/T_2$ fluctuation of the 7 physical qubits inside ibm_ nairobi. 100 data points were collected from Aug. 25 to Dec. 18, 2022. Note that data is not continuous due to scheduled/unscheduled system maintenance, for example around Nov. 1.
  • Figure 3: Example of a Randomized Benchmarking circuit. The first part is the randomly generated Clifford gates, followed by the calculated reversal gates. The final measurement should be $\ket{00}$ if no errors occur.
  • Figure 4: Quantum circuit placed in a coordinate system with the y-axis as qubit/classical bit, and the x-axis as time. It can be viewed as the qubits being manipulated through each timestep from the left to the right on the time axis.
  • Figure 5: Overview of Q-fid's workflow. The first stage is input preparation (a, b, c), where the QCs are compressed and mapped to their corresponding text label. The compression causes the gates to stack visually but they are executed individually on hardware because the qubits are not physically connected (as shown in Fig. S4(a)). The second stage is tokenizer training (d, e), the tokenizer will look through all the QCs in the dataset and assign each text label with an integer according to their appearing frequency. After the tokenizer is trained, it will use its internal dictionary to translate all of the QCs in the dataset to an integer representation, which is called tokenization (f). Q-fid's neural network uses embedding (g) and LSTM (h) layers to encode the integer labels and then extract sequential and relationship information from the QC, each prediction (i) is associated with one timestep in the QC. After the final timestep, the output will be the fidelity prediction of the full QC, represented as a d-$R^2$ score.
  • ...and 10 more figures