Variational Quantum Circuits in Physics-Informed Neural Networks for 2D Navier–Stokes
A systematic evaluation of Variational Quantum Circuits (VQCs) inside Physics-Informed Neural Networks (PINNs) for 2D incompressible Navier–Stokes. The work spans -conditioned hypernetworks, input-conditioned VQC field maps, and quantum weight generators for vortex merger. Matched classical baselines, degeneracy guards, and fixed DNS holdouts show no robust quantum advantage on these tasks. The project product is a classical HarmMLP PINN that reconstructs four-vortex merger against spectral DNS to 1.29% FD-curl relative , with a smaller distilled deployable net at 1.78% and about inference throughput.
1. Introduction
Physics-informed neural networks enforce PDE residuals, boundary conditions, and data constraints through automatic differentiation. Pairing PINNs with variational quantum circuits is a recurring proposal for scientific machine learning: either the circuit generates network weights from a physical parameter (hypernetwork), or it evaluates the field map directly. In simulation both paths are expensive. PennyLane default.qubit runs on CPU; PINN training requires second-order autodiff through the circuit; wall-clock cost is routinely – a matched classical MLP at equal collocation size.
The scientific claim is not that a circuit can be wired into a loss. The claim is that, under fair capacity and protocol matching, the quantum model improves a primary metric without collapsing to a trivial solution.
Several evaluation failure modes invalidate quantum-PINN comparisons if left unchecked:
- Trivial solutions. Soft initial-condition penalties can admit when that field has small PDE residual.
- Unequal architectures. Comparing a tiny deployed MLP labeled “quantum” to a much larger classical teacher confuses model size with quantum compute.
- Unused circuits. Fixed circuit inputs, zeroed projection weights, or unused generators look like quantum training while computing classically.
- Proxy metrics. PDE residual alone, or velocity MSE without vorticity structure, can look strong while the flow topology is wrong.
This project treats those constraints as first-class: matched parameters (or classical capacity at least that of quantum), fixed holdouts, soft versus hard initial conditions made explicit, and degeneracy diagnostics (collapse_ratio, correction_rms, circuit ablation).
The applied goal is a reproducible 2D Navier–Stokes PINN for vortex merging against spectral DNS, with FD-curl vorticity error at most . The goal is to test whether VQC hypernetworks or generators beat matched classical models on Taylor–Green (TGV), Kolmogorov forcing, Burgers, and merger. All quantum results are simulator-only; no hardware.
2. Fairness Protocol and Metrics
- Capacity. Trainable parameter counts matched, or classical at least as large as quantum.
- Protocol. Same domain, viscosity , collocation and initial-condition sampling, and (when soft IC is used) the same penalty weights.
- Features. Where the VQC sees angle encodings, the classical control receives the corresponding sine and cosine features.
- Holdouts. Fixed grids or held-out values.
- Wall time. Report simulator wall clock, not only optimizer step count.
| Problem | Primary metric | Secondary |
|---|---|---|
| Taylor–Green (exact) | Velocity / gauge-aware pressure relative ; in-range vs extrapolated | Wall time |
| Kolmogorov (forced NS) | Holdout PDE residual RMS | Extrapolation in |
| Burgers VQC | Holdout PDE RMS under hard IC | collapse_ratio, correction_rms |
| Vortex merger | FD-curl relative max at , FP32 | Velocity relative ; inference points/s |
| Diagnostic | Meaning | Fail if |
|---|---|---|
| Near-zero field | ||
| under hard IC | Learned time evolution | (freeze) |
| Soft IC boundary loss | Matches the predictor | Plateau near with falling PDE loss |
| Circuit ablation | Randomize circuit weights / zero features | does not degrade circuit unused |
Success criteria. Quantum win: primary metric at most of classical and non-degenerate. Parity: within about . Otherwise classical wins or the result is inconclusive. Soft-IC PDE RMS alone is never promoted.
3. System Architecture
Deployed solvers are classical MLPs evaluated at query time :
- DirectNSMLP: Fourier / polynomial time features for TGV demos.
- HarmMLP / TargetPINNNS: harmonic Fourier features in with time channels, used for merger (product: width –, ; distilled student: –, ).
Training combines DNS collocation (merger), PDE residual, and optional hard IC of the form
Three quantum integration patterns were tested:
Figure 1: Three quantum integration patterns. Only Path B evaluates the circuit on field coordinates. Paths A and C use the circuit (when live) as a weight generator; inference remains a classical MLP.
A hypernetwork that never sees cannot claim circuit-in-the-loop PDE evaluation. Path C remains a fair test of whether a quantum generator beats a matched classical generator at equal deployed latency.
For vortex merger, the DNS reference is a periodic box , , four co-rotating Gaussian vortices merging toward a single core by . Gate times . Metric: finite-difference curl
FP32 only, with maximum relative at most .

