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.
Figures & tables
Figure 1: QROM circuit for n=2 and m=2 , where add denotes the address qubits, and anc denotes the ancilla qubits. Multi-controlled operators Oi are implemented on ancilla qubits and controlled by address qubits by iterating over all 22=4 address states. Black and white control nodes represent controls on ∣0⟩ and ∣1⟩ , respectively, which select the different address states. Therefore, the controlled states of four Oi operators are ∣00⟩ , ∣01⟩ , ∣10⟩ and ∣11⟩ , respectively
Figure 2: Quantum simulation of W(t) using the 4-step Trotter product formula, where addj denotes the address qubits corresponding to the j -th spatial dimension, and anc denotes the ancilla qubits
Figure 3: The QROM-based phase kickback framework for the simulation of eiβDVt , and the framework for the simulation of eiαK in the j -th spatial dimension, where addj denotes the address qubits corresponding to the j -th spatial dimension, anci denotes the i -th ancilla qubit, and γ=α/2
Figure 4: The QNN-based phase kickback framework for the simulation of eiβDVt , and the framework for the simulation of eiαK corresponding to the j -th spatial dimension, where γ=α/2
Figure 5: The QNN circuit in the phase kickback framework for the simulation of eiαK corresponding to the j -th spatial dimension
Figure 6: The QNN layer circuit in the phase kickback framework for the simulation of eiαK corresponding to the j -th spatial dimension, where addj,i denotes the i -th address qubit corresponding to the j -th spatial dimension
Figure 7: Circuits of Rot and controlled-Rot oracles, ϕ , ω and ψ denote three angle parameters in each oracle
Figure 8: The time-dependent QNN circuit in the phase kickback framework for the simulation of eiβDVth
Figure 9: The QNN layer circuit in the phase kickback framework for the implementation of eiβDVth
Figure 10: Examples of the Time oracles
Figure 11: The training losses for the potential and kinetic evolution QNN circuits with different numbers of layers l
Number of layers
QNN circuit for potential evolution
QNN circuit for kinetic evolution
1
0.1712
0.1499
2
0.0421
0.0279
3
0.0039
0.0073
4
0.0001
0.0001
Table 1: Final training loss values under different depths of QNN circuits
Figure 12: The training losses for the potential and kinetic evolution QNN circuits with different loss functions
Figure 13: The comparison between the binary representations of the exact potential diagonal entries of DVt0 and the corresponding probabilities learned by the QNN circuit under different loss functions. The y -axis represents the states of the input, where each state corresponds to a diagonal entry. The x -axis represents the ancilla qubit indices, where the i -th qubit index corresponds to the i -th binary bit of the diagonal entry
Loss function
Mean distance
Standard deviation
Loss function 1
0.0001
0.0001
Loss function 2
0.3726
0.3645
Loss function 3
0.4027
0.3286
Table 2: The mean distances and standard deviations across all probabilities under different loss functions
Figure 14: Comparison of final probability densities generated by wavefunction flow simulation using QNN- and QROM-based phase kickback frameworks, and reference final densities under V1(x,t)
Figure 15: Comparison of final probability densities generated by wavefunction flow simulation using QNN and QROM-based phase kickback frameworks, and reference final densities under V2(x,t)
Figure 16: Comparison of final probability densities generated by wavefunction flow simulation using QNN- and QROM-based phase kickback frameworks, and reference final densities under V3(x,y,t)
Figure 17: Comparison of final probability densities generated by wavefunction flow simulation using QNN- and QROM-based phase kickback frameworks, and reference final densities under V4(x,y,t)
QNN-based phase kickback
QROM-based phase kickback
V
RMSE
RME
DKL
W1
RMSE
RME
DKL
W1
V1
5.965e-3
0.011
6.475e-5
1.119e-3
6.141e-3
0.012
6.677e-5
9.107e-4
V2
6.424e-3
0.014
6.443e-5
9.353e-4
6.381e-3
0.014
6.386e-5
9.191e-4
V3
1.580e-4
0.013
6.028e-5
7.397e-3
1.550e-4
0.011
5.306e-5
7.202e-3
V4
1.572e-4
0.011
5.548e-5
6.819e-3
1.568e-4
0.011
5.499e-5
6.818e-3
Table 3: Errors between final probability densities generated by wavefunction flow simulation using QNN- and QROM-based phase kickback frameworks, and reference final probability densities under the uniform initial distribution
QNN-based phase kickback
QROM-based phase kickback
V
RMSE
RME
DKL
W1
RMSE
RME
DKL
W1
V1
6.339e-3
0.012
7.010e-5
8.843e-4
6.234e-3
0.013
6.724e-5
7.669e-4
V2
7.154e-3
0.013
5.382e-5
1.444e-3
7.852e-3
0.013
6.704e-5
1.382e-3
V3
2.344e-4
0.013
9.852e-5
7.870e-3
2.346e-4
0.013
9.826e-5
7.870e-3
V4
3.465e-4
0.021
1.691e-4
1.051e-2
3.525e-4
0.022
1.720e-4
1.036e-2
Table 4: Errors between final probability densities generated by wavefunction flow simulation using QNN- and QROM-based phase kickback frameworks, and reference final densities under the periodic exponential initial distribution
Figure 18: The number of CNOT gates in QNN and QROM circuits obtained from decomposition tools in PennyLane for the simulation of e−iβDVt corresponding to V1(x,t)
QNN
QROM
n
QNN circuit
Phase kickback framework
QROM circuit
Phase kickback framework
2
192
384
24
48
3
432
864
576
1152
4
960
1920
6080
12160
5
1680
3360
39424
78848
Table 5: The number of CNOT gates in QNN and QROM circuits, and the corresponding phase kickback frameworks from decomposition tools in PennyLane
Figure 19: Errors between the final probability densities generated by wavefunction flow simulation and the reference final probability densities with different numbers of ancilla qubits m
Figure 20: Errors between the final probability densities generated by wavefunction flow simulation and reference final probability densities with different Δx
Figure 21: Errors between the final probability densities generated by the wavefunction flow simulation and reference final probability densities with different Nt under different numbers of address qubits
Figure 22: The left figure shows the initial and the target particle plots. The right figure shows the final particle plot obtained by the flow model, in which the particles are transported under the velocity field generated by the learned potential Vt through flow matching, together with the exact target particle plot
Figure 23: Comparison of the final probability density obtained by wavefunction flow simulation and the target distribution. The first figure represents the initial probability density, the second figure denotes the final probability density obtained by the wavefunction flow simulation, the third figure shows the the corresponding reference final density, and the last figure shows the target probability density consisting of four Gaussian balls
Method
RMSE
Wasserstein-1 distance
KL divergence
Wavefunction flow simulation
2.248e-2
8.338e-2
2.935e-1
Reference method
3.291e-2
9.213e-2
2.492e+0
Table 6: Comparison of final probability density errors between wavefunction flow simulation and the reference method
The flow matching has rapidly become a dominant paradigm in classical generative modeling, offering an efficient way to interpolate between two complex distributions. We extend this idea to the quantum realm and introduce the Quantum Flow Matching (QFM), a quantum-circuit realization that offers efficient interpolation between two density matrices. QFM offers systematic preparation of density matrices and generation of samples for accurately estimating observables, and can be realized on quantum computers without the need for costly circuit redesigns. We validate its versatility on a set of applications: (i) generating target states with prescribed magnetization and entanglement entropy, (ii) estimating nonequilibrium free-energy differences to test the quantum Jarzynski equality, and (iii) expediting the study on superdiffusion. These results position QFM as a unifying and promising framework for generative modeling across quantum systems.
Zidong Cui, Pan Zhang, Ying Tang
Institute of Fundamental and Frontier Sciences, University of Electronic Science and Technology of China, Chengdu 611731, China · Institute of Theoretical Physics, Chinese Academy of Sciences, Beijing 100190, China · School of Fundamental Physics and Mathematical Sciences, Hangzhou Institute for Advanced Study, UCAS, Hangzhou 310024, China +3
Neural quantum states (NQS) provide a flexible and scalable framework for approximating quantum many-body wavefunctions. Among NQS parameterizations, autoregressive models are especially attractive because they enable exact, independent sampling from the Born distribution, avoiding the autocorrelation and mixing issues of Markov chain methods. Yet their optimization remains comparatively underexplored: Adam is a scalable method but ignores function space geometry, while stochastic reconfiguration is principled but costly and numerically fragile in large models. To address this gap, we show that variational energy minimization can be viewed as an advantage policy-gradient problem over the Born distribution, motivating trust-region optimization for NQS training. We introduce Proximal Wavefunction Optimization (PWO), a principled trust-region algorithm that clips probability-ratio changes in the amplitude channel and phase increments in the phase channel. PWO avoids explicit matrix inversion, reuses samples across multiple updates, and combines the scalability of first-order optimization with theoretical guarantees. Across Ising and frustrated J1-J2 one- and two-dimensional spin systems, PWO improves stability and wall-clock convergence over Adam, minSR, and SPRING. Finally, we fine-tune a 1.5B-parameter RWKV-7 model, demonstrating NQS optimization at a scale over three orders of magnitude beyond prior work.
Juan Agustín Duque, Sergio García Heredia, Vinicius Hernandes +4
Mila Quebec AI Institute, Université de Montréal, Montréal, Canada · Applied Quantum Algorithms ⟨aQaL⟩, LIACS & LION, Leiden University, Leiden, Netherlands · QuTech and Kavli Institute of Nanoscience, Delft University of Technology, Delft, Netherlands +1
The emergence of powerful deep generative models based on diffusion and flow matching has enabled the learning and modeling of complex distributions. Learning quantum distributions, however, remains challenging due to the inherent difficulty of accurately modeling the meaningful physical properties of quantum states. We propose Quantum Flow Matching (QFM), a novel generative model designed to learn quantum distribution by utilizing spin Wigner function and flow matching. By converting density matrix into the spin Wigner function and leveraging functional flow matching to learn distributions in function space, QFM enables accurate and effective learning of multi-qubit quantum distributions. We demonstrate the effectiveness of our method by evaluating physical quantities such as trace, purity, and entanglement entropy of the generated quantum states, accurately capturing the underlying physics of the given quantum distributions.
Jaehoon Hahm, Tak Hur, Joonseok Lee +1
Department of Statistics and Data Science, Yonsei University, Seoul, Korea · Graduate School of Data Science, Seoul National University, Seoul, Korea · Google Research, Mountain View, California, United States +1