What can we learn from quantum convolutional neural networks?
We can learn from analyzing quantum convolutional neural networks (QCNNs)
that: 1) working with quantum data can be perceived as embedding physical
system parameters through a hidden feature map; 2) their high performance for
quantum phase recognition can be attributed to generation of a very suitable
basis set during the ground state embedding, where quantum criticality of spin
models leads to basis functions with rapidly changing features; 3) pooling
layers of QCNNs are responsible for picking those basis functions that can
contribute to forming a high-performing decision boundary, and the learning
process corresponds to adapting the measurement such that few-qubit operators
are mapped to full-register observables; 4) generalization of QCNN models
strongly depends on the embedding type, and that rotation-based feature maps
with the Fourier basis require careful feature engineering; 5) accuracy and
generalization of QCNNs with readout based on a limited number of shots favor
the ground state embeddings and associated physics-informed models. We
demonstrate these points in simulation, where our results shed light on
classification for physical processes, relevant for applications in sensing.
Finally, we show that QCNNs with properly chosen ground state embeddings can be
used for fluid dynamics problems, expressing shock wave solutions with good
generalization and proven trainability.
Chukwudubem Umeano, Annie E. Paine, Vincent E. Elfving, Oleksandr Kyriienko
# What can we learn from quantum convolutional neural networks?

###### Abstract

We can learn from analyzing quantum convolutional neural networks (QCNNs) that: 1) working with quantum data can be perceived as embedding physical system parameters through a hidden feature map; 2) their high performance for quantum phase recognition can be attributed to generation of a very suitable basis set during the ground state embedding, where quantum criticality of spin models leads to basis functions with rapidly changing features; 3) pooling layers of QCNNs are responsible for picking those basis functions that can contribute to forming a high-performing decision boundary, and the learning process corresponds to adapting the measurement such that few-qubit operators are mapped to full-register observables; 4) generalization of QCNN models strongly depends on the embedding type, and that rotation-based feature maps with the Fourier basis require careful feature engineering; 5) accuracy and generalization of QCNNs with readout based on a limited number of shots favor the ground state embeddings and associated physics-informed models. We demonstrate these points in simulation, where our results shed light on classification for physical processes, relevant for applications in sensing. Finally, we show that QCNNs with properly chosen ground state embeddings can be used for fluid dynamics problems, expressing shock wave solutions with good generalization and proven trainability.

## I Introduction

Quantum computing offers a paradigm for solving computational problems in a distinct way [1; 2]. It has been considered for addressing challenges in chemistry [3; 4], material science [5; 6; 7; 8], high-energy physics [9; 10], optimization and finances [11; 12; 13], and recently, for solving machine learning problems on quantum computers [14; 15; 16; 17; 18]. The latter is the task of quantum machine learning (QML). Quantum machine learning is a rapidly progressing field of research, which comprises different techniques that may offer a speedup [15], as well as a range of other advantages that have not been considered before [19; 20]. To date, this includes examples from supervised learning (represented by classification [21; 22; 23; 24; 25; 26; 27; 28; 29; 30; 31; 32] and regression [33; 34; 35; 36; 37; 38]), reinforcement learning [39; 40; 41; 42], and unsupervised learning with a strong effort in generative modelling [43; 44; 45; 16]. By far the strongest effort concerns classification [51]. A typical workflow starts with loading classical datasets \(\mathcal{D}=\{\mathbf{x}_{m},y_{m}\}_{m=1}^{M}\) comprising \(M\) data samples. The features \(\mathbf{x}\) can be embedded into parametrized gates or quantum state amplitudes, and by processing the corresponding quantum states one can match class labels \(y_{m}\) from the training subset [16]. The goal is to predict unseen samples. Here, the workflow involves quantum circuits for _embedding_ classical data (known as quantum feature maps \(\tilde{\mathcal{U}}_{\mathbf{x}}(\mathbf{x})\)[52; 36; 53]), which generate a state in Hilbert space of the processing device, \(\mathbf{x}\mapsto|\psi(\mathbf{x})\rangle=\tilde{\mathcal{U}}_{\mathbf{x}}(\mathbf{x})|\psi\rangle\). The states are then processed by variational circuits (aka ansate) \(\hat{\mathcal{V}}_{\mathbf{\theta}}\)[16; 54], and measured for some observable \(\hat{\mathcal{O}}\). This distantly resembles deep learning [55], for the model formed in a quantum latent space, and is referred to as a quantum neural network (QNN) [55; 56; 57]. While QNNs were successfully applied to many proof-of-principal tasks [51; 54], some issues remain to be resolved before seeing their utility in practice. These issues include limited trainability for models of increased size, corresponding to barren plateaus (BPs) of vanishing gradients of QNNs [58; 59], and generally rugged optimization landscape [60; 61]. Also, despite an increased expressive power of QNN-based models [56; 62; 63], they remain heuristic in nature, and a clear separation of quantum and classical model performance can only be established for very peculiar datasets [64; 65]. Another strongly related issue is that high expressivity of quantum models implies limited trainability [66]. This may lead to overfitting in cases where the chosen basis set does not match the required problem [67].

Recently, an increasing number of works considered quantum machine learning models for training on _quantum_ data [68; 69; 70; 71; 72]. In this case a quantum dataset \(\hat{\mathcal{Q}}=\{\hat{\rho}_{\alpha},y_{\alpha}\}_{\alpha=1}^{M}\) corresponds to the collection of \(M\) quantum states \(\hat{\rho}_{\alpha}\) (pure or mixed) coming from some quantum process, and associated labels \(y_{\alpha}\) that mark their distinct class or property. When learning on quantum data, quantum computers have shown excellent results in sample complexity [68; 69; 73; 74]. A striking example corresponds to quantum convolutional neural networks (QCNNs). Introduced in Ref. [75] by Cong _et al._, this type of network was designed to take quantum states, and using _convolution_ (translationally-invariant variational quantum circuits) and _pooling_ (measurement with conditional operations) prepare an efficient model for predicting the labels. This was used for quantum phase classification at increasing scale applied to spin-1/2 cluster model and Ising model in one-dimensional (1D) systems. The results for phase classification were reproduced and extended in other studies [69; 76; 77] showing that few samples are needed for training, generalization is excellent [69], and accuracy is superior to other approaches [77]. Moreover, the scaling of gradients was shown to decrease polynomially in the system size (thus -- efficiently), such that QCNNs avoid barren plateaus [78]. This is in contrast to exponentially decreasing gradient variance for generic deep circuits [58; 59]. Current intuition is that working with quantum data leads to better generalization, as QCNNs inherently "analyze" the structure of entanglement of quantum states [75], and reduced entanglement leads to better gradients [79; 80]. However, despite the success of QCNNs, their full understanding is missing, and leaves them aside of mainstream QML. This hinders the development and use of
QCNN-type models beyond explored classification examples.

In this work, we aim to demystify the inner workings of quantum convolutional neural networks, specifically highlighting why they are so successful in quantum phase recognition. We show that supplied quantum states (features) can be understood in terms of _hidden_ feature maps -- quantum processes that prepare states depending on classical parameters \(\mathbf{x}\) (being a feature vector or scalar; see Fig. 1). During the mapping process, we observe that the ground state preparation supplies a very beneficial basis set, which allows the building of a nonlinear quantum model for the decision boundary -- the ultimate goal of classification -- that is sharp and generalizes on few data points and with smaller number of measurement shots. This is compared to the rotation-based Fourier embedding, which requires feature engineering for sufficient generalization. We connect the developed QCNN description with error correction and multi-scale entanglement renormalization ansatz (MERA) explanations from Ref. [75], and show that single-qubit observables can be used to "pick up" the most suitable basis functions, while leading to sampling advantage. Motivated by classification, we apply the described QCNN workflow with ground state embedding to solve regression problems motivated by fluid dynamics. This can offer QML tools to deal with critical phenomena with improved generalization.

## II Background

### Quantum neural networks as Fourier-type models

Quantum machine learning has evolved from being perceived as a linear algebra accelerator [15] into a versatile tool for building quantum models. The typical workflow corresponds to mapping (embedding) a classical dataset \(\mathcal{D}\) with a feature map as a quantum circuit \(\hat{\mathcal{U}}_{\varphi}(x)\) such that features \(x\mapsto|\psi(x)\rangle=\hat{\mathcal{U}}_{\varphi}(x)|\phi\rangle\) are represented in the latent space of quantum states [53, 37, 57]. The next step corresponds to adapting the generated states with a variational circuit \(\hat{\mathcal{V}}_{\theta}\), and reading out the model as an expectation value of an observable \(\hat{\mathcal{O}}\). The last two steps can also be seen as a measurement adaptation process [81]. Summarizing the workflow, we build QML models as

