Table of Contents
Fetching ...

Automated Quantum Algorithm Design using a Domain-Specific Language

Amy Rouillard, Matt Lourens, Francesco Petruccione

TL;DR

The paper addresses automatic quantum algorithm design by learning general, scalable algorithm structures rather than fixed unitary implementations. It introduces a domain-specific language (DSL) that encodes quantum circuits via modular motifs and uses neural-architecture-search-inspired evolutionary methods to discover algorithms. The authors successfully rediscover QFT, Deutsch–Jozsa, and Grover from small training circuits, demonstrating that the learned structures generalize to larger $n$-qubit problems with modest computational effort. This approach yields interpretable, scalable algorithm designs and points to broader applications in variational ansätze and quantum many-body wavefunctions.

Abstract

We present a computational method to automatically design the n-qubit realisations of quantum algorithms. Our approach leverages a domain-specific language (DSL) that enables the construction of quantum circuits via modular building blocks, making it well-suited for evolutionary search. In this DSL quantum circuits are abstracted beyond the usual gate-sequence description and scale automatically to any problem size. This enables us to learn the algorithm structure rather than a specific unitary implementation. We demonstrate our method by automatically designing three known quantum algorithms-the Quantum Fourier Transform, the Deutsch-Jozsa algorithm, and Grover's search. Remarkably, we were able to learn the general implementation of each algorithm by considering examples of circuits containing at most 5-qubits. Our method proves robust, as it maintains performance across increasingly large search spaces. Convergence to the relevant algorithm is achieved with high probability and with moderate computational resources.

Automated Quantum Algorithm Design using a Domain-Specific Language

TL;DR

The paper addresses automatic quantum algorithm design by learning general, scalable algorithm structures rather than fixed unitary implementations. It introduces a domain-specific language (DSL) that encodes quantum circuits via modular motifs and uses neural-architecture-search-inspired evolutionary methods to discover algorithms. The authors successfully rediscover QFT, Deutsch–Jozsa, and Grover from small training circuits, demonstrating that the learned structures generalize to larger -qubit problems with modest computational effort. This approach yields interpretable, scalable algorithm designs and points to broader applications in variational ansätze and quantum many-body wavefunctions.

Abstract

We present a computational method to automatically design the n-qubit realisations of quantum algorithms. Our approach leverages a domain-specific language (DSL) that enables the construction of quantum circuits via modular building blocks, making it well-suited for evolutionary search. In this DSL quantum circuits are abstracted beyond the usual gate-sequence description and scale automatically to any problem size. This enables us to learn the algorithm structure rather than a specific unitary implementation. We demonstrate our method by automatically designing three known quantum algorithms-the Quantum Fourier Transform, the Deutsch-Jozsa algorithm, and Grover's search. Remarkably, we were able to learn the general implementation of each algorithm by considering examples of circuits containing at most 5-qubits. Our method proves robust, as it maintains performance across increasingly large search spaces. Convergence to the relevant algorithm is achieved with high probability and with moderate computational resources.

Paper Structure

This paper contains 18 sections, 2 equations, 19 figures, 1 table, 1 algorithm.

Figures (19)

  • Figure 1: Two equivalent $n$-qubit representations of three learnt algorithms, namely the rediscovered implementations of the Deutsch-Jozsa algorithm (top), Grover's search (middle) and the quantum Fourier transform (bottom). On the left are DSL descriptions output by our search method, while our experiments found many variations, one example per task is shown. On the right are the corresponding circuit representations that match those typically presented in the literature. The cycle (python|QCycle|) and pivot (python|QPivot|) motifs encode two different gate placement patterns, as can be seen by comparing the left- and right-hand sides. The mask (python|QMask|) motif makes qubits unavailable. The strings python|"1*"| and python|"*1"| are examples of patterns used to control the behaviour of the mask and pivot motifs, and represent the selection of the first and last qubits, respectively. The parameter python|r| controls the number of times the structure is repeated, where the relationship to the circuit size can be inferred from training.
  • Figure 2: Evolution of the fitness scores over $292$ generations of a successful experiment in which Grover's search was rediscovered. The maximum fitness of the population at each generation of the evolutionary search (left) increases over time with periods of plateau. The heat map and contour plot (right) show the fitness of the best performing $200$ candidate algorithms sorted by fitness, decreasing from left to right. Left and right share the same $y$-axis.
  • Figure 3: Directed graph showing the subset of the population that evolved into an implementation of Grover's search. Each node represents a candidate algorithm from the same population shown in Fig. \ref{['fig:eval example']}. The colour of each node corresponds to the fitness, matching the scale in Fig. \ref{['fig:eval example']}. Each mutation type is represented by a different edge. Four specific mutations, each of a different type, are highlighted in blue and elaborated on in Fig. \ref{['fig:mutations']}.
  • Figure 4: Number of evaluations required to successfully design three different quantum algorithms. For each task, four search spaces of increasing size were tested. The median number of evaluations is indicated with a horizontal bar.
  • Figure 5: Examples of mutations, written in the DSL. Mutations (a), (b), (c) and (d) correspond to those highlighted in Fig. \ref{['fig:tree']}.
  • ...and 14 more figures