Manuscript Offprint

arXiv:2610.11537

An Efficient Quantum Circuit for Flow Model Execution Using Quantum Neural Networks

Rui Che, Ludvig af Klinteberg

Abstract

Flow models generate trajectories from an initial distribution to a target distribution by solving an ordinary differential equation defined by a velocity field. Flow matching learns this velocity field by modeling the transport dynamics between the two distributions. Wavefunction flow establishes a formal connection between flow models and quantum dynamics by introducing a continuity Hamiltonian, which drives the Schrödinger evolution of quantum states. In this paper, we investigate accurate and efficient quantum simulation of the wavefunction flow, thereby realizing the efficient implementation of flow models on quantum computers. We first leverage a quantum read-only memory (QROM)-based phase kickback framework for the wavefunction flow simulation, generating probability densities that closely match those produced by the corresponding conventional flow model. To address the high circuit-resource cost, we further incorporate a trained quantum neural network (QNN) into the phase kickback framework, replacing QROM for data encoding. Numerical experiments demonstrate that our proposed method implements flow models on quantum computers more efficiently, since it maintains the accuracy of wavefunction flow simulation compared with the QROM-based framework, and significantly reduces the circuit resources.

Keywords: Flow models, Wavefunction flow, Quantum read-only memory, Quantum neural networks

1 Introduction

Generative models (Bond-Taylor et al. 2021) are a class of machine learning algorithms that learn unknown data distributions and generate new samples accordingly. The most widely used generative models include Generative Adversarial Networks (GANs) (Goodfellow et al. 2014), Variational Autoencoders (VAEs) (Kingma and Welling 2013), Autoregressive models (Van Den Oord et al. 2016), and flow models (Gat et al. 2024; Lipman et al. 2022). Flow models aim at generating complex target distributions from simple source distributions by learning velocity fields. The learned velocity fields govern the transportation of distributions. Flow matching (Lipman et al. 2022) provides an efficient method of learning velocity fields by approximating trajectories between source and target distributions that have been predefined, which is an ordinary differential equation (ODE)-based model.

Recently, the connection between flow models and quantum dynamics has been developed (Layden et al. 2025). By introducing a continuity Hamiltonian H^\hat{H}, the implementation of flow models on quantum computers can be regarded as the Schrödinger evolution under this continuity Hamiltonian. The resulting quantum dynamics is defined as wavefunction flow. Wavefunction flow can be realized through the simulation of the Hamiltonian evolution operator e−itH^e^{-it\hat{H}}. By discretizing the evolution time and using the Suzuki-Trotter formula, it can be expressed as a product of exponentiation operators e−iΔtH^je^{-i\Delta t\hat{H}_j} corresponding to all Hamiltonian terms H^j\hat{H}_j (Chen et al. 2022; Low et al. 2023). Here, Δt\Delta t denotes the discretized time step interval. Each operator can be regarded as a quantum oracle and is implemented sequentially in the quantum circuit (Kornell and Selinger 2023).

Phase kickback (Cleve et al. 1998) is a classical quantum technique for the implementation of the evolution operator e−iΔtHje^{-i\Delta tH_j}. It encodes the eigenvalues of H^j\hat{H}_j into ancilla qubits, then leverages rotation gates to generate the desired phase e−iΔtH^je^{-i\Delta t\hat{H}_j}. Finally, the adjoint eigenvalue encoding oracle is employed to uncompute the ancilla qubits to the initial states. In the wavefunction flow framework, the continuity Hamiltonian H^j\hat{H}_j is constructed by the time-dependent potential term VtV_t and the kinetic term KK. These two terms can be transformed into diagonal operators DVtD_{V_t} and DKD_K by selecting the appropriate basis (Layden et al. 2025). To implement such evolution operators e−iΔtDVte^{-i\Delta tD_{V_t}} and e−iΔtDKe^{-i\Delta tD_K} using phase kickback frameworks, one of the key steps is to encode all diagonal entries of DVtD_{V_t} and DKD_K into the quantum register.