\[f_{\theta}(x)=\langle\varphi|\hat{\mathcal{U}}_{\varphi}(x)^{\dagger}\hat{ \mathcal{V}}_{\theta}^{\dagger}\hat{\mathcal{O}}\hat{\mathcal{V}}_{\theta} \hat{\mathcal{U}}_{\varphi}(x)|\phi\rangle, \tag{1}\]

where \(|\phi\rangle\coloneqq|0\rangle^{\otimes N}\) is the computational zero state, and the corresponding approach for instantiating \(f_{\theta}(x)\) is often referred to as the quantum neural network approach. Usually, the embedding is performed by circuits that involve single-qubit rotations \(\hat{R}_{\beta}=\exp[-ix\hat{P}_{\beta}/2]\)[82, 36] (for Pauli matrices \(\hat{P}_{\beta}=\hat{X},\hat{Y},\hat{Z}\)) or evolution of some multi-qubit Hamiltonian \(\hat{G}\) (being the generator of dynamics) such that the map is \(\hat{\mathcal{U}}_{\varphi}(x)=\exp[-ix\hat{G}/2]\). Following this convention, it is easy to see that under the spectral decomposition of \(\hat{G}=\sum_{j}\lambda_{j}|s_{j}\rangle\langle s_{j}|\) (with eigenvalues \(\{\lambda_{j}\}_{j}\) and eigenstates \(\{|s_{j}\rangle\}_{j}\)) the feature map includes complex exponents that depend on \(x\)[83, 53]. Importantly, for the specified structure of the feature map the transformation to the diagonal basis is \(x\)-independent. When accounting for the structure of expectation values, the differences \(\{|\lambda_{j}-\lambda_{j}|\}_{j,j^{\prime}}\) of eigenvalues (spectral gaps) appear as frequencies for the underlying Fourier basis. The action of the variational circuit is then to "weight" the Fourier components, but not the features directly. The resulting model can be written as [53]

\[f_{\theta}(x)=\sum_{\omega\in\Omega}c_{\omega}(\theta)e^{i\omega x}, \tag{2}\]

where \(c_{\omega}(\theta)\) are coefficients that depend on matrix elements of \(\hat{\mathcal{O}}\) and \(\hat{\mathcal{V}}_{\theta}\), and \(\Omega\) denotes a finite bandwidth spectrum of frequencies generated by the feature map. Its degree depends on the generator \(\hat{G}\) and its eigenvalues. In Ref. [53] the authors mention that rescaling of \(x\) as \(\varphi(x)\) does not change the model qualitatively, and we can see QNNs as Fourier-type models of large size [81]. Within this picture one can even imagine randomized Fourier models that can be treated classically and have similar performance [84].

Looking back into the steps leading to Eq. (2), we highlight that the presented description is by no means a complete guide

Figure 1: Visualization for the classification process of physical phases with a quantum convolutional neural network (QCNN). We highlight that input states \(\hat{\varphi}(\mathbf{x})\) for the network come from actual physical processes, e.g. preparation of ground states for spin lattices. The analyzed states depend on underlying classical features \(\mathbf{x}\) of the system, being the physical parameters (externally controlled like magnetic field and temperature, or internal parameters like degree of anisotropy). This can be seen as a _hidden_ feature map (left). The goal of QCNN is then building a model based on a simple few-qubit observable \(\hat{\mathcal{O}}\), with its expectation \(\langle\hat{\mathcal{O}}\rangle(\mathbf{x})\) representing a nonlinear decision boundary with respect to the system features.
to QNNs and building of quantum machine learning model in general. We observe that it implies the crucial assumption of the unitarity of the feature map and its form \(\exp(-ix\hat{G}/2)\) that generates exponents as basis functions. Recently, the embeddings based on linear combinations of unitaries (LCU) were proposed that break this assumption [85]. This is represented by the orthogonal Chebyshev feature map \(\hat{\mathcal{U}}_{\varphi}(x)\) such that it generates states of the form \(|\tau(x)\rangle=\sum_{k}c_{k}T_{k}(x)|k\rangle\), where \(T_{k}(x)\) are amplitudes corresponding to Chebyshev polynomials of first-kind and degree \(k\), and \(c_{k}\) are constant factors. Importantly, here the amplitudes are \(x\)-dependent and form the basis for future quantum modelling. Another counter example to the Fourier-type models is the embedding of the type

\[\hat{\mathcal{U}}_{\varphi}(x)=\exp\left(-\frac{i}{2}\hat{G}_{0}-\frac{ix}{2} \hat{G}_{1}\right), \tag{3}\]

where \([\hat{G}_{0},\hat{G}_{1}]\neq 0\) as generators do not commute. In this case the spectral representation of the generator \(\hat{G}(x)\coloneqq\hat{G}_{0}+x\hat{G}_{1}\) requires a basis transformation \(\hat{W}(x)\) that is \(x\)-dependent. This leads to a feature dependence appearing in the coefficients \(c_{\omega}(\theta,x)\) in Eq. (2), and departs from the Fourier modelling in a more nontrivial way than simply rescaling, \(x\rightarrow\varphi(x)\). In cases of LCU and noncommuting embedding, or indeed any other case that does not fit the evolution embedding, the generated quantum states shall be seen as feature-dependent states

\[|\psi(x)\rangle=\sum_{j}\phi_{j}(x)|j\rangle, \tag{4}\]

with amplitudes \(\{\phi_{j}(x)\}\) of orthonormal states \(\{|j\rangle\}\) being functions of \(x\), and representing the basis for building quantum models.

Given this layout of quantum neural networks, the unsettling question arises: how does the Fourier model description fit the quantum data story and QCNN-based models that are too distinct from what we just described?

### Quantum convolutional neural networks: prior art

In the seminal paper by Cong _et al._[75] the authors have put forward the model with convolution and pooling layers, suggested as an analog of classical convolutional neural networks. They have used it for processing quantum states \(|\psi_{\alpha}\rangle\) (or \(\hat{p}_{\alpha}=|\psi_{\alpha}\rangle\langle\psi_{\alpha}|\)) as ground states of spin models. The circuit consists of convolution unitaries \(\{\hat{U}_{i}\}\) and controlled unitaries \(\{\hat{V}_{i}\}\) for pooling (both considered being adjustable), followed by measuring \(\hat{O}\) as a few-qubit observable, while discarding the rest of the qubit register (collapsed on some measurement outcomes). The model then becomes

\[f_{\{\hat{U}_{i},\hat{V}_{i},\hat{O}_{i}\}}(|\psi_{\alpha}\rangle)=\langle\psi _{\alpha}|\prod_{i=1}^{1}(\hat{U}_{i}^{\dagger}\hat{V}_{i}^{\dagger})\hat{O} \prod_{i=1}^{L}(\hat{V}_{i}\hat{U}_{i})|\psi_{\alpha}\rangle, \tag{5}\]

where we again stress that \(\hat{O}\) corresponds to measuring \(\hat{N}\ll N\) qubits, while tracing out the rest. Here, unitaries \(\{\hat{U}_{i},\hat{V}_{i}\}\) can be varied with \(O(1)\) variational parameters, and layers are translationally invariant. Then the QCNN has only \(O(\log N)\) variational parameters for \(N\)-qubit models, and is trainable [78]. The task is to take the model in Eq. (5) and fit it to label values of the quantum dataset \(\{y_{\alpha}\}\) for each state. This can be achieved by optimizing the mean squared error (MSE) loss

\[\mathcal{L}_{\text{MSE}}=\frac{1}{M}\sum_{\alpha=1}^{M}\left\{y_{\alpha}-f_{ \{\hat{U}_{i},\hat{V}_{i},\hat{O}_{i}\}}(|\psi_{\alpha}\rangle)\right\}^{2}. \tag{6}\]

The loss can be minimized via the gradient descent or any other method suitable for non-convex optimization. As for the dataset, it was suggested to use ground states of spin-1/2 Hamiltonians. In particular, in most QCNN studies the cluster Hamiltonian with magnetic field and Ising terms was considered [69; 75], corresponding to