Figure 2: Co-rotating vortex merger; DNS | classical HarmMLP | quantum-trained deployable net. Pointwise FD-curl relative is , yet the red vortex centers co-rotate only in DNS; classical and quantum largely freeze angularly after early time. The networks fit vorticity amplitude well under a pointwise loss, but that loss does not penalize orbital phase, and plain time features do not encode a sustained co-rotating trajectory.
4. Soft Initial Conditions and Degeneracy
On 2D Burgers, solves the PDE with zero residual. Soft initial-condition penalties with moderate weight therefore create a basin of “be zero.” Soft-IC scouts showed a lower quantum PDE RMS while both models sat at a boundary loss consistent with predicting the zero field; the quantum run collapsed harder. The protocol therefore uses a hard initial condition
Under hard IC, classical learns viscous and advective evolution while the small input-conditioned VQC freezes near the initial condition. Constant-input weight generators are likewise excluded: a circuit that never sees a varying parameter emits one weight vector forever and is not a functional quantum map over tasks.
5. Hypernetworks and Burgers VQC
Direct classical PINNs establish that the PDE is learnable: TGV about mean velocity relative at ; harder regime , about at ; Kolmogorov direct PDE RMS . Quantum models must beat a working classical baseline, not a collapsed field.
TGV parametric hypernetworks ( weights): classical wins on in-range and extrapolated (Appendix A). A redesigned expectation readout with log- encoding reduced quantum extrapolation chaos but did not produce a win.
Kolmogorov forced NS: same null on a harder PDE with sustained nonlinearity (Appendix A). The hypernetwork VQC line is closed for these tasks.
Input-conditioned Burgers VQC at matched capacity (about quantum versus classical parameters):
Under hard IC, classical learns evolution (correction_rms rises) while quantum freezes near the frozen-IC residual floor (Appendix B). The full multi-day preset was not run: the failure mode is expressivity / basin geometry, not undertraining. Simulator cost: about s/step at points for quantum versus milliseconds for classical on GPU.
Structural reading:
- Mapping to roughly weights is a classical-friendly encoder problem; the circuit never sees the field.
- TGV families are nearly linear diffusion (advection and pressure cancel); a weak stress test for entanglement.
- A linear head on plus a small re-uploading circuit behaves like low-order trigonometric features; Burgers advection needs a second harmonic that the matched MLP can form and the VQC did not under this scout.
- Matched parameter count does not imply matched useful function class under quantum constraints.
6. Vortex Product
This section is the shipped solver: reconstruct four same-sign vortex merger against spectral DNS.
| Approach | Outcome |
|---|---|
| Pointwise +curl, streamfunction, wide random Fourier features | Did not hit |
| HarmMLP –, | 1.29% classical teacher |
| Distill HarmMLP –, | 1.75% classical / 1.78% inject |
| End-to-end QNN vs matched classical generator | No robust advantage |
| Multi- family generators | Both arms |
| Orbit-gated relative + peak co-rotation | Partial; not promoted |
Harmonic Fourier features plus an FP32 curl gate on fixed DNS times were decisive. Distillation into a smaller HarmMLP preserves the band at higher throughput.
| Classical teacher | Deployable inject | |
|---|---|---|
| Deployed net | HarmMLP –, | HarmMLP –, |
| Params | ||
| relative max | 1.29% | 1.78% |
| Velocity relative max | 3.75% | 2.95% |
| Inference () | Mpts/s | Mpts/s () |
| Circuit at train / infer | n/a | Unused (projection weight zeroed; student copied into bias) |
A classical distill of the same – network hits 1.75% . The faster product checkpoint is therefore architecture size, not quantum computation.

Figure 3: snapshots (red = vortex relative maxima) across gate times for DNS, classical teacher, and deployable student.
Fair end-to-end advantage: Train a quantum weight generator end-to-end against a matched classical generator; both emit weights for the same HarmMLP –, . Circuit ablation must degrade on quantum runs. Across six seeds, classical wins ; mean favors classical by about percentage points (Appendix C). Verdict: no robust quantum advantage at matched deployed latency.
Multi- family: Both quantum and classical generators plateau around – training mean , not solvers. No advantage claim. This is an inconclusive attempt for both arms.
Orbit / swirl fidelity: Pointwise relative can pass while vorticity maxima freeze (DNS peaks continue to co-rotate). Adding orbital Fourier features and with improved early motion. Full-horizon swirl at most together with relative at most was not achieved in one promoted checkpoint (best compromise about relative / swirl). Product weights remain the pre-orbit inject pair.
7. Taylor–Green Vortex Visualizations
Stable 2D Taylor–Green is a weak physics stress test: is absorbed into pressure, so the pattern only decays. It remains useful for visual comparison with an exact solution.

