4
we choose two-qubit unitary ansatzes Umand Vmfor
the convolution and pooling primitives m= 1,2,...,6,
as shown in Figure 1d. We show example ansatzes in
Appendix A and test them across different instances of
an architecture family. Of all the components in this
pipeline, alternating architecture, that is changing how
each Umand each Vmare spread across the circuit, had
the greatest impact on model performance. In addition
to our theoretical framework, we implement it as an
open-source Python package to enable dynamic QCNN
creation and facilitate search space design for NAS.
It allows users to experimentally determine suitable
architectures for specific modelling setups, such as
finding circuits that perform well under a specific noise
or hardware configuration, which is particularly relevant
in the Noisy Intermediate-Scale Quantum (NISQ) [47]
era. Additionally, as more qubits become available, the
hierarchical nature of our framework provides a natural
way to scale up the same model. In summary, our
contributions are the architectural representation for
QCNNs, a Python package for dynamic QCNN creation,
and experimental results on the potential advantage of
architecture search in a quantum setting.
The remainder of this paper is structured as fol-
lows: we begin with our main results by summarising
the architectural representation for QCNNs and then
show the effect of alternating architecture, justifying its
importance. We then provide an example of architecture
search with our representation by employing an evolu-
tionary algorithm to perform QPR. Following this, we
give details of our framework by providing a mathemat-
ical formalism for the representation and describing its
use. Next, with the formalism at hand, we show how it
facilitates search space design by describing the space we
created for the benchmark experiments. We then discuss
generalisations of the formalism and the applicability of
our representation with search algorithms. After this
we elaborate on our experimental setup in the Methods
Section. Finally, we discuss applications and future
steps.
RESULTS
Architectural Representation
Figure 2 shows our architectural representation for
QCNNs. We define two-qubit unitary ansatzes from a
given set of gates, and capture design motifs Ml
kon dif-
ferent levels lof the hierarchy. On the lowest level l= 1,
we define primitives which act as building blocks for the
architecture. For example, a convolution operation with
stride one is encoded as the directed graph M1
1, and with
stride three as M1
2. The directed graph M1
3is a pooling
operation that measures the bottom half of the circuit,
and M1
4measures from the inside outwards. Combined,
they can form higher-level motifs such as convolution-
pooling units M2
1(e), convolution-convolution units M2
2,
or convolution-pooling-convolution units M2
3. The high-
est level l=Lcontains only one motif ML
1, the complete
QCNN architecture. ML
1is a hierarchy of directed graphs
fully specifying how to spread the unitary ansatzes across
the circuit. This hierarchical representation is based on
the one from Liu et al. [26] for deep neural networks
(DNNs), and allows for the capture of modularised de-
sign patterns and repeated motifs. The two lines of code
(e)and (f)show the power of this representation as it
is all that is required to create the entire QCNN circuit
from Figure 1 (d). The code comes from the Python
package we implemented based on the work of this pa-
per. It facilitates dynamic QCNN creation and search
space design.
Architectural impact
The details regarding specific notation and represen-
tation of the framework is given after this section, first
we justify it with the following experimental results.
In Appendix C we also give background on QCNNs
and quantum machine learning for more context. To
illustrate the impact of architecture on model perfor-
mance, we compare the fixed architecture from the
experiments of Hur et al. [29] to other architectures
in the same family while keeping all other components
the same. The only difference in each comparison
is architecture (how the unitaries are spread across
the circuit). The architecture in [29] is represented
within our framework as: (sc, F ∗, sp) = (1,even,0) 7→
Qfree(8) + (Qconv(1) + Qpool(0, F even)) ×3, see al-
gorithm 1. To evaluate their performance, we use the
country vs rock genre pair, which proved to be one of the
most difficult classification tasks from the 45 possible
combinations. We compare eight unitary ansatzes with
different levels of complexity, as shown in Figure A.1.
Table I shows the results of the comparisons, the
reference architecture is as described above and the
discovered alteration found via random search. We note
the first important result, we improved the performance
of every ansatz, in one case, by 18.05%, through random
search of the architecture space. Ansatz refers to the
two-qubit unitary used for the convolution operation
of a model. For example, the model in figure 1 (d) is
described by (1,right,0) and ansatz A.1a corresponds
to U1, U2and U3being circuit A.1a from Appendix A.
Each value represents the average model accuracy and
standard deviation from 30 separate trained instances
on the same held-out test set.
The second important result is that alternating architec-
ture can improve model performance without increasing
complexity. For instance, the best-performing model for
the reference architecture is with ansatz A.1g, which has
an average accuracy of 73.24%. However, this ansatz
causes the model to have 10 ×3 = 30 parameters.
In contrast, by alternating the architecture with the