\[\hat{\mathcal{H}}_{\text{QCNN}}=-J\sum_{i=1}^{N-2}\hat{Z}_{i}\hat{X}_{i+1} \hat{Z}_{i+2}-h_{\text{x}}\sum_{i=1}^{N}\hat{X}_{i}-J_{\text{xx}}\sum_{i=1}^{ N-1}\hat{X}_{i}\hat{X}_{i+1}, \tag{7}\]

where the open boundary conditions are considered. This specific Hamiltonian is chosen as an example of non-trivial spin order in 1D, being uniquely related to the measurement-based quantum computing [86]. In Eq. (7) the first term corresponds to the spin-1/2 cluster Hamiltonian with three-body terms, the second term represents the transverse field, and the third term contains Ising interaction terms. The point \(h_{\text{x}}=J_{\text{xx}}=0\) corresponds to a \(\mathbb{Z}_{2}\times\mathbb{Z}_{2}\) symmetric Hamiltonian that hosts in its ground state a symmetry protected topological (SPT) phase. For \(J_{\text{xx}}=0\) we can study the transition from SPT order at \(J>h_{\text{x}}\) to staggered ferromagnetic order at \(J<h_{\text{x}}\), with \(h_{\text{x}}/J=1\) corresponding to the critical point. In the SPT phase and for the open boundary the ground state is four-fold degenerate, and is characterized by the string order parameter and nonzero topological entanglement entropy [87]. Examples of QCNN-based classification show that by measuring the string order \(\hat{O}=\hat{Z}_{1}\hat{X}_{2}\hat{X}_{3}\).\(\hat{X}_{N-2}\hat{X}_{N-1}\hat{Z}_{N}\) one can distinguish the SPT phase from other phases (open boundary). It is also known that string order implies the utility of states for performing measurement-based quantum computing [86] for which the ground state subspace (cluster states) represent the resource.

From the perspective of ground state analysis, the QCNN circuit is designed to measure the effective decision boundary as an expanded string order [75], and the pre-defined QCNN circuit can do this exactly if it satisfies certain criteria (see Ref. [75], section "Construction of QCNN" in Methods), being suggested as guiding principles for building QCNNs. The first guiding principle is referred to as the fixed point criterion, where the exact cluster state \(|\psi_{0}\rangle_{N}\) for \(N\) qubits has to be convoluted and pooled to the \(|\psi_{0}\rangle_{N/3}\) cluster state, with measurements of \(2N/3\) qubits deterministically giving \(0\) bits upon measurement. The second guiding principle is named as the error correction criterion, where pooling layers have to be designed such that errors that commute with global symmetry are fixed during measurements. This procedure is related to MERA. However, from the point of view of QML, it is yet to be understood how does entanglement play a role in this workflow.
## III Model

Here, we take the QCNN structure for quantum phase recognition and connect it with the standard QML workflow. For this we note that quantum states \(\ket{\psi_{\alpha}}\) are not abstract quantum "data points", but in fact are the result of quantum processes that correspond to thermalization or ground state (GS) preparation. Specifically, they depend on properties of the underlying Hamiltonian, and its parameters representing features \(x\). Namely, for the cluster-type Hamiltonian used in QCNNs so far these are couplings \(J\), \(J_{\rm xx}\) and magnetic field \(h_{\rm x}\). These system parameters represent a feature vector \(x=\{J,h_{\rm x},J_{\rm xx}\}\) (and each concrete realization is denoted by index \(\alpha\)). Even though we may not have access to them, they define the underlying behavior of the system we attempt to classify. The process of embedding these features as a part of the state preparation we call a _hidden_ feature map (Fig. 1). The circuits for preparing QCNN input as ground states of models \(\ket{\psi_{0}(x)}\) may differ, and can comes both from experiments (e.g. sensors) or specifically designed GS preparation schedule. In the following we assume that there exists a unitary \(\hat{\mathcal{U}}_{\varphi}(x)\) or a completely positive trace-preserving map \(\hat{\mathcal{E}}_{\varphi}(x)\) for the ground state preparation of studied Hamiltonians, and summarize different options in the Appendix A.

### Cluster ground state embedding

Let us now consider an example that can shed light on the internal structure of quantum convolutional neural networks. For this we take a spin-1/2 cluster Hamiltonian with periodic boundary. In this case the ground state in the SPT phase is unique and non-degenerate. From the technical perspective this allows working at smaller system size without being harmed by finite size effects, and avoid thermal ensemble state preparation (as pure ground state suffices in this case). Specifically, we consider the Hamiltonian of the form

\[\hat{\mathcal{H}}_{\rm t-cluster}=-J\sum_{i=1}^{N}Z_{i}\hat{X}_{i+1}\hat{Z}_{ i+2}-h_{\rm x}\sum_{i=1}^{N}\hat{X}_{i}-h_{\rm z}\sum_{i=1}^{N}\hat{Z}_{i}, \tag{8}\]

where we have introduced an additional weak symmetry breaking term with a longitudinal field \(h_{\rm z}\ll h_{\rm x},J\). We mostly care about the \(J/h_{\rm x}\) transition, and for practical reasons keep \(h_{\rm z}=10^{-2}J\). This ensures that we break the degeneracy between states that have \(\mathbb{Z}_{2}\) symmetry. Note that in the Hamiltonian \(\hat{\mathcal{H}}_{\rm t-cluster}\) [Eq. (8)] we use periodic boundary conditions such that \(\hat{X}_{N+1}\equiv\hat{X}_{1}\), \(\hat{Z}_{N+1}\equiv\hat{Z}_{1}\), \(\hat{Z}_{N+2}\equiv\hat{Z}_{2}\) etc. Finally, it is convenient to reparametrize the transverse cluster Hamiltonian in the form

\[\hat{\mathcal{H}}(x)=-\cos\left(\frac{\pi x}{2}\right)\sum_{i=1}^{N}\hat{Z}_{ i}\hat{X}_{i+1}\hat{Z}_{i+2}-\sin\left(\frac{\pi x}{2}\right)\sum_{i=1}^{N} \hat{X}_{i}-\varepsilon\sum_{i=1}^{N}\hat{Z}_{i}, \tag{9}\]

where we introduced the effective parameters

\[x\coloneqq\frac{2}{\pi}\arcsin\left(\frac{h_{\rm x}}{\sqrt{J^{2}+h_{\rm z}^{ 2}}}\right),\ \ \text{and}\ \ \varepsilon\coloneqq\frac{h_{\rm z}}{\sqrt{J^{2}+h_{\rm z}^{2}}}\ll 1. \tag{10}\]

We assume that \(x\) changes from \(0\) to \(1\) via control of \(h_{\rm z}\), while \(h_{\rm z}\) is adjusted to keep \(\varepsilon\) constant and small. Next, we prepare the ground state (GS) of \(\hat{\mathcal{H}}(x)\) assuming one of the preparation strategies (Appendix A). The corresponding circuit, which we denote \(\hat{\mathcal{U}}_{\varphi}(x)\), represents our feature map, acting such that \(\hat{\mathcal{U}}_{\varphi}(x)\ket{\psi}=\ket{\psi_{0}(x)}\) being the \(x\)-dependent ground state. Tuning \(x\) from zero to one, we go from the SPT phase with the cluster GS to a trivial product state \(\ket{\psi_{0}(1)}=\ket{+}^{\otimes N}\), through the critical point \(x_{\rm cr}=1/2\) where the GS develops nontrivial correlations. We highlight that one of the possible preparation circuits can be based on the Hamiltonian variational ansatz (HVA) [88]. Due to the favorable dynamical Lie algebra scaling for this model [89] and large gradients for HVA in general [90], the corresponding feature map is efficient, meaning that the depth of the preparation circuit scales at most quadratically in the system size. However, for the purpose of numerical tests it is also instructive to use exact diagonalization, as it allows for clean studies of ground state embedding and its properties irrespective of variational preparation.

Finally, keeping in mind the Hamiltonian of interest, we stress that our goal is to distinguish the SPT phase from the trivial phase. For this we need to define the string order parameter \(\hat{\mathcal{O}}\). Given that the 1D cluster model is based on \(N\) 3-body stabilizers \(\{\hat{S}_{i}\}=\{\hat{Z}_{i}\hat{X}_{i+1}\hat{Z}_{i+2}\}_{i=1}^{N}\), the string order corresponds to their product over the periodic boundary,

\[\hat{\mathcal{O}}=\prod_{i=1}^{N}\hat{S}_{i}=(-1)^{N}\hat{X}_{1}\hat{X}_{2}...\hat{X}_{N}, \tag{11}\]

