Table of Contents
Fetching ...

Graph Neural Networks on Quantum Computers

Yidong Liao, Xiao-Ming Zhang, Chris Ferrie

TL;DR

The paper tackles the scalability limitations of classical Graph Neural Networks by proposing quantum frameworks that mirror the three main GNN flavours: Graph Convolutional Networks, Graph Attention Networks, and Message-Passing GNNs. It develops quantum implementations for vanilla GCNs (data encoding via amplitude encoding, block-encoded diffusion, and PQCs for layer transformations), Simplified Graph Convolution (SGC) and Linear Graph Convolution (LGC) (using block-encodings and Quantum Singular Value Transformation), and quantum attention/MP-GNN variants with block-encoded sparse matrices and attention mechanisms. A thorough complexity analysis reveals potential quantum advantages in both time and space under depth-qubit trade-offs, including logarithmic-time or logarithmic-space regimes for SGC and LGC and corresponding cost-function evaluation via the Modified Hadamard Test. The work situates itself within Geometric Quantum Machine Learning, demonstrates architecture-specific benefits for large-scale graphs, and lays groundwork for future experimental validation and expansion to more advanced GNNs on quantum hardware.

Abstract

Graph Neural Networks (GNNs) are powerful machine learning models that excel at analyzing structured data represented as graphs, demonstrating remarkable performance in applications like social network analysis and recommendation systems. However, classical GNNs face scalability challenges when dealing with large-scale graphs. This paper proposes frameworks for implementing GNNs on quantum computers to potentially address the challenges. We devise quantum algorithms corresponding to the three fundamental types of classical GNNs: Graph Convolutional Networks, Graph Attention Networks, and Message-Passing GNNs. A complexity analysis of our quantum implementation of the Simplified Graph Convolutional (SGC) Network shows potential quantum advantages over its classical counterpart, with significant improvements in time and space complexities. Our complexities can have trade-offs between the two: when optimizing for minimal circuit depth, our quantum SGC achieves logarithmic time complexity in the input sizes (albeit at the cost of linear space complexity). When optimizing for minimal qubit usage, the quantum SGC exhibits space complexity logarithmic in the input sizes, offering an exponential reduction compared to classical SGCs, while still maintaining better time complexity. These results suggest our Quantum GNN frameworks could efficiently process large-scale graphs. This work paves the way for implementing more advanced Graph Neural Network models on quantum computers, opening new possibilities in quantum machine learning for analyzing graph-structured data.

Graph Neural Networks on Quantum Computers

TL;DR

The paper tackles the scalability limitations of classical Graph Neural Networks by proposing quantum frameworks that mirror the three main GNN flavours: Graph Convolutional Networks, Graph Attention Networks, and Message-Passing GNNs. It develops quantum implementations for vanilla GCNs (data encoding via amplitude encoding, block-encoded diffusion, and PQCs for layer transformations), Simplified Graph Convolution (SGC) and Linear Graph Convolution (LGC) (using block-encodings and Quantum Singular Value Transformation), and quantum attention/MP-GNN variants with block-encoded sparse matrices and attention mechanisms. A thorough complexity analysis reveals potential quantum advantages in both time and space under depth-qubit trade-offs, including logarithmic-time or logarithmic-space regimes for SGC and LGC and corresponding cost-function evaluation via the Modified Hadamard Test. The work situates itself within Geometric Quantum Machine Learning, demonstrates architecture-specific benefits for large-scale graphs, and lays groundwork for future experimental validation and expansion to more advanced GNNs on quantum hardware.

Abstract