Quantum read-only memory (QROM) (Babbush et al. 2018; Lee et al. 2021) is a widely used quantum technique for encoding classical data in the quantum circuit, where each data item corresponds to an initial basis state. We utilize QROM-based phase kickback frameworks to implement the evolution operators e−iΔtDVte^{-i\Delta t D_{V_t}} and e−iΔtDKe^{-i\Delta t D_K} for the wavefunction flow simulation, and verify the correspondence between the flow model and the wavefunction flow simulation. However, the QROM circuit is constructed by a series of multi-controlled X gates (Zindorf and Bose 2025), and the decomposition of a multi-controlled X with n control qubits without ancilla qubits requires Θ(2n)\Theta(2^n) CNOT gates (Barenco et al. 1995). Here, Θ\Theta denotes “of order exactly 2n2^{n} (Knuth 1976). Hence, QROM faces exponentially increasing computational complexity, which leads to a high circuit resource cost for the wavefunction flow simulation.

To solve this problem, we introduce a specialized quantum neural network (QNN) circuit to replace QROM in the phase kickback framework for the wavefunction flow simulation. The QNN is a type of parameterized quantum circuit (PQC)-based variational quantum algorithm (Abbas et al. 2021; Schuld et al. 2014). It combines features of neural networks and quantum circuits. The main areas of QNN application include classification problems (Mahmud et al. 2024), generative learning (Tian et al. 2023), optimization (Amosy et al. 2024), chemistry (Smaldone et al. 2025), and financial predictions (Paquet and Soleymani 2022). Through appropriate and sufficient training, our QNN-based phase kickback framework can maintain accuracy compared to that of the QROM-based framework. In addition, with this replacement, the number of required CNOT gates can be reduced to Θ(n)\Theta(n). QNN has been applied to Hamiltonian simulation using the variational quantum simulator (VQS) (Li and Benjamin 2017; Heya et al. 2023). The VQS trains the QNN to learn the target quantum state from the given initial quantum state. However, each such QNN is designed for a single initial quantum state, and can generate only the corresponding target quantum state. For a diagonal Hamiltonian operator in the wavefunction flow model, where each diagonal entry corresponds to a different initial state, VQS is unable to generate all the desired target states by training the QNN. Therefore, this approach is not capable of realizing the evolution generated by the entire Hamiltonian. In contrast, our QNN-based framework achieves the whole evolution efficiently.

In this paper, inspired by the theory of wavefunction flow (Layden et al. 2025), we investigate an efficient simulation framework for wavefunction flow, thereby realizing the implementation of flow models on quantum computers efficiently. Building on the QROM-based phase kickback framework, we develop a QNN circuit to replace the QROM for data encoding in the wavefunction flow simulation. The new approach significantly reduces the cost of circuit resources while maintaining accuracy compared with the QROM-based framework. The contributions of the paper are as follows.

• We leverage a QROM-based phase kickback technique to simulate wavefunction flow, thereby verifying the wavefunction flow theory and demonstrating the feasibility of implementing flow models on quantum computers.

  • We propose a QNN circuit to replace QROM in the phase kickback framework for data encoding in the wavefunction flow simulation. Instead of employing multi-controlled X gates to encode the exact binary bits in the ancilla qubits through QROM, our QNN circuit learns the mapping from the states of the address qubits to the corresponding probabilities of the ancilla qubits through training parameterized rotation gates and controlled rotation gates. This method avoids the use of high-level controlled gates and the high circuit resource cost. We also extend the model to encode time-dependent potential operators by utilizing a time oracle inside the QNN circuit. Compared with the QROM-based framework, our proposed QNN-based phase kickback framework maintains accuracy in wavefunction flow simulation while significantly reducing circuit resources, enabling the implementation of flow models on quantum computers more efficiently.

  • We combine flow matching with wavefunction flow simulation. The conventional flow model employs the velocity field learned from flow matching to generate the final distribution. In our work, we learn the potential using flow matching, and its gradient defines the conservative velocity field. Then we incorporate this velocity field into our wavefunction flow simulation. The final distribution generated by the wavefunction flow simulation successfully reconstructs the target distribution and matches the final distribution generated by the conventional flow model. This demonstrates the feasibility of employing wavefunction flow simulation for implementing flow models on quantum computers.

The remainder of this paper is organized as follows. Section 2 provides a review of the flow model and flow matching, wavefunction flow, Hamiltonian simulation, quantum data encoding via QROM, and QNN. Section 3 introduces the efficient wavefunction flow simulation through the QROM-based phase kickback framework and our proposed QNN-based phase kickback framework. Section 4 presents the experimental results and the discussion. Section 5 provides a brief conclusion.

References (49)