and it corresponds to the parity operator with the reverted sign. Taking the expectation value of \(\hat{\mathcal{O}}\) is our proxy to the definition of SPT order [86], while other independent checks also include topological entanglement entropy estimation.

Figure 2: Analysis of a simple \(N=3\) cluster model. **(a)** Sketch of the spin-1/2 chain with ZXZ couplings, periodic boundary conditions, and assuming the transverse magnetic field. **(b)** Basis functions of the ground state embedding for the \(N=3\) cluster model, shown as squared projections \(\ket{\phi_{i}(x)}^{2}\) on computational basis states \(j=000,100,...,111\). Superscript indices indicate degeneracies for one-hot and two-hot states. **(c)** Products of the basis functions \(\phi_{i}^{\prime}(x)\phi_{j}(x)\) corresponding to antidiagonal components, and their sum that represents the expectation value of the string order operator \(\langle\hat{\mathcal{O}}\rangle(x)\).
### Analysis of the ground state embedding from the QNN perspective

Once we have established the system Hamiltonian \(\hat{\mathcal{H}}(x)\), the mapping procedure \(\hat{\mathcal{U}}_{\varphi}(x)\), and the measurement (cost) operator \(\hat{\mathcal{O}}\) [Eq. (11)], we proceed to classification from the point of view of quantum model building. For this, we study the basis set of our feature-dependent ground states \(|\psi_{0}(x)\rangle\). Namely, we assume the embedded states to be decomposed in the computational basis \(|\psi_{0}(x)\rangle\coloneqq\sum_{j}\phi_{j}(x)|j\rangle\), presented as computational \(2^{N}\) basis states \(\{|j\rangle\}\) with corresponding binary/integer representation, weighted by the \(x\)-dependent basis functions \(\{\phi_{j}(x)\}_{j=0}^{2^{N}-1}\). It is instructive to visualize this basis in some form. We choose to project feature states onto the computational basis states (much like in case of QCBMs [45; 48]), reading out probabilities \(|\phi_{j}(x)|^{2}=|\langle j|\psi_{0}(x)\rangle|^{2}\), which can be seen as diagonal matrix elements of the corresponding density operator \(\hat{\rho}_{0}(x)=|\psi_{0}(x)\rangle\langle\psi_{0}(x)|\). We choose a minimal example with \(N=3\), shown in Fig. 2(a), and plot the corresponding squared basis functions in Fig. 2(b). We observe that all basis functions undergo a drastic change exactly at the critical point \(x_{\rm cr}\), introducing an implicit bias for building models with an inherent criticality. We observe different behavior is associated to matrix elements that involve ferromagnetic bitstrings \(j=000\) and \(j=111\), one-hot bitstrings (\(j=100,010,001\)), and two-hot states \(j=110,101,011\). Attlitedly, these basis functions are shown in the computational basis, while the string order lies in the X Pauli plane. We next proceed to show how the required basis functions are "picked up" by the string order observable \(\hat{\mathcal{O}}=(-1)^{3}\hat{X}_{1}\hat{X}_{2}\hat{X}_{3}\). This specific string contains only anti-diagonal matrix elements (of \(-1\) entries), such that the opposite (i.e. bitwise conjugated \(j\leftrightarrow\hat{j}\)) pairs of states are connected. In Fig. 2(c) we plot the product of basis functions \(\phi_{j}^{*}(x)\cdot\phi_{j}(x)\) that are collected when estimating the expectation. One can see that all contributions represent sigmoid-like functions, with slightly increasing or decreasing fronts. Importantly, there are multiple degeneracies, such that one can pick multiple contributions when building the model (thus, success does not depend on specific projections and unique elements). Finally, we see that the sum of all antidiagonal products, being the expectation \(\langle\psi_{0}(x)|\hat{\mathcal{O}}|\psi_{0}(x)\rangle\), represents a sharp decision boundary even at small system size. We proceed to see how this basis analysis plays out in the full QCNN workflow.

### Analysis of QCNN basis transformation from the QNN perspective

Next, we want to see how the decision boundary is built by fixed quantum convolutional neural network with pre-defined convolution and pooling introduced in Ref. [75]. We remind that these are built based on the two criteria described previously in the text. To compose the fixed QCNN circuit we impose the criteria using the tools for lattice spin models. Specifically, one can observe that the pure ZXZ cluster Hamiltonian \(\hat{\mathcal{H}}_{\rm ZXZ}=-J\sum\limits_{i=1}^{N}\hat{Z}_{i}\hat{X}_{i+1} \hat{Z}_{i+2}\) can be unitarily transformed into the trivial X Hamiltonian \(\hat{\mathcal{H}}_{\rm X}=-h_{\rm x}\sum\limits_{i=1}^{N}\hat{X}_{i}\), with the transformation generated by the sum of nearest neighbour Ising terms \(\hat{\mathcal{H}}_{\rm ZZ}=J_{\rm x}\sum\limits_{i=1}^{N}\hat{Z}_{i}\hat{Z}_{ i+1}\). This recently introduced procedure is referred to as _pivoting_[91]. We observe that considering the pivot unitary

\[\hat{U}_{\rm pivot}=\exp\left(-i\frac{\pi}{4}\sum\limits_{j=1}^{N}(-1)^{j} \hat{Z}_{j}\hat{Z}_{j+1}\right), \tag{12}\]

Figure 3: Analysis of the nine-qubit quantum convolutional neural network for the cluster state Hamiltonian. **(a)** QCNN circuit with a fixed predefined structure, motivated by the criteria for SPT phase recognition. It comprises of convolution and pooling layers, which represent unitaries that perform a basis change from the cluster state basis into a product basis (UNPREPARE operation corresponding to pivoting unitary \(\hat{\mathcal{U}}_{\rm pivot}\) and a layer of Hadamards), and conditional operations that ensure that in the lowest order of symmetry breaking terms the product state remains trivial (CORRECT operation). We also label different stages of the protocol (stage A to D) that help understanding of how the underlying basis changes during QCNN processing. **(b)** Visualization of the basis set for \(N=9\) QCNN at stage B, where squared amplitudes projected on computational basis states are shown as a function of the Hamiltonian parameter \(x\). Multiple degenerate solution of the sigmoid type are generated. **(c)** The resulting models \(\langle\hat{\mathcal{O}}\rangle(x)\) of the fixed QCNN that are read out at different stages. Orange curve corresponds to the full QCNN operation with pooling procedure, representing a sharp decision boundary at stage D for \(\bar{N}=1\). This coincides with string order parameter measured full width 9-qubit \(\langle\hat{X}_{1}\hat{X}_{2}\hat{X}_{N}\rangle\) prior to QCNN action, and \(\bar{N}=3\) measurement of the order parameter \(\langle\hat{\mathcal{O}}_{\bar{N}=3}\rangle\simeq\langle\hat{X}_{2}\hat{X}_{3} \hat{X}_{3}\rangle\) at stage C. The case of measuring \(\langle\hat{\mathcal{O}}_{\bar{N}=1}\rangle\simeq\langle\hat{X}_{3}\rangle\) and \(\langle\hat{\mathcal{O}}_{\bar{N}=3}\rangle\) observables in the absence of pooling (i.e. with CORRECT layers being removed) are shown with blue and magenta dashed curves. We note that here decision boundaries can be shifted by \(\pm 1\) and/or trivially scaled by \(1/2\) to yield the comparison where needed.
and assuming \(J=h_{\rm x}\), we can perform the Hamiltonian transformation

\[\hat{\mathcal{H}}_{\rm X}=\hat{U}_{\rm pivot}\hat{\mathcal{H}}_{\rm ZXZ}\hat{U}_{ \rm pivot}^{\dagger}, \tag{13}\]

and similar transformation applies to change the basis of corresponding eigenstates. The corresponding SPT ground state of ZXZ cluster model thus is unitarily connected with the trivial ground state of \(|+\rangle^{\otimes N}\cong\hat{U}_{\rm pivot}|\psi_{\rm(o=SPT)}\rangle\) (up to a global phase). Given the specific angle of \(\pi/2\) two-qubit rotation, we can see pivoting as an effective layer of commuting CZ gates. Indeed, this is how cluster states are prepared in one-dimensional systems [86].

