Predicting Expressibility of Parameterized Quantum Circuits using Graph
  Neural Network
Parameterized Quantum Circuits (PQCs) are essential to quantum machine
learning and optimization algorithms. The expressibility of PQCs, which
measures their ability to represent a wide range of quantum states, is a
critical factor influencing their efficacy in solving quantum problems.
However, the existing technique for computing expressibility relies on
statistically estimating it through classical simulations, which requires many
samples. In this work, we propose a novel method based on Graph Neural Networks
(GNNs) for predicting the expressibility of PQCs. By leveraging the graph-based
representation of PQCs, our GNN-based model captures intricate relationships
between circuit parameters and their resulting expressibility. We train the GNN
model on a comprehensive dataset of PQCs annotated with their expressibility
values. Experimental evaluation on a four thousand random PQC dataset and IBM
Qiskit's hardware efficient ansatz sets demonstrates the superior performance
of our approach, achieving a root mean square error (RMSE) of 0.03 and 0.06,
respectively.
Shamminuj Aktar, Andreas Bärtschi, Abdel-Hameed A. Badawy, Diane Oyen, Stephan Eidenbenz
# Predicting Expressibility of Parameterized Quantum Circuits using Graph Neural Network

###### Abstract

Parameterized Quantum Circuits (PQCs) are essential to quantum machine learning and optimization algorithms. The expressibility of PQCs, which measures their ability to represent a wide range of quantum states, is a critical factor influencing their efficacy in solving quantum problems. However, the existing technique for computing expressibility relies on statistically estimating it through classical simulations, which requires many samples. In this work, we propose a novel method based on Graph Neural Networks (GNNs) for predicting the expressibility of PQCs. By leveraging the graph-based representation of PQCs, our GNN-based model captures intricate relationships between circuit parameters and their resulting expressibility. We train the GNN model on a comprehensive dataset of PQCs annotated with their expressibility values. Experimental evaluation on a four thousand random PQC dataset and IBM Qiskit's hardware efficient ansatz sets demonstrates the superior performance of our approach, achieving a root mean square error (RMSE) of 0.03 and 0.06, respectively.

 Parameterized Quantum Circuits (PQCs), Expressibility, Graph Neural Networks (GNNs)

## I Introduction

Parameterized Quantum Circuits (PQCs) are essential in leveraging the capabilities of quantum computers. They provide a flexible framework for solving intricate problems by optimizing tunable parameters within a quantum circuit. A PQC is a sequence of gates applied to a set of qubits, with some gates allowing for adjustable classical parameters that can be varied during circuit execution to prepare a quantum state. The importance of PQCs has led to the development of new ansatz designs, e.g., problem-specific PQCs and hardware-efficient PQCs. Researchers have proposed different qualitative metrics i.e. expressibility [5], entangling capability [5], and trainability [3] to estimate the quality and usefulness of PQCs.

The expressibility of a PQC [5] determines its ability to explore states in the Hilbert space. Expressibility is measured by computing the Kullback-Leibler (KL) divergence [2] between the estimated fidelity distribution \(P_{PQC}(F;\theta)\) measured as a distance between sampled pairs of parameterized quantum states, and the maximally expressive uniform distribution resulting from a Haar-random unitary \(P_{Haar}(F)\)[1].

\[Expr=D_{KL}(P_{PQC}(F;\theta)||P_{Haar}(F)) \tag{1}\]

Lower KL divergence indicates better expressibility, meaning a better ability to explore a wider range of states in the Hilbert space. The fidelity distribution required in expressibility computations measures the overlap between two quantum states prepared using different sets of parameters. Measuring expressibility directly requires many samples, which are time-consuming to acquire. For instance, Sim et al. employed 5000 fidelity samples for four-qubit circuits to measure expressibility. This reliance on a large number of samples poses challenges due to the time and computational resources required.

To address these challenges, we propose a novel approach utilizing a Graph Neural Network (GNN) [4] to predict the expressibility of PQCs shown in Figure 1. GNNs have demonstrated exceptional capabilities in capturing complex relationships within graph-structured data, making them well-suited for analyzing the intricate structure of PQCs. We train and evaluate our GNN model on a comprehensive dataset of PQCs to demonstrate the effectiveness of our approach. Evaluation on around four thousand random PQCs and IBM Qiskit's hardware efficient ansatz sets demonstrate the high accuracy of the model, RMSE of 0.03 and 0.06, respectively.