Graph Neural Networks (GNNs) are powerful machine learning models that excel at analyzing structured data represented as graphs, demonstrating remarkable performance in applications like social network analysis and recommendation systems. However, classical GNNs face scalability challenges when dealing with large-scale graphs. This paper proposes frameworks for implementing GNNs on quantum computers to potentially address the challenges. We devise quantum algorithms corresponding to the three fundamental types of classical GNNs: Graph Convolutional Networks, Graph Attention Networks, and Message-Passing GNNs. A complexity analysis of our quantum implementation of the Simplified Graph Convolutional (SGC) Network shows potential quantum advantages over its classical counterpart, with significant improvements in time and space complexities. Our complexities can have trade-offs between the two: when optimizing for minimal circuit depth, our quantum SGC achieves logarithmic time complexity in the input sizes (albeit at the cost of linear space complexity). When optimizing for minimal qubit usage, the quantum SGC exhibits space complexity logarithmic in the input sizes, offering an exponential reduction compared to classical SGCs, while still maintaining better time complexity. These results suggest our Quantum GNN frameworks could efficiently process large-scale graphs. This work paves the way for implementing more advanced Graph Neural Network models on quantum computers, opening new possibilities in quantum machine learning for analyzing graph-structured data.
Paper Structure (31 sections, 117 equations, 22 figures, 5 tables)

This paper contains 31 sections, 117 equations, 22 figures, 5 tables.

Figures (22)

  • Figure 1: Overall circuit construction for the three Quantum GNN architectures along with the three "flavours"of classical GNN layersbronstein2021geometric.
  • Figure 2: GNN pipeline and three "flavours" of GNN layersbronstein2021geometric GNN architectures are permutation equivariant functions $\mathbf{F}(\mathbf{X}, \mathbf{A})$ constructed by applying shared permutation invariant functions $\phi$ over local neighbourhoods. This local function $\phi$ is sometimes referred to as "diffusion," "propagation," or "message passing," and the overall computation of such $\mathbf{F}$ is known as a "GNN layer." These flavours determine the extent to which $\phi$ transforms the neighbourhood features, allowing for varying levels of complexity when modelling interactions across the graph.
  • Figure 3: GCN Pipeline. A GCN consists of a series of layers in which graph convolution and non-linear activation functions are applied to the node features. (Note that the schematics in this figure are for illustration purposes only, e.g. the normalized adjacency matrix depicted here does not include the added self-connections) At the output of the last layer, softmax activation function, defined as $\operatorname{softmax}\left(x_{i}\right)=\frac{1}{\mathcal{Z}} \exp \left(x_{i}\right)$ with $\mathcal{Z}=\sum_{i} \exp \left(x_{i}\right)$, is applied row-wise to the node feature matrix, producing the final output of the network: $Z=\text{softmax}(\hat{A} H^{(K-1)} W^{(K-1)})$. For semi-supervised multi-class classification, the cost function is defined by the cross-entropy error over all labelled examples kipf2017semi:$L=-\sum_{s \in {Y}_{L}} \sum_{f=1}^{F_K} Y_{s f} \ln Z_{s f}$, where ${Y}_{L}$ is the set of node indices that have labels, $Y\in \mathbb{B}^{N \times F_K}$ denotes the one-hot encoding of the labels.
  • Figure 4: Quantum implementation of linear layer-wise transformation for multi-channel GCN The linear layer-wise transformation for multi-channel GCN (i.e. the layer-specific trainable weight matrix and the normalized adjacency matrix multiplied on the node feature matrix), can be implemented by applying the block-encoding of the normalized adjacency matrix and a parametrized quantum circuit on the two quantum registers $Reg(i)$ and $Reg(k)$ respectively. Here we depicted the first layer of GCN --- the linear layer-wise transformation is applied on the state prepared by the data encoding procedure (the blue box) described in Section \ref{['de']}. Note that the schematics in this figure are for illustration purposes only, e.g. 1) the normalized adjacency matrix depicted here does not include the added self-connections; 2) the ancillary qubits used in the quantum state preparation for the data encoding is not depicted in this figure.
  • Figure 5: Example of the full quantum circuit for a GNN layer ($C=1$, single channel). Utilising NTCA in our Quantum GCN to implement a non-linear activation function, we take the unitary of data encoding and graph convolution as components to build a new unitary that generates the desired state whose amplitudes are transformed by certain nonlinear functions. Note that the schematics in this figure are for illustration purposes only.
  • ...and 17 more figures