We visualize the steps of the fixed QCNN in Fig. 3(a) as the full circuit for \(N=9\) qubits. The step-by-step description is presented in Appendix B, and here we summarize the main points. The fixed circuit structure represents the QCNN targeting the SPT phase recognition. For this, starting from the ideal cluster state at \(x=0\) the goal is to de-entangle qubits via pivoting [91] (UNPREPARE layer in Fig. 3a), and make sure that the expected value of the string order parameter is maximized. Additionally, assuming defects (biflips \(\hat{X}_{i}\)) in the cluster state generated by the transverse field for \(x>0\), the pooling layer is designed to test values of qubits that are traced out, and correct possible errors on qubits chosen for building the model (CORRECT layer in Fig. 3a).

Now, let us analyze the action of the fixed QCNN circuit in terms of building quantum models \(f_{\hat{b}_{\rm block}}(x)\) and track how the basis set of the function changes. We already know that initially (i.e. at stage A, Fig. 3a) the basis corresponds to functions that peak and dip around \(x=x_{\rm cr}\). Once we have performed the first pivot and arrived into the Z basis (stage B), we can plot the basis set, again representing as squared projections on computational basis states. This is shown in Fig. 3(b). We see that the basis consists of functions which qualitatively match the switching-on and -off behavior, and contain many degenerate basis functions. Next, we proceed to the first pooling layer that corrects errors that may have arose on the subset of qubits (here qubits 2, 5, and 8). If we are to stop at the effective 3-qubit model, we shall return to the SPT ground state for this reduced register by applying PREPARE layer and measuring \(\hat{O}_{\mathcal{N}=3}=(-1)\hat{X}_{2}\hat{X}_{5}\hat{X}_{8}\) at stage C in Fig. 3a. We show the corresponding decision boundary as the \(x\)-dependent expectation \(\langle\hat{O}\rangle\) leading to the sharp transition in Fig. 3(c) labeled as "\(\tilde{N}=1\) and 3 pooling". This overlays with the decision boundary based on the full \(N=9\)-qubit string order parameter measured prior to the action of QCNN (blue dashed curve). Next, we continue to another QCNN pooling layer, such that the model is reduced from 9 to 1 qubit. In this case we unprepare the 3-qubit SPT ground state, and perform checks on qubits 2 and 8 such that the state of qubit 5 matches the expected value. Essentially, it corresponds to measuring \(\hat{\mathcal{O}}_{\mathcal{B}=1}=-\hat{X}_{5}\) (stage D in Fig. 3a). We plot the corresponding decision boundary and see that it again matches the sharp transition in Fig. 3(c) labeled as "\(\tilde{N}=1\) and 3 pooling". However, what if there are no pooling layers applied to the input data state, and we measure reduced size operators directly after the convolutional layers? The models for \(\tilde{N}=3\) and \(\tilde{N}=1\) are shown in Fig. 3(c) as dashed violet and magenta curves, labeled with "(no pooling)" tag. We see that in this case the decision boundary is blurred, and cannot offer the same degree of accuracy, mostly due to deviations in the critical region.

Finally, let us offer another understanding of the fixed QCNN workflow. The action of 9-3-1 QCNN leads to the model being \(\langle\psi(x)|\hat{\mathcal{H}}_{\rm QCNN}^{\dagger}\hat{X}_{5}\hat{ \mathcal{U}}_{\rm QCNN}|\psi(x)\rangle\), where \(\hat{\mathcal{U}}_{\rm QCNN}\) collect all layers (notice that no mid-circuit measurements are required, and we can simply trace out anything but the middle qubit). We can then see the action of QCNN as measuring an effective "dressed" operator \(\hat{\mathcal{H}}_{\rm QCNN}^{\dagger}\hat{X}_{5}\hat{\mathcal{U}}_{\rm QCNN} \cong\hat{X}_{1}\hat{X}_{2}...\hat{X}_{9}\), which is equal to the string order parameter up to the global phase. This simply means that pooling makes sure we pick up the relevant basis states from our embedding, while building the model on the small subset of qubits. This is very important for trainability, as we reduce the shot noise (smaller number of measurements is required for models based on single-qubit sampling), and still enjoy the access to the full basis. We believe that the very same strategy can be applied for building other QML models, and QCNN-like measurement adaptation can improve solvers beyond classification.

## IV Variational QCNN Training

Departing from the fixed QCNN structure, we now allow for adjustable elements and compose a variational quantum convolutional neural network keeping the same overall QCNN layout.

### QCNN trained on cluster ground state embedding

We proceed to compose the variational QCNN circuit. The goal is to build a variational ansatz inspired by the fixed QCNN structure to see whether we can recover a suitable basis for classification via training. We start by dealing with the convolutional layer. First, we change the layer of Hadamard

Figure 4: **(a)** Parameterized elements of the variational QCNN circuit that substitute the fixed QCNN elements for pivoting and correction layers. Layers are translationally invariant but SU(2) and ZZ unitaries have different angles. **(b)** Examples of the decision boundary for the 9-qubit variational QCNN during the training. We show decision boundaries, starting from random initialization (curve 1; 42% test accuracy), and increasing number of epochs to 25, 50, 100, and 200 (curves 2-5, respectively).
gates into a layer of trainable SU(2)\({}_{\theta}\) gates, where we implement an arbitrary one-qubit rotation as a sequence of three fixed-axis rotations, SU(2)\({}_{\theta}=\hat{R}_{\text{X}}(\theta_{1})\hat{R}_{\text{Z}}(\theta_{2})\hat{R}_{ \text{X}}(\theta_{3})\). We also make the pivot unitary adjustable. This corresponds to changing the pivot unitary based on ZZ(\(\pi/2\)) gates to arbitrary angle two-qubit operations ZZ(\(\theta\)). We decide to place an SU(2) layer before and after the pivot layer to allow for more control over the basis set. The same three parameters are used for each of the SU(2)\({}_{\theta}\) gates in a layer to ensure translational invariance, and the same applies for each ZZ(\(\theta\)) gate, as Fig. 4(a) shows. Hence, the convolutional layer acting on the full nine-qubit register has seven independent parameters. We also note that the convolutional layers acting on three qubits depicted in Fig. 3(a) can be cancelled out, and the final Hadamard is swapped out for an SU(2)\({}_{\theta}\) gate. We then turn to the pooling layer, where we again use controlled operations to avoid the use of mid-circuit measurements and show that QCNN effectively corresponds to an efficient basis adaptor. The fixed Toffoli gates are changed into trainable gates, where the target is now acted on by the SU(2)\({}_{\theta}\) unitary. To enable bit flipping of the control gates, we place one-qubit SU(2)\({}_{\theta}\) gates before each control qubit, and the corresponding SU(2)\({}_{\theta}^{\dagger}\) gate after each control qubit. We again keep translational invariance by ensuring each trainable Toffoli gate within the pooling layer has the same parameters. Therefore, the pooling layer has nine independent parameters.

The input state is the \(x\)-dependent GS of the cluster Hamiltonian \(|\psi(x)\rangle\). The QCNN circuit is applied on this state, and a final measurement \(\hat{O}=\langle\hat{X}_{5}\rangle\) determines the output of the model. Hence our model \(f_{\theta}(x)\) can be written in the form given by Eq. (5). Our goal is to perform the binary classification of the two phases corresponding to the symmetry-protected topological order (class A) and the staggered ferromagnetic order (class B). To train this model, we sample training data points \(\{x_{\alpha}\}\) uniformly between 0 and 1, with labels determined by measuring the SPT order parameter, and assigning \(y_{\alpha}\) labels \(-1\) and 1 to class A and class B, respectively. Our loss function is the MSE as defined in Eq. (6), and we minimize this loss using stochastic gradient descent. Specifically, we use the Adam optimizer with a learning rate of 0.05. We then test the trained model on data \(\{x_{\beta}\}\) randomly sampled from a normal distribution. This is to ensure proper testing of the trained QCNN around the critical point, where classification is most challenging. When testing the binary classification, we evaluate the model for each \(x_{\beta}\). If \(f_{\theta}(x_{\beta})<0\), then we place \(|x_{\beta}\rangle\) in class A, corresponding to the SPT phase, and if \(f_{\theta}(x_{\beta})>0\), then \(|x_{\beta}\rangle\) is in class B, corresponding to the trivial phase. Hence even if \(f_{\theta}(x_{\beta})\) is not close to the actual test label \(y_{\beta}\), as long as the sign of the model output equals the sign of the test label, the data point \(x_{\beta}\) is considered correctly classified. Test accuracy is the measure of the proportion of test data points that are placed into the correct class.