## II Proposed Framework

### _Dataset Generation_

In our study, we generate random parameterized quantum circuits using a qubit gate set of X, SX, RX, RY, RZ, and CX

Fig. 1: Our proposed framework for predicting expressibility of PQC. We derive a graph representation of PQC with input, gate, and output nodes. Nodes are encoded with feature vectors representing node type and utilized qubits, edges capture information flow within the PQC, and global features encompass circuit characteristics.
gates. The first layer consists of random single-qubit gates for each qubit. That layer is followed by random entanglement between CX gates. The entanglement was established by selecting two random qubits and applying the CX gate between them. The length of the entanglement, representing the number of consecutive CX gates, was also chosen randomly. We then repeated the layers of single-qubit gates and CX entanglement multiple times to deepen the circuit. Finally, we concluded the circuit with another layer of single-qubit gates. Overall, we generated 12,000 circuits, with a maximum of 4 qubits and a maximum depth of 40. Next, we compute the estimated fidelity distribution for each circuit using the quantum kernel method to compute the distance between pairs of parameterized quantum states. We run the experiments in IBM QASM simulator and then we compute the expressibility values of the circuits using Equation 1. Additionally, we include 64 hardware-efficient ansatz circuits from Qikit's RealAmplitude circuits up to four qubits with up to 4 circuit repetitions with different entanglement patterns available as validation dataset.

### _Graph Neural Network (GNN) Model_

We utilize a GNN model to learn the complex relationship between PQCs and their expressibility. First, we extract a directed graph with a set of nodes, i.e., input, output, and gate nodes, and edge connectivity showing the flow of information within the PQC. Each node has a one-hot encoded vector representing features like node type and qubits. The circuits also include global feature sets, i.e., circuit depth, width, number of parameterized gates, number of qubits, and counts of different gates represented as a vector and fed to the GNN model using three fully connected (FC) layers. First, our architecture employs three SAGEConv layers to capture and process the local neighborhood information within the PQC graphs. Next, the global feature vector is concatenated with the aggregated node feature vector, and the combined representation is fed into the model. Finally, there is a regression layer to predict the expressibility value of the PQC.

### _Training and Evaluation_

We use 80% of the randomly generated PQC dataset to train our GNN model. Before training, we normalize the node features across the dataset by removing the mean and dividing the standard deviation. We train the model using Adam optimizer for 300 epochs with learning rate \(10^{-4}\) and weight decay \(10^{-6}\) and ReduceLROnPlateau scheduler that reduces the learning rate by a factor of 0.1. We utilize a batch size of 2048, employ the Huber loss as our loss function and save the model with the best validation loss. Figure 2(left) shows the training and testing prediction loss as the number of epochs increases during training. Our trained model achieved an RMSE of 0.03 for our testing dataset consisting of 20% randomly generated PQCs. Figure 2(right) shows scatter plots of model predicted expressibility vs. the true expressibility for our test dataset. Additionally, we evaluated our model using 64 circuits from IBM Qiskit's RealAmplitude circuits and achieved an RMSE of 0.06. Figure 3 demonstrate predicted vs. true expressibility for 64 RealAmplitude circuits. These results demonstrate the effectiveness of the GNN model in predicting the expressibility of PQCs.

Fig. 3: Predicted expressibility compared to true expressibility for the 64 Qiskit’s RealAmplitude circuits resulted in an overall RMSE of 0.06.

Fig. 2: _(Left)_: Prediction loss of training and testing datasets with the number of epochs during GNN model training shows the generalizability of the model. _(Right)_: Trained model’s predicted expressibility compared to the true expressibility for the testing dataset yielded an overall RMSE of 0.03
## III Conclusion

We present a GNN-based approach for predicting the expressibility of PQCs, considering the PQC as a graph. By leveraging the capabilities of GNNs, we effectively capture the intricate relationships between the structure of PQCs and their expressibility. Evaluation on the random PQC dataset and Qiskit's RealAmplitude circuit sets shows effective accuracy of our expressibility prediction technique. Importantly, this approach significantly reduces the cost associated with computing fidelity distribution for a large number of samples in expressibility computation.
