Table of Contents
Fetching ...

Compiling Quantum Regular Language States

Armando Bellante, Reinis Irmejs, Marta Florido-Llinàs, María Cea Fernández, Marianna Crupi, Matthew Kiser, J. Ignacio Cirac

TL;DR

The paper addresses the challenge of efficiently compiling quantum circuits to prepare structured target states by introducing Regular Language States (RLS) as a middle ground between general-purpose amplitude-vector methods and bespoke state families. It presents an end-to-end compiler that takes a regular description (regex, DFA, or finite set) with an optional complement, canonicalizes to a minimal DFA, maps to a matrix product state (MPS) IR, and then to hardware-aware circuits via two backends: SeqRLSP (linear-depth, ancilla-free for LNN) and TreeRLSP (logarithmic-depth on all-to-all). Theoretical contributions include explicit compile-time and resource bounds that scale with system size $N$ and the maximal Schmidt rank $\chi$, plus a minute increase of $1$ in the complement’s Schmidt rank per cut. Numerical experiments benchmark against general sparse-state and specialized methods on Dicke, W, complement, and random uniform superpositions, demonstrating competitive performance and the novel capability to efficiently synthesize complements. The approach is modular and extensible, bridging automata theory, tensor networks, and quantum circuit synthesis, with potential extensions to nonuniform amplitudes and more direct MPS-to-circuit mappings.

Abstract

State preparation compilers for quantum computers typically sit at two extremes: general-purpose routines that treat the target as an opaque amplitude vector, and bespoke constructions for a handful of well-known state families. We ask whether a compiler can instead accept simple, structure-aware specifications while providing predictable resource guarantees. We answer this by designing and implementing a quantum state-preparation compiler for regular language states (RLS): uniform superpositions over bitstrings accepted by a regular description, and their complements. Users describe the target state via (i) a finite set of bitstrings, (ii) a regular expression, or (iii) a deterministic finite automaton (DFA), optionally with a complement flag. By translating the input to a DFA, minimizing it, and mapping it to an optimal matrix product state (MPS), the compiler obtains an intermediate representation (IR) that exposes and compresses hidden structure. The efficient DFA representation and minimization offloads expensive linear algebra computation in exchange of simpler automata manipulations. The combination of the regular-language frontend and this IR gives concise specifications not only for RLS but also for their complements that might otherwise require exponentially large state descriptions. This enables state preparation of an RLS or its complement with the same asymptotic resources and compile time. We outline two hardware-aware backends: SeqRLSP, which yields linear-depth, ancilla-free circuits for linear nearest-neighbor architectures via sequential generation, and TreeRLSP, which achieves logarithmic depth on all-to-all connectivity via a tree tensor network. We prove depth and gate-count bounds scaling with the system size and the state's maximal Schmidt rank, and we give explicit compile-time bounds that expose the benefit of our approach. We implement and evaluate the pipeline.

Compiling Quantum Regular Language States

TL;DR

The paper addresses the challenge of efficiently compiling quantum circuits to prepare structured target states by introducing Regular Language States (RLS) as a middle ground between general-purpose amplitude-vector methods and bespoke state families. It presents an end-to-end compiler that takes a regular description (regex, DFA, or finite set) with an optional complement, canonicalizes to a minimal DFA, maps to a matrix product state (MPS) IR, and then to hardware-aware circuits via two backends: SeqRLSP (linear-depth, ancilla-free for LNN) and TreeRLSP (logarithmic-depth on all-to-all). Theoretical contributions include explicit compile-time and resource bounds that scale with system size and the maximal Schmidt rank , plus a minute increase of in the complement’s Schmidt rank per cut. Numerical experiments benchmark against general sparse-state and specialized methods on Dicke, W, complement, and random uniform superpositions, demonstrating competitive performance and the novel capability to efficiently synthesize complements. The approach is modular and extensible, bridging automata theory, tensor networks, and quantum circuit synthesis, with potential extensions to nonuniform amplitudes and more direct MPS-to-circuit mappings.

Abstract