This is demonstrated in Fig. 4(b), where we trained a model on 4 training points (shown as dots) and tested it on 100 test data points, from which we plotted the curves \(f_{\theta}(x)\). Curve 1 depicts the QCNN output at initialization, i.e. with random untrained parameters. Even at this initial stage, we can observe a small jump around \(x=0.5\), hinting at some change of behaviour at the critical point. Hence even with non-optimized QCNN parameters, the GS feature map contains sufficient information to indicate certain critical behavior. Curves 2 and 3 in Fig. 4(b) are plotted for the QCNN model trained for 25 and 50 epochs, respectively. We can see that these decision boundaries do not match what we require (the fixed QCNN boundary seen in Fig. 3c), but the shape of the curves and the behaviour at criticality is becoming more accurate with increased training. So much so, that the test accuracy for curve 3 in Fig. 4(b) is almost at 100%; the values of \(f_{\theta}(x_{\beta})\) are incorrect, but most of the test points still fall on the correct side of 0, which is sufficient for the binary classification task. Next, curve 4 (Fig. 4b) is plotted for the trained QCNN model after 100 epochs. At this stage 100% accuracy has been achieved, but the boundary still does not coincide with the fixed QCNN boundary. Finally, after 200 training epochs we obtain curve 5. With enough training we do recover the correct, sharp decision boundary. Therefore, the GS feature map with a suitably chosen variational QCNN performs very well for state classification, generalizing to unseen data even with very few training data points.

### QCNN trained on rotation-based embedding

We have seen that we can train a QCNN model to perform effectively the classification of ground states for the chosen Hamiltonians. But what happens if we go from the GS feature map to a more generic embedding protocol? We demonstrate this by using rotation-based embedding which leads to the conventional Fourier-type quantum model. We apply Pauli rotation gates acting on the zero state as the new feature map (Fig. 5a). The resulting input state reads \(|\psi(x)\rangle=\prod_{i=1}^{N}\hat{R}_{\text{Y}}^{i}(\eta x)|\delta\rangle\), where \(\eta\) is a fixed parameter. Changing \(\eta\) changes the frequency range that the model has access to, and this manifests itself in the basis sets depicted in Fig. 5(b). As we did for the GS feature map to produce Fig. 3(b), we

Figure 5: **(a)** Here, we substitute the ground state embedding by the rotation-based embedding with Fourier basis. \(\eta\) represents a parameter that defines the frequency range. **(b)** Basis sets shown for the Fourier feature map with \(\eta=2\) (top panel) and \(\eta=8\) (bottom panel), visualized as squared projections on the computational basis, \(|\psi(x)\rangle^{2}\). The state is taken after the embedding is performed, just before the variational QCNN circuit. **(c)** Decision boundary coming from QCNN with the Fourier feature map based on \(\hat{R}_{\text{Y}}(\eta x)\) rotations, shown for \(\eta=2,4,6,8\). The corresponding test accuracy for each embedding is shown on the right, ranging from 65% (\(\eta=8\)) to 100% (\(\eta=2\) and 4).
prepare \(|\psi(x)\rangle\) before projecting onto the computational basis states to measure the \(x\)-dependent diagonal components of the input density operator, \(|\phi_{j}(x)|^{2}\). In contrast to the GS basis, we do not observe any rapid change in behaviour at the critical point; rather, this Fourier embedding induces a sinusoidal behaviour in each of the basis functions. There is a significant difference observed as you increase \(\eta\). At \(\eta=2\) there are fewer "dominant" functions (top panel in Fig. 5b), meaning that low frequency models can be constructed. However, at \(\eta=8\) the basis looks more oscillatoric, with many peaks appearing due to the high frequency of the feature map (bottom panel in Fig. 5b).

These feature-map-induced basis changes have a clear impact on the QCNN classification, as Fig. 5(c) shows. We train the QCNN circuit as we did previously, with the same training and test data set, loss and optimizer choices. We can see that for a low-frequency Fourier map (\(\eta=2,4\)), the QCNN is roughly able to find the fixed QCNN boundary. The transition is less sharp at the critical point, and \(f_{\theta}(x)\) does not quite reach -1/+1 for \(x\) close to 0/1, but the decision boundary gives a clear separation between the two phases, and hence ensures 100% accuracy on the classification task. However, as \(\eta\) increases further, the impact of the high-frequency basis set becomes clearer, as it becomes harder to pick the basis functions for fitting the correct boundary. This culminates in the result for \(\eta=8\); the many "dominant" sinusoidal peaks in the basis cause the QCNN boundary to also resemble a sinusoidal curve. Naturally, this has an impact on test accuracy. In this case many test points are situated in the upper left and bottom right quadrants of the plot, indicating incorrect classification.

What does the study of QCNN models with Fourier embedding tell us? One take-home message is the importance of setting the frequencies. We can also see it as the necessity of feature pre-processing, or in the context of quantum kernels adjusting the kernel bandwidth [92]. In cases which allow feature engineering, QCNNs with rotation-based embeddings may still form relatively high-performing models. However, for tasks that do not have this option the generalization can be poor.

We also stress that our analysis considers the 'test accuracy' as a success measure for classification typically adopted in quantum machine learning [51]. However, there are various measures beyond the test accuracy that can provide a stronger separation between models based on different embeddings. For instance, this includes precision recall scores, confusion matrix, receiver operating characteristic curves, and many others. In this sense, our result show that even for largely forgiving metrics the separation is significant, and is only expected to grow for other parameters and training regimes.

### Generalization

Next, we study the generalization property for classification for different embeddings. Specifically, we show that QCNNs with the ground state embedding can generalize well (have small generalization error [69]) as compared to the rotation-based embedding.

The results so far assumed access to an infinite number of shots when measuring expectation values, enabling us to evaluate \(f_{\theta}(x)\) exactly. The separation in the performance between the GS and Fourier embeddings is even more apparent when we move to the finite shot regime. The error \(\epsilon\) in the estimation of \(\langle\hat{O}\rangle\) is given by \(\epsilon=\sqrt{\text{var}(\hat{O})/N_{s}}\), where \(\text{var}(\hat{O})=\langle\hat{O}^{2}\rangle-\langle\hat{O}\rangle^{2}\) and \(N_{s}\) is the number of shots. Fig. 6(a) depicts the decision boundaries for the GS feature map and the Fourier feature map (\(\eta=2\)), with the blue and red curves representing \(f_{\theta}(x)\) in the infinite shot limit (ground state and Fourier embeddings, respectively). The shaded blue and red area shows the region [\(f_{\theta}(x)\)-var(\(f_{\theta}(x)\)), \(f_{\theta}(x)\)+var(\(f_{\theta}(x)\))] for both types of embedding.

We can see that for both embeddings, the variance away from the critical point is relatively low compared to the variance around the critical point. In these low-variance regions, an accurate measurement of \(\langle\hat{O}\rangle\) can be found even with very few shots. Towards the critical point the variance becomes increasingly large, and many more measurement shots are required. We note that the shaded regions for the QCNN with Fourier embedding are much larger than those of the QCNN with GS embedding. The Fourier model has a region of error that spans both sides of the \(f_{\theta}(x)=0\) threshold for a much wider range of \(x\).

This manifests itself in the results seen in Fig. 6(b). For this, we consider a minimal scenario for showing the separation between the two QCNN model types. Specifically, we train a model assuming access to an infinite number of shots, but when calculating the test accuracy we measure \(f_{\theta}(x)\) by averaging over a fixed number of measurements. We repeat this procedure 10 times for both the GS and Fourier embeddings, and we plot the average test accuracy across the 10 trials as a function of number of shots. We see that test accuracies still remain high for both feature maps, but a real separation is observed for low numbers of measurement shots. Even for points away from the critical point, the high variance of the Fourier QCNN model means that 10 shots is not enough to evaluate \(f_{\theta}(x)\) with any real degree of accuracy, making the model susceptible to incorrect classifications. Finally, 10,000 shots are required to return to the average test accuracy across the 10 trials in the infinite shot regime (99.6%). Meanwhile,

Figure 6: **(a)** Decision boundaries for the two types of embeddings (ground state and Fourier rotation-based), for the finite number of shots. Shaded area shows the corresponding variance, where large variance leads to less accurate results. **(b)** Generalization measure as a function of the number of measurement shots.
the GS QCNN model only struggles with points very close to the critical point in the low shot regime. In fact, 100 shots is already enough to return to the 100% test accuracy found across all 10 trials with an infinite number of shots.