Figure 4: Dense Taylor–Green Vortex (wavenumber ).

Figure 5: Exact | classical | quantum-trained Taylor–Green Vortex (; velocity relative about / ). Animation horizon matches training, .
Amplifying one lobe breaks exact balance and turns nonlinear advection back on (, ).

Figure 6: Unstable Taylor–Green Vortex; DNS | classical | quantum. Marker: boosted lobe center. Classical and quantum trained from scratch on this DNS (soft IC).
8. Empirical Findings
- Classical PINNs solve the merger gate. HarmMLP – reaches 1.29% FD-curl versus DNS; distilled – stays inside at about inference throughput.
- hypernetwork VQCs lose on TGV and Kolmogorov: matched classical generators are more accurate and about – faster to train in wall clock.
- Soft IC can produce misleading quantum rankings; under hard IC the Burgers VQC freezes near the initial condition.
- Fair end-to-end quantum generators do not beat matched classical generators on single- merger (quantum wins seeds; mean favors classical by about pp).
- The faster product “quantum” checkpoint does not use the circuit; a classical distill of the same small net matches its accuracy.
- Pointwise is not swirl fidelity: orbit features help; a joint relative- and swirl product checkpoint was not shipped.
- Simulator cost dominates for input-conditioned VQC PINNs at scout scale.
9. Conclusion
The contribution is a careful negative result on variational quantum circuits inside PINNs for 2D Navier–Stokes, paired with a positive classical PDE product. Under matched capacity, fixed holdouts, and degeneracy checks, VQC hypernetworks and input-conditioned circuits do not beat classical baselines on TGV, Kolmogorov, or Burgers. End-to-end quantum weight generators for vortex merger likewise show no robust advantage at equal deployed latency.
What does work is a harmonic-feature PINN against spectral DNS: 1.29% on the classical teacher, 1.78% on a smaller deployable net with about query throughput. That speedup is model size, not quantum compute. Methodologically, hard initial conditions, ablation tests, and architecture-matched controls are required before a quantum-PINN claim is credible.
10. References
[1] M. Raissi, P. Perdikaris, and G. E. Karniadakis (2019). Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. Journal of Computational Physics, 378, 686–707.
[2] G. E. Karniadakis, I. G. Kevrekidis, L. Lu, P. Perdikaris, S. Wang, and L. Yang (2021). Physics-informed machine learning. Nature Reviews Physics, 3, 422–440.
[3] V. Bergholm et al. (2018). PennyLane: Automatic differentiation of hybrid quantum-classical computations. arXiv:1811.04968. https://arxiv.org/abs/1811.04968
[4] M. Schuld, A. Bocharov, K. M. Svore, and N. Wiebe (2020). Circuit-centric quantum classifiers. Physical Review A, 101, 032308.
[5] A. Pérez-Salinas, A. Cervera-Lierta, E. Gil-Fuster, and J. I. Latorre (2020). Data re-uploading for a universal quantum classifier. Quantum, 4, 226.
[6] G. I. Taylor and A. E. Green (1937). Mechanism of the production of small eddies from large ones. Proceedings of the Royal Society A, 158, 499–521.
11. Appendix
Appendix A: Hypernetwork Scoreboards
TGV parametric ( weights)
| Split | Classical | Quantum | Q/C |
|---|---|---|---|
| in-range | 1.33% | 1.72% | 1.29 |
| extrap-lo | 2.09% | 49.0% | 23.4 |
| Wall time | 1182 s | 2146 s | 1.82 |
Kolmogorov forced NS
| Split | Classical | Quantum | Q/C |
|---|---|---|---|
| in-range PDE RMS | 0.00288 | 0.00534 | 1.85 |
| Combined extrap | - | - | 1.50 |
| Wall time | 1145 s | 2119 s | 1.85 |
Appendix B: Burgers Hard-IC Scout
Hard-IC scout (400 steps, 512 collocation points):
| Metric | Classical | Quantum | Frozen IC () |
|---|---|---|---|
| Holdout PDE RMS | 0.799 | 1.631 | 1.563 |
collapse_ratio | 0.67 | 0.996 | 1.0 |
correction_rms | 0.57 | 0.024 | 0 |
| Wall time | 4 s | 732 s | - |
Appendix C: Fair Merger Generator Matchup
Primary matchup (, , bottleneck ; seeds –):
| Quantum generator | Classical generator | |
|---|---|---|
| Mean pstdev | ||
| Seed wins | ||
| Best seed | (long classical best ) |
Mean difference percentage points against quantum. Other sweeps agree or favor classical.