Source-linked AI summary
An Efficient Quantum Circuit for Flow Model Execution Using Quantum Neural Networks
Rui Che, Ludvig af Klinteberg
TL;DR
Flow-model simulation on quantum computers is challenged by the high circuit-resource cost of QROM-based data encoding. The paper simulates wavefunction flow with phase kickback and replaces QROM with a trained QNN; experiments report preserved accuracy and lower circuit resources, supporting efficient flow-model implementation.
Problem
QROM encoding for wavefunction-flow simulation has high circuit-resource cost because its multicontrolled-X decomposition has exponentially increasing complexity.
Source: §1 · pp. 2–3Method
The paper uses phase kickback to simulate wavefunction flow and trains a QNN to replace QROM for data encoding.
Source: §1 · pp. 2–3Results
The QNN-based phase-kickback framework maintains wavefunction-flow simulation accuracy compared with QROM while significantly reducing circuit resources.
Source: §5 · p. 37Takeaways & Limitations
Wavefunction-flow simulation with flow-matching potential gradients reconstructs the target distribution and matches the conventional flow model's final distribution.
Source: §1 · p. 4Time-dependent potentials require training on all discretized time steps, while multidimensional operators require more than eight QNN layers for high precision, raising circuit resources.
Source: §5 · p. 37
Abstract
from arXiv · showhide
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\"odinger 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.
1 Introduction
The paper uses wavefunction flow to connect flow-model transport with quantum evolution, then develops phase-kickback frameworks to simulate it. A QNN replaces QROM for data encoding, aiming to reduce circuit resources while preserving simulation accuracy.
1 Introduction
- Flow models learn velocity fields to transport simple source distributions toward complex targets; wavefunction flow represents quantum implementation as Schrödinger evolution under a continuity Hamiltonian.The evolution is divided into time steps and Hamiltonian-term operators using the Suzuki-Trotter formula.Source: §1 · p. 2
- QROM encoding uses a basis state for each classical data item, but its multicontrolled-X gates lead to exponentially increasing computational complexity and high circuit-resource cost.Source: §1 · pp. 2–3
- The proposed QNN maintains accuracy versus QROM while reducing required CNOT gates to Θ(n), and can implement the whole evolution rather than only one target state.The cited comparison distinguishes it from variational quantum simulation, where each QNN is designed for a single initial state.Source: §1 · p. 3
- QROM-based phase kickback simulates wavefunction flow, while QNN-based phase kickback learns address-to-ancilla probabilities and uses a time oracle for time-dependent potentials.The QNN replaces multicontrolled-X data encoding; the proposed framework maintains accuracy while reducing circuit resources.Source: §1 · pp. 2–3
- The wavefunction-flow distribution reconstructs the target and matches the final distribution from the conventional flow model using a flow-matching potential gradient.Source: §1 · p. 4
2 Background
The background develops how flow matching models transport, how wavefunction flow connects continuity dynamics to Schrödinger evolution, and which circuit techniques support simulation and data encoding.
2.1 Flow model and flow matching
- Flow matching learns a parameterized velocity field vθ(x, t) to approximate target velocity vp(x, t) along probability paths from p0 to p1; conditional velocity simplifies training.Source: §2.1 · pp. 4–5
2.2 Wavefunction flow
- A continuity Hamiltonian makes density evolution under a velocity field equivalent to Schrödinger evolution of Ψt; for conservative fields v_t=∇V_t, H_t=i[K, V_t].Source: §2.2 · p. 6
2.3 Hamiltonian simulation
- Time-ordered evolution is approximated by dividing T into r steps and applying a Trotter decomposition; Hamiltonians at different times require ordering because they do not commute.Source: §2.3 · p. 7
2.4 Data encoding via QROM
- QROM encodes N=2^n classical data entries as m-bit strings, with address states selecting controlled operators that write corresponding bits into ancilla qubits.Source: §2.4 · p. 8, Figure 1 · p. 9
2.5 Quantum neural networks
- A QNN encodes input data, applies parameterized rotation and CNOT layers, and measures an observable; classical gradient-based methods can optimize its parameters.Source: §2.5 · pp. 9–10
3 Methodology
The methodology develops a QROM-based phase-kickback simulation of wavefunction flow, replaces QROM data encoding with trained QNN circuits, and analyzes the resulting circuit resources. For large n, the QNN circuit requires significantly fewer resources than QROM, while its CNOT count grows linearly with n.
3 Methodology
- The methodology presents a QROM-based phase-kickback framework followed by the proposed QNN-based framework for wavefunction flow simulation.Source: §3 · p. 10
3.1.1 Spatial and temporal discretization
- The simulation discretizes a periodic, toroidal spatial domain and evolution time, approximating each time interval with an 8-step Trotter product formula.Source: §3.1 · p. 10, §3.1.1 · pp. 10, 12
3.1 Phase kickback framework-based simulation
- The QROM baseline implements potential and kinetic evolution operators through phase-kickback oracles, using QROM to encode the diagonal potential entries.Source: §3.1.2 · pp. 13–14
3.2 QNN-based phase kickback framework for wavefunction flow simulation
- The proposed QNN-based phase-kickback framework replaces QROM data encoding, reducing CNOT scaling from Θ(2^n) to Θ(n).It uses controlled rotation gates instead of multi-controlled X gates.Source: §3.2 · p. 15
3.2.1 Time-independent QNN circuit for kinetic evolution operators
- A time-independent QNN learns to map kinetic-operator address states to ancilla-state probabilities, with training formulated as binary classification using binary cross-entropy.Source: §3.2.1 · pp. 15–16
3.2.2 Time-dependent QNN circuit for potential evolution operators
- For the time-dependent potential operator, a QNN incorporates a time-register oracle and learns address-to-ancilla probabilities across discretized time steps.Source: §3.2.2 · pp. 17–18
3.2.3 Resource analysis of QROM and QNN circuits
- For matching address and ancilla qubit counts, the resource analysis finds that QROM’s CNOT-gate requirement grows exponentially with the number of address qubits.The comparison analyzes QROM and QNN circuits with the same register sizes.Source: §3.2.3 · pp. 18–19
- For l layers with m controlled-Rot oracles per layer, the QNN circuit requires 6mnl CNOT gates.Each oracle uses three controlled rotations, each decomposed into two CNOT gates.Source: §3.2.3 · p. 19
- The QNN circuit’s CNOT count grows linearly as n increases.This is the stated scaling when the other circuit parameters are fixed.Source: §3.2.3 · p. 19
- For large n, the proposed QNN circuit requires significantly fewer circuit resources than the QROM circuit.The paper states that this follows from Equations (57) and (58) and is numerically evaluated in Subsection 4.4.2.Source: §3.2.3 · p. 19
4.1 Reference method
The reference method compares wavefunction-flow probability densities with final distributions from the corresponding conventional flow model. The reference distribution is obtained by numerically solving the continuity equation for a conservative velocity field.
- The comparison uses the wavefunction-flow final density pT(x) = |ΨT(x)|^2 and the reference final distribution from the conventional flow model.Source: §4.1 · pp. 19–20
- The conventional reference evolves the initial distribution p0(x) from t = 0 to T by numerically solving the continuity equation.Spatial derivatives are computed with the Fourier spectral method and the equation is solved with RK45.Source: §4.1 · p. 20
- The reference velocity field is conservative and is generated by the potential function vt(x) = ∇Vt(x).Source: §4.1 · p. 20
4.2 Experimental setup
Experiments use one- and two-dimensional wavefunction-flow circuits with uniform or periodic exponential initial distributions. Accuracy is assessed by comparing their final densities with a reference solution using four error metrics.
4.2.1 Simulation environment and settings
- The one-dimensional circuit uses 4 address and 10 ancilla qubits, while each dimension in the two-dimensional circuit uses 3 address qubits and the circuit uses 12 ancilla qubits.These settings represent 16 one-dimensional points and 8 grid points per two-dimensional axis.Source: §4.2.1 · p. 20
- Uniform and periodic exponential distributions are the initial conditions for both wavefunction-flow simulations and reference solutions.The periodic exponential distribution uses K = 1, and both initial densities are normalized.Source: §4.2.1 · pp. 20–21
4.2.2 Evaluation metrics
- Accuracy is measured with RMSE, RME, KL divergence, and Wasserstein-1 distance between the simulated and reference final densities.The reference density is linearly interpolated onto the simulation grid before evaluation.Source: §4.2.2 · p. 21
- Smaller error-metric values indicate greater consistency between the simulated and reference final probability densities.RME measures the maximum density difference normalized by the reference maximum; Wasserstein-1 measures transport cost between normalized densities.Source: §4.2.2 · pp. 21–22
4.3 Training analysis of the QNN circuit
The training analysis evaluates QNN depth and loss choices for approximating potential and kinetic evolution data in the phase-kickback framework. Deeper circuits reduce training loss, while binary cross-entropy better reproduces the exact binary diagonal entries than the alternative losses.
4.3.1 Depth analysis
- The depth experiments train the potential and kinetic QNN circuits separately, using Adam with learning rate 0.3 and the losses defined for their respective operators.Source: §4.3.1 · p. 22
- At depth l = 4, both potential- and kinetic-evolution QNNs reach final training losses of 0.0001, versus 0.1712 and 0.1499 at l = 1, respectively.Increasing depth also speeds convergence and lowers the final loss for both circuits.Source: §4.3.1 · p. 23
4.3.2 Loss function comparison
- All three loss functions converge to approximately zero, but Loss functions 2 and 3 converge faster than Loss function 1 for both QNN circuits.Source: §4.3.2 · pp. 24–25
- Binary cross-entropy (Loss function 1) best approximates the exact 0/1 diagonal-entry bits, with mean distance and standard deviation both 0.0001.Loss functions 2 and 3 converge faster, but their predicted probabilities do not match the binary representation as well.Source: §4.3.2 · pp. 23, 25
4.4 Comparison between QNN and QROM-based phase kickback frameworks for wavefunction flow simulation
The comparison evaluates final densities from QNN- and QROM-based phase-kickback frameworks against conventional-flow references, then compares their circuit resources. QNN-based simulation maintains comparable accuracy while using fewer circuit resources as address-qubit counts increase.
4.4.1 Accuracy comparison
- The evaluation compares final densities under the same initial distribution, using four periodic time-dependent potentials and conventional-flow reference densities.The evolution time is 0.02 s divided into 200 steps.Source: §4.4.1 · p. 26
- Across one- and two-dimensional potentials, RMSE values are on the order of 10^-3 and 10^-4, respectively, RME is at most 0.022, KL divergence is below 2 × 10^-4, and W1 is below 0.02.These metrics indicate small density errors and close agreement with the reference method.Source: §4.4.1 · p. 28
- For all four potentials, final densities from QNN-based phase kickback closely match those from QROM-based phase kickback.The comparisons cover one- and two-dimensional potentials; the figures show the density comparisons for V1 through V4.Source: Figure 14 · p. 27, Figure 15 · p. 27, Figure 16 · p. 28
4.4.2 Circuit resource comparison
- As address-qubit counts increase, the QROM-based framework requires more circuit resources than the QNN-based framework; at n = 5, the respective circuit counts are 39424 and 1680 CNOT gates.The QNN framework’s count is twice that of its single encoding circuit because phase kickback also applies its adjoint.Source: Figure 18 · p. 30, Table 5 · p. 30, §4.4.2 · p. 31
4.5 Error analysis
The analysis examines phase-kickback encoding, spatial discretization, and temporal discretization as sources of wavefunction-flow simulation error. Across these tests, finer encoding and discretization improve accuracy, although temporal error can become dominant.
4.5 Error analysis
- The analysis identifies phase-kickback value approximation, spatial discretization, and temporal discretization as primary sources of quantum simulation error.Potential and kinetic diagonal entries are approximated in the phase-kickback encoding, while spatial and temporal discretizations introduce additional errors.Source: §4.5 · p. 31, §4.5.1 · p. 31, §4.5.2 · p. 32
4.5.1 Phase kickback encoding error
- Increasing ancilla qubits from 6 to 14 lowers final density error from 4.7e-02 to a converged 4.4e-03.More ancilla qubits encode more binary fractional bits, reducing phase-kickback approximation error and improving simulation accuracy.Source: §4.5.1 · p. 32
4.5.2 Spatial discretization error
- For n=2 to 5, RMSE falls from 4.670e-03 to 4.093e-05 as ∆x shrinks from 0.5 to 0.0625, then converges to 1.075e-05 by n=8.The authors attribute the rapid decrease to Fourier spatial discretization and a smooth periodic initial distribution; further spatial refinement does not lower error because temporal error dominates.Source: §4.5.2 · p. 33
4.5.3 Temporal discretization error
- Increasing Nt reduces final-density errors across all tested spatial grids; temporal error converges near 1.0e-03 for n=4 and 1.5e-04 for n=5.At n=6, error continues to decrease linearly through Nt=1000 without convergence; the observed trend differs from expected temporal scaling because other error sources combine.Source: §4.5.3 · p. 34
4.6 Evaluation of wavefunction flow simulation combined with flow matching
The evaluation uses flow matching to learn a potential whose gradient transports particles from a uniform initial distribution toward four Gaussian target modes. Wavefunction-flow simulation with that learned potential produces a final density comparable to the conventional flow model and close to the target.
Flow-matching setup
- A fully connected network learns Vt through flow matching, and its gradient defines the velocity field transporting particles from the uniform initial distribution to the four-Gaussian target.The experiment uses a 5-128-64-32-16-1 network with Tanh hidden-layer activations and sine-cosine spatial encodings.Source: §4.6 · pp. 35–36
Evaluation results
- The learned-potential wavefunction-flow density has RMSE 2.248e-2, Wasserstein-1 distance 8.338e-2, and KL divergence 2.935e-1 from the target, with values close to the conventional flow model.Both simulated and reference final densities have four peak regions matching the four-Gaussian target, though simulated peak values are lower.Source: Table 6 · p. 36, §4.6 · pp. 36–37
5 Conclusion
The paper reports that QROM-based phase kickback reproduces conventional flow-model distributions, while a QNN replacement maintains simulation accuracy with significantly fewer circuit resources. It also reports successful integration of flow-matching potentials, alongside training-time and resource constraints.
Conclusion
- The QNN-based phase-kickback framework maintains wavefunction-flow accuracy relative to QROM while significantly reducing circuit resources.The QROM framework generates final distributions highly consistent with those of the corresponding conventional flow model.Source: §5 · p. 37
- Wavefunction-flow simulation with a flow-matching-learned potential reproduces the target distribution and matches conventional flow-model results.For time-dependent potentials, all discretized time-step values must be included in QNN training, resulting in considerable training time; multidimensional encoding requires more than eight QNN layers for high precision, increasing circuit resources.Source: §5 · p. 37
Statements and Declarations
The authors report partial funding from AI@MDU and no competing interests. They state that no datasets were generated or analyzed and that study code will be available upon reasonable request.
Funding and competing interests
- The research was partially funded by the initiative AI@MDU.The authors declare no competing interests.Source: Statements and Declarations · p. 37
Availability statements
- No datasets were generated or analyzed during the study, and the code will be made available upon reasonable request.Materials availability and consent for publication are listed as not applicable.Source: Statements and Declarations · p. 38
Author contributions
- All authors conceived the research idea; Rui Che conducted experiments and wrote the main manuscript text, with guidance and feedback from Ludvig af Klinteberg.All authors reviewed the manuscript.Source: Statements and Declarations · p. 38