These results further demonstrate the benefit of the GS feature map. The sharp transition at criticality ensures that errors arising from access to a finite number of shots have a minimal impact on classification. We expect the separation in generalization between the two feature maps to be even more apparent if we also train the circuit with a finite number of shots for each expectation value estimation. This is likely to transform the smooth decision boundary into a noisy transition line, and the lower sharpness of the Fourier QCNN would be further exposed in this setting. Even more importantly, considering cases where data is limited (e.g. when only few runs of quantum hardware can be analyzed due to time constraints), the generalization on few training examples and read out with few samples can largely yield the classification for actual devices.

### Solving regression tasks with QCNNs

Given what we have learnt from classification with quantum convolutional neural networks, we suggest to investigate the performance of QCNNs for specific regression tasks. In particular, we test it for problems containing sharp transitions, using QCNN using both ground state feature map and Fourier feature map.

To solve a regression problem we consider a target function \(f(x)\) that describes a relationship we want to find in a dataset. A trial function or "surrogate model" \(f_{\theta}(x)\) can express a family of functions dependent on what the variational parameters \(\theta\) are. The model can be trained by minimizing the MSE loss function

\[\mathcal{L}(\theta)=\frac{1}{M}\sum_{\alpha=1}^{M}\left\{f_{\theta}(x_{\alpha })-f(x_{\alpha})\right\}^{2}, \tag{14}\]

where \(\{x_{\alpha}\}_{\alpha=1}^{M}\) is the set of training points and \(M\) is the cardinality of this set. Similarly to the previous section we build the quantum model \(f_{\theta}(x)\) based on QCNN expectation value, and additionally include classical variational parameters to rescale and shift the expectation.

First, we consider an example coming from fluid dynamics. As a target function for training we choose a solution of Burgers equation, assuming the regime that features a critical behavior. The corresponding partial differential equation reads [93]

\[\frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}=\nu\frac{ \partial^{2}u}{\partial x^{2}}, \tag{15}\]

with the boundary conditions

\[u(0,x) =-2\frac{\nu}{\phi(0,x)}\frac{d\phi}{dx}+4,\quad x\in[0,2\pi], \tag{16}\] \[u(t,0) =u(t,2\pi),\quad t\in[0,T],\] (17) \[\phi(t,x) =\exp\left\{-\frac{(x-4t)^{2}}{4\nu(t+1)}\right\}+\exp\left\{- \frac{(x-4t-2\pi)^{2}}{4\nu(t+1)}\right\}, \tag{18}\]

the solution can be found as \(u(t,x)=-2[\nu/\phi(t,x)]d\phi/dx+4\). We rescale this solution and consider the initial time \(t=0\), setting the target function as \(f(x)=[u(0,\pi+1/2-x)-4]/3\) with \(\nu=0.05\). We remind that our goal is to learn the known solution of the differential equation, thus performing regression by QNN training, also known as quantum circuit learning [36]. Additionally, we note that one can potentially adopt the workflow to match a physics-informed approach with feature map differentiation [37], and we leave the question of differentiating hidden feature maps for future works.

We perform regression selecting \(M=21\) equally-spaced training points over \([0,1]\), for both the ground state embedding based on cluster Hamiltonian (same as in the previous section) and the Fourier feature map based on rotations \(\hat{R}^{\prime}_{Y}(2\pi x)\) for each qubit \(i\). Training is performed via Adam optimizer. The results are as shown in Fig. 7(a). We observe that the original QCNN with GS embeddings is able to represent the transition with high degree of generalization, and the Fourier model experiences oscillations while roughly representing the trend. We assign an accuracy metric for each model, corresponding to the percentage of test points for which the square error difference between the trained function and target function is with an error bound \(\epsilon\). The test points are chosen as 100 uniformly spaced points and error bound as \(\epsilon=0.05\). The accuracy of the QCNN model with cluster Hamiltonian embedding is then equal to 91%, mostly due to slightly different scaling of tails, and the Fourier-based QCNN has only 62% test accuracy due to poor generalization. We conclude that ground state based embedding with the known region of criticality and critical exponents can be translated to problem in other domains of physics, offering distinct model-building capabilities with good generalization.

The second example that we consider corresponds to a transfer function of a single degree of freedom oscillator with damping [94]. Specifically, the transfer function reads

\[H(x)=\frac{1}{\sqrt{\left(1-x^{2}\right)^{2}+\left(2\zeta x\right)^{2}}}, \tag{19}\]

Figure 7: **(a)** Viscous flow solution of the Burgers equation learnt by the quantum convolutional neural network with the ground state embedding and rotation-based Fourier embedding. Test accuracy, calculated as percentage of points within square error less than 0.05, is estimated to be 91% for the GS model and 62% for the Fourier model. **(b)** Transfer function of a single degree of freedom oscillator learnt by QCNNs with the two feature maps, together with corresponding accuracies.
where \(x\) denotes the frequency of the oscillator normalized by its natural frequency, and \(\zeta\) is the damping ratio. We rescale the transfer function as \(f(x)=H(1.6[x+0.1])\) to match the range of QCNN-based models, and set \(\zeta=0.05\) such that the transition behaviour occurs centred around 0.5. Regression is performed the same way as the viscous Burgers case, as well as the test accuracy estimation. The results are as shown in Fig. 7(b). We observe that both the ground state feature map and Fourier feature map are able to approximately fit the shape, with the GS embedding outperforming Fourier due to better generalization at the end point regions.

Overall, from the use of QCNNs for regression we can see that it is important for the basis functions from the choice of encoding to match the problem. This is particularly important for embedding choices based on ground states, where all the basis functions have a strong particular behaviour at the critical point. Additionally, one can make the GS feature map become variational as well, such that the critical region and sharpness are altered as needed. Once a suitable embedding choice is set, the QCNN can be used to represent the target function efficiently and learnt with proven trainability [78] -- an important advantage over fully-connected quantum neural networks.

Finally, we highlight that there are many physical problems based on quantum measurements that go beyond classification and assume inference of some system properties, thus favoring regression. For instance, this can be estimation of magnetization and specific heat for magnetic materials, charge order in superconductors etc. In this case we suggest that QCNNs can play an important role due to their naturally-emerging basis set with implicit bias and high generalization.

## V Discussion

There are several crucial aspects to be recalled and discussed. First, we stress that QCNNs are indeed very successful in solving problems for cases where input states are generated with the basis set that suits classification. Here, we can say that the advantage in both machine learning and quantum machine learning is underpinned by data -- while functions that represent decision boundaries are not necessarily difficult to fit, the generalization comes from embeddings that are natural to considered problems (e.g. classification of physical system behaviour). Thus, we suggest that similar advantage in terms of generalization can be attained when solving regression tasks for physics-informed problems.

We made the observation that QCNNs working with quantum data are typically built on feature maps with an implicit bias [95] that favors the problem. Given that QCNN circuits have a number of independent adjustable parameters at the post-processing stage, which is not prohibitively large, they are practically trainable and in conjunction with geometric QML [71, 72, 96] approaches they can provide superior performance in terms of both classification, anomaly detection [97], and regression.

Second aspect concerns addressing problems with multiple features. This assumes embedding multivariate functions as decision boundaries. To date, mostly few-variable cases were considered for physical systems with the ground state embedding [69], while rotation-based feature maps were routinely used for datasets with a large number of features [51]. Once we want to use ground state embeddings for multiple features, we face a task of assigning each feature \(x_{\ell}\) to some Hamiltonian parameter. One option is to use different type of Hamiltonian terms (interaction range, coupling etc) to encode features \(x_{\ell}\), but this implies that critical behavior for different features is distinct. Another option is composing Hamiltonians with inhomogeneous couplings, for instance with 1D cluster models (each described by \(x_{\ell}\)) collated into a ladder. How can we use QCNNs to process data with many features? This question has to be answered for extending the use of QCNN beyond few physical examples.

Third aspect concerns the type of measurement adaptation circuit. If we consider pooling being a way to adopt the measurement basis from few-body to effectively \(N\)-body operators, can we do it with only a limited gate set? And if we follow this route, is it sufficient to use matchgate circuits, which offer both control and classical simulability [98]? Or can we do the adaptation with Clifford-only circuits [99]? If this is the case, the advantage of QCNN has to come directly from data, assuming that embedding of features corresponds to non-trivial quantum processes that cannot be probed otherwise. For such processes one can consider a highly beneficial scenario where pre-training of QCNNs is performed _in silico_ classically for limited number of states. Then, we can run QCNNs as measurement adaptation circuits for physical devices with imperfections, performing classification with small number of samples and enjoying the corresponding advantage.