State preparation compilers for quantum computers typically sit at two extremes: general-purpose routines that treat the target as an opaque amplitude vector, and bespoke constructions for a handful of well-known state families. We ask whether a compiler can instead accept simple, structure-aware specifications while providing predictable resource guarantees. We answer this by designing and implementing a quantum state-preparation compiler for regular language states (RLS): uniform superpositions over bitstrings accepted by a regular description, and their complements. Users describe the target state via (i) a finite set of bitstrings, (ii) a regular expression, or (iii) a deterministic finite automaton (DFA), optionally with a complement flag. By translating the input to a DFA, minimizing it, and mapping it to an optimal matrix product state (MPS), the compiler obtains an intermediate representation (IR) that exposes and compresses hidden structure. The efficient DFA representation and minimization offloads expensive linear algebra computation in exchange of simpler automata manipulations. The combination of the regular-language frontend and this IR gives concise specifications not only for RLS but also for their complements that might otherwise require exponentially large state descriptions. This enables state preparation of an RLS or its complement with the same asymptotic resources and compile time. We outline two hardware-aware backends: SeqRLSP, which yields linear-depth, ancilla-free circuits for linear nearest-neighbor architectures via sequential generation, and TreeRLSP, which achieves logarithmic depth on all-to-all connectivity via a tree tensor network. We prove depth and gate-count bounds scaling with the system size and the state's maximal Schmidt rank, and we give explicit compile-time bounds that expose the benefit of our approach. We implement and evaluate the pipeline.
Paper Structure (44 sections, 7 theorems, 9 equations, 9 figures, 1 table)

This paper contains 44 sections, 7 theorems, 9 equations, 9 figures, 1 table.

Key Result

Lemma 1

Given a DFA $\mathcal{F} = \langle Q, \Sigma, \delta, I, F \rangle$ accepting the RL $L$, an MPS description of the family of quantum RLSs $\{ | L_N \rangle \}_{N \in \mathbb{N}}$ associated to it can be obtained so that $| L_N \rangle := \begin{tikzpicture}[scale=.45, baseline={([yshift=-1ex]curren This MPS has bond dimension $D = |Q|$.

Figures (9)

  • Figure 1: (a) A schematic illustration of the general setting. It starts with a user, possibly without prior knowledge of the state’s name or structure, providing a description of the desired state—such as a set of strings, a regex, or a DFA, and (optionally) a complement flag—to the classical compiler. The compiler then generates a quantum circuit using a gate set compatible with the target hardware, which executes the resulting instructions. (b) Summary of our compilation pipeline using DFAs and MPSs. The user input (regex, DFA or set of strings) is converted into a DFA, which is then minimized and translated into an MPS. The MPS is decomposed into unitaries and compiled into a gate instruction set to be executed on the quantum computer.
  • Figure 2: Illustration of the left-to-right sequential SVD procedure. A right-to-left SVD sweep is performed analogously, by mirroring the procedure from the opposite boundary. Each resulting tensor $A_{[n]}^L$ is an isometry of size $\chi_{n-1} \times \chi_n$, with $\chi_n \leq \min \{\chi, 2^n, 2^{N-n}\}$, for $n \in \{1, N-1\}$. It holds that $D_0 = D_N = 1$.
  • Figure 3: Illustration of the tree-based SVD pass at the $\ell$-th layer. The uppermost vertical bonds in the tree carry the physical dimension ($2$ for qubits), the horizontal bonds are bounded by $\chi$, and all remaining vertical bonds by $\chi^2$. When the number of tensors in a layer is odd, the unpaired one is propagated to the next layer.
  • Figure 4: Visual mapping between the TN and quantum circuit operations. (a) Mapping for SeqRLSP. (b) Mapping for TreeRLSP.
  • Figure 5: Preparation cost of Dicke$-3$ state for various system sizes $N$. We compare SeqRLSP, TreeRLSP, Qiskit, Qualtran, gleinig2021efficient, and bartschi2019deterministic. (a) Quantum circuit depth. (b) Total gate count. The inset show the number of ancillae used by Qualtran. (c) Compilation time in seconds.
  • ...and 4 more figures

Theorems & Definitions (20)

  • Definition 1: Regular language states
  • Definition 2: Deterministic finite automaton
  • Definition 3: Directed acyclic DFA
  • Definition 4: OBC Matrix product states
  • Definition 5: Schmidt rank
  • Definition 6: $D_{\mathrm{init}}$ and $D_{\mathrm{minDFA}}$
  • Definition 7: Complement RLS
  • Lemma 1: DFA to uniform-bulk MPS florido2024regular
  • Lemma 2: DAG-DFA to non-uniform MPS
  • proof
  • ...and 10 more