Another important question regarding the power of QCNNs and possible embeddings arises when we consider extensions from simple one-dimensional models and go into two dimensions. Namely, every feature can be in principle embedded into ground states of 2D spin models with distinct topological properties. In this case, the entanglement structure, correlations, and nature of phase transition change. And so does a critical exponent of the transition [87]. For instance, considering the toric code model or models with fractional statistics, one can enrich the basis for describing critical phenomena [100]. Can we match them with corresponding behaviour in hydrodynamical systems, thus ensuring quantum "simulation" of phase transitions in fluid dynamics? Can we extend it to chaotic systems? The development of QCNN understanding to embeddings with long-range topological order may well offer capabilities in classification and regression beyond currently explored states with limited entanglement.

Finally, QCNNs have been shown to have a strong connection to error correction, where pooling layers can be used to perform syndrome extraction and denoising [75]. At the same time, we suggested to look at the process via explicit modelling paradigm. Can we extend it to some of the known error correction protocols, explaining them as "sharpening" of models and feature engineering? These are the questions that can be addressed adopting the proposed strategy.
Conclusion

In this work we have developed a better understanding of quantum convolutional neural networks, specifically highlighting why they are so successful in quantum phase recognition. We have shown that supplied quantum states (features) can be understood in terms of _hidden_ feature maps -- quantum processes that prepare states depending on classical parameters \(\mathbf{x}\). During the mapping process, we observed that the ground state preparation supplies a very beneficial basis set, which allows the building of a nonlinear quantum model for classification with decision boundaries that are sharp and generalize from only few data points and measurement samples. We show that single-qubit observables in QCNNs can be used to "pick up" the most beneficial basis functions, while leading to sampling advantage. The developed understanding also opens another perspective on quantum sensing aided by convolution-based quantum processing. Finally, motivated by classification, we applied the QCNN-based workflow with cluster model ground state embedding to solve problems in fluid dynamics (viscous Burgers equation) and wave physics (damped oscillator). This suggests quantum convolutional neural networks as a provably trainable tool for data-driven modelling of critical phenomena with quantum computers.

## Appendix A Ground state preparation

Here, we briefly summarize different strategies to prepare QCNN inputs as ground states or low-temperature ensembles of states. First, we note one can prepare

\[\ket{\psi_{0}(x)}=\mathcal{T}\left\{\exp\big{[}-i\int ds\hat{\mathcal{H}}(s;x) \big{]}\right\} \tag{10}\]

using an appropriate adiabatic preparation path for Hamiltonian \(\hat{\mathcal{H}}(x)\) (here \(\mathcal{T}\) denotes time-ordering) [101]. This however depends on the properties of the Hamiltonian and gap closing.

Second, one can consider the effective thermal state preparation process

\[\hat{\rho}_{\text{fl}}[\hat{\mathcal{H}}(x)]=\lim_{\beta\to\infty}\frac{\exp(- 2\beta\hat{\mathcal{H}}(x)}{\text{tr}\{\exp(-2\beta\hat{\mathcal{H}}(x))\}}, \tag{11}\]

where \(\beta\) is an effective inverse temperature. This can be simulated approximately with quantum imaginary time evolution (QITE) techniques [102].

Third, given that cluster model can be overparametrized in linear (or at most quadratic) depth, we can assign a ground state preparation unitary with pre-optimized angles \(\Phi_{\text{GS}}\) such that there is a unitary \(\hat{\mathcal{U}}_{\Phi_{\text{GS}}}[\hat{\mathcal{H}}(x)]\) that prepares \(\ket{\psi_{0}(x)}\) up to sufficient pre-specified precision. We suggest to use the QAOA-type preparation [89], which corresponds to the Hamiltonian Variational Ansatz (HVA) [88] for the considered cluster Hamiltonian. Let us consider \(J_{\text{xx}}\) for brevity, and use the transverse field cluster model as an example. The feature map for the ground state embedding can be composed as

\[\ket{\psi_{0}(x)}=\prod_{d=1}^{D}\left(e^{-i\Phi_{d_{1}}^{(\text{opt})}(x) \sum_{i}\hat{x}\hat{x}_{i,1}\hat{x}_{i,2}}e^{-i\Phi_{d_{2}}^{(\text{opt})}(x) \sum\hat{x}\hat{x}}\right)\ket{\psi}, \tag{12}\]

assuming that we apply sufficient number of layers \(D\), and optimal angles \(\{\Phi_{d_{1,2}}^{(\text{opt})}(x)\}\) are recovered for all system features \(x\). We note that this is possible for \(D\) that enables overparametrization [103], and was shown to give exact ground state preparation for integrable models [104, 89].

## Appendix B Fixed QCNN analysis

We visualize the steps of fixed QCNN in Fig. 3(a) of the main text as the full circuit for \(N=9\) qubits. Let us go step by step aiming to understand the underlying machine learning operations. Starting with the prepared ground state for the pure cluster model (\(x=0\) point), we observe that pivoting brings the system to \(\ket{+}^{\otimes N}\) and the layers of Hadamard gates make it the computational zero state \(\ket{\psi}\). We call this as UNPREPARE operation layer. Thus at \(x=0\) we satisfied the second QCNN criterion (discussed in Section II.B of the main text), meaning that at the pooling stage (Fig. 3a, stage B) we would get \(0\) bit measurements deterministically on \(2N/3\) qubits, while keeping \(\tilde{N}=N/3\) qubits (we choose the pool of qubits \(2,5,8\)). The criterion \(1\) (i.e. fixed point one) can be satisfied by re-preparing the cluster state now on the three selected qubits by applying Hadamard and \(\hat{U}_{\text{pivot}}^{\dagger}\) layer. We get the smaller version of \(\ket{\psi_{0}}_{N/3}\). Next we need to consider the case of \(x>0\), where the deviation from the zero magnetic field generates "errors" as bitflips. Namely, operations \(\{\hat{X}_{i}\}\) can be applied to on any qubit line on top of ideal symmetry protected topological (SPT) ground state \(\ket{\psi_{0}(0)}\), and propagate through the circuit. That is what we want to correct when performing the pooling procedure, trying to keep the clean copy of SPT phase as far as possible. We observe that \(\hat{U}_{\text{pivot}}\hat{X}_{i}\ket{\psi_{0}}=\hat{Z}_{i-1}\hat{X}_{i}\hat{Z} _{i+1}\hat{U}_{\text{pivot}}\ket{\psi_{0}}\) and \(\hat{\Pi}^{\otimes N}\hat{U}_{\text{pivot}}\hat{X}_{i}\ket{\psi_{0}}=\hat{X}_ {i-1}\hat{Z}_{i}\hat{X}_{i+1}\hat{\Pi}^{\otimes N}\hat{U}_{\text{pivot}}\ket{ \psi_{0}}\), and these are the effective errors that we need to correct. Given that in the absence of errors pivoting and X-to-Z basis map generates \(\ket{\psi}\), we required to correct states of the type \(\ket{0...01010...0}\) (and cyclic shifts), and make sure that after pooling \(\ket{0}^{\otimes N/3}\) state is recovered. To avoid mid-circuit measurements we suggest to use the recipe of deferred measurements and assign controlled operations that are compatible with measuring (and tracing out/discarding) qubits that are not pooled through. This can be achieved by applying Toffoli gates CCX\({}_{i,j,k}:=\mathbb{1}_{i,j,k}-\ket{1}_{i}\bra{1}\ket{1}_{i}\bra{1}\ket{1}_{i} \bra{1}\ket{1}_{i}\bra{1}\hat{X}_{k}\), where \(i\) and \(j\) are control qubit indices, and \(k\) represents a target. We also define the bit flipped version of this gate CCX\({}_{i,j,k}^{(01)}:=\hat{X}_{i}\text{CCX}_{i,j,k}\hat{X}_{i}\), with the \(i\)-th control now corresponding to \(0\) state. This gate is denoted by open circle when conditioned on \(0\) and not \(1\). Our idea is detecting the patterns of bits in next-nearest neighbors, such the when distance-one flipped pair is detected, several layers of Toffolis correct the qubits \(2\), \(5\), and \(8\) (chosen as targets; see Fig. 3a, CORRECT layers). One can the check that
errors propagating to measurement do not impact the observable, in the lowest order.
