Source-linked AI summary
Solving nonlinear differential equations with differentiable quantum circuits
Oleksandr Kyriienko, Annie E. Paine, Vincent E. Elfving
TL;DR
The paper addresses solving nonlinear differential equations, for which classical methods can face difficult high-dimensional, nonlinear, or singular problems. It constructs trial functions and their analytical derivatives with quantum feature maps and differentiable quantum circuits, then trains them in a hybrid workflow. Simulations include nonlinear examples and Navier–Stokes flow through a convergent-divergent nozzle, where DQCs find solutions despite challenges affecting classical steady-state solvers.
Problem
Nonlinear differential equations can be difficult to solve, including stiff Navier–Stokes systems whose singular behavior breaks classical steady-state solvers.
Method
The paper uses quantum feature maps, expectation-value function representations, analytically differentiated circuits, and hybrid optimization to satisfy differential equations and boundary conditions.
Results
Simulations solve representative nonlinear systems and compute density, temperature, and velocity profiles for convergent-divergent nozzle flow using optimized DQCs.
Takeaways & Limitations
DQCs provide a demonstrated route for finding solutions on continuous grids in a nozzle-flow problem that is challenging for classical steady-state solvers.
Abstract
from arXiv · showhide
We propose a quantum algorithm to solve systems of nonlinear differential equations. Using a quantum feature map encoding, we define functions as expectation values of parametrized quantum circuits. We use automatic differentiation to represent function derivatives in an analytical form as differentiable quantum circuits (DQCs), thus avoiding inaccurate finite difference procedures for calculating gradients. We describe a hybrid quantum-classical workflow where DQCs are trained to satisfy differential equations and specified boundary conditions. As a particular example setting, we show how this approach can implement a spectral method for solving differential equations in a high-dimensional feature space. From a technical perspective, we design a Chebyshev quantum feature map that offers a powerful basis set of fitting polynomials and possesses rich expressivity. We simulate the algorithm to solve an instance of Navier-Stokes equations, and compute density, temperature and velocity profiles for the fluid flow in a convergent-divergent nozzle.
I. INTRODUCTION
Nonlinear differential equations remain difficult for classical numerical methods, especially with many variables or strong nonlinearity. The paper proposes differentiable quantum circuits as a hybrid approach that avoids amplitude-encoding readout and input difficulties.
- Nonlinear differential equations are challenging when systems contain many functions and variables or exhibit high-degree nonlinearity.
- Amplitude-encoding quantum solvers can compress grids into quantum states, but reading out full solutions may require exponential sampling and preparing inputs may require QRAM.
- Quantum differential-equation protocols for nonlinear systems remain scarce, with existing approaches potentially retaining amplitude-encoding input and output problems.
- The proposed DQCs construct solutions with quantum neural-network circuits that handle functions and derivatives through automatic differentiation rules.
- The approach targets near-term noisy devices using shallow hybrid quantum-classical circuits, latent Hilbert-space representations, and observable-based scalar readout.
II. DQC-BASED DIFFERENTIAL EQUATIONS SOLVER: GENERAL OVERVIEW
The solver represents trial functions as expectation values of parametrized quantum circuits and differentiates their feature maps analytically. It trains circuit parameters on differential-equation residuals and boundary conditions over a grid of points.
- A quantum feature map encodes variables into a parametrized circuit, whose optimized state represents the sought function through observable expectation values.
- Automatic differentiation decomposes feature-map derivatives into modified circuits, and parameter-shift rules express them as sums of expectation values.
- Repeated parameter shifting produces higher-order derivatives, while automatic differentiation supplies analytical formulas instead of numerical finite differences.
- The optimization minimizes differential-equation residuals at grid points X while enforcing specified boundary conditions, yielding f(x)|θ→θopt ≈u(x).
- The approach combines feature-map encoding, analytical circuit differentiation, high-dimensional polynomial fitting, and expectation-value readout to address input, differentiation, and output issues.
III. METHODS
The methods section organizes the solver around differentiable circuits, variational ansatze, cost and loss functions, boundary handling, and regularization strategies.
- The solver requires quantum feature maps and derivatives, variational quantum circuits, cost functions, loss functions, boundary handling, and regularization strategies.
A. Quantum feature maps and their derivatives
Quantum feature maps encode variables into quantum states whose expectation values represent functions, while differentiable circuits provide analytical derivatives through parameter-shift constructions. The Chebyshev and evolution-enhanced variants expand the representational basis and expressivity.
- A quantum feature map is a typically nonlinear unitary circuit parametrized by x, translating variable dependence into quantum-state amplitudes.
- Product maps use nonlinear single-qubit rotations, and multiple layers or concatenated maps extend them to richer multivariable representations.
- Differentiation follows the chain rule and parameter-shift rules, expressing derivatives as sums of expectation values with shifted phases.
- Chebyshev feature maps use ϕ(x) = 2n arccos x, producing matrix elements associated with degree-n Chebyshev polynomials.These polynomials provide chaining, nesting, and simple differentiation properties.
- Increasing the Chebyshev basis size improves fitting accuracy, while evolution-enhanced maps combine Chebyshev and Fourier bases in the full Hilbert space.The cited fitting example reaches an accurate fit with n = 64.
- Chebyshev polynomials represent oscillatory functions on x = (−1, 1), but their derivatives diverge at the interval boundaries.
B. Variational quantum circuits
Variational quantum ansätze transform encoded quantum states into trial-function representations and are optimized alongside differentiable circuits. Hardware-efficient and alternating-block architectures trade expressivity, locality, and trainability.
- A variational ansatz manipulates the latent-space basis so that a quantum circuit can construct differential-equation solutions from encoded functions and derivatives.
- Hardware efficient ansatz: The hardware-efficient ansatz repeats parametrized single-qubit rotations and CNOT entangling layers, increasing expressive power with circuit depth d.
- Hardware efficient ansatz: Greater hardware-efficient depth introduces more controlled parameters, which can complicate optimization and create trainability problems.
- Alternating blocks ansatz: The alternating-block ansatz places local hardware-efficient subblocks in a checkerboard pattern and interleaves them across layers.
- Ansatz generators must be chosen in relation to the cost operator, including non-commuting generators and symmetry reductions where appropriate.
- The optimal ansatz for improving DQC training remains an open challenge because differential-equation solvers lack the physical guidance available in chemistry problems.
C. Cost function
The cost function is a Hermitian observable whose expectation value represents the trial scalar function. It can range from simple magnetization measurements to weighted operator sums and complex Hamiltonians.
- A Hermitian cost operator maps the expectation value of the parametrized quantum state to the scalar function f(x).
- Single-qubit magnetization ⟨Z_j⟩ is the simplest cost choice, while total magnetization can combine operators with equal or randomized weights.
- Hamiltonian costs may use inhomogeneous Ising couplings and transverse or longitudinal fields to define more complex observables.
- Spin-glass costs include NP-hard problem instances and can provide high expressivity for circuits representing differential-equation solutions.
- Multiple observables can be combined through a classically weighted sum whose coefficients α_l are tunable during Adam optimization.
D. Loss function
The loss function measures how closely the differentiable-circuit trial function satisfies the differential equations and boundary conditions over a training grid. Its distance metric and boundary weight affect optimization behavior and accuracy.
- The solver evaluates differential-equation residuals and boundary-condition errors at training points, then optimizes their combined distance.
- The general loss separates contributions from matching differential terms and satisfying boundary conditions.
- The loss is evaluated on a grid of M points and normalized by grid size while incorporating all equations in a system.
- A boundary pinning coefficient η controls the boundary-term weight, with larger η > 1 prioritizing higher boundary precision.
- The paper considers MSE, MAE, and KL- or Jensen–Shannon-based distances, finding MSE intuitive and sufficiently effective in numerical simulations.
- MSE emphasizes large residuals and discourages large L terms, whereas MAE and KL may converge more slowly but achieve higher accuracy near the optimum.
E. Boundary handling
The paper presents three boundary-handling strategies for matching initial or boundary values in DQC-based differential-equation solvers. They differ in whether boundary information enters the cost expectation, the loss function, or the function parametrization.
- Pinned boundary handling: Pinned boundary handling includes boundary information in the cost expectation and matches the initial value through a boundary term in the loss.Boundary and derivative terms receive equivalent treatment through the cost operator, but adjustment may be needed from randomly initialized parameters.
- Pinned boundary handling: A constant-times-identity shift in the cost operator can place the randomly initialized function near the initial value at the initial point.The shift parameter is chosen so the expectation typically lies close to u0 when evaluated at x = x0.
- Floating boundary handling: Floating boundary handling iteratively shifts the estimated solution based on the boundary or initial point without a separate boundary loss term or boundary encoding in the expectation.Boundary information is instead incorporated into the function parametrization and adjusted iteratively.
- Optimized boundary handling: Optimized boundary handling introduces a classical shift parameter fc that is updated alongside the quantum ansatz angles by gradient descent.This can quickly correct an initial mismatch, but boundary and differential terms in the loss may compete.
- Optimized boundary handling: The classical-shift method removes boundary information from the cost expectation, while retaining it in the loss function.Unlike exact boundary matching through a shift, this approach still requires gradients for fc and can create competition between loss terms.
F. Regularization
Regularization supplies prior or preferred function behavior early in training, then gradually yields focus to derivative-loss optimization. The schedule is designed to help initialize variational spectral representations and avoid local minima.
- Regularization strategy: Regularization provides a good initial guess for variational spectral representations and can help the optimizer avoid local minima.It may use prior information about the potential solution or bias the DQC toward preferred behavior.
- Regularization strategy: The regularization loss makes the DQC-based function match regularization values at corresponding grid points, analogously to a boundary-loss contribution.The paper illustrates this contribution using mean-squared error loss.
- Optimization schedule: The iteration-dependent weight ζ(n_j) emphasizes regularization during early training and diminishes toward zero at later iterations.This first establishes rough solution behavior and later prioritizes precise derivative-loss optimization.
- Optimization schedule: A reverse-sigmoid schedule smoothly drops the regularization weight at predefined training stages, shifting focus toward gradient optimization.The transition is controlled by the drop iteration n_drop and transition-rate parameters δ_j.
G. Multifunction encoding
For systems of differential equations, the paper considers encoding multiple functions in a shared quantum register. A common feature map and variational ansatz are reused, while different cost operators define the functions at readout.
- Shared-register encoding: Multiple functions can share one quantum register, compressing the function vector through a common feature map circuit and variational ansatz.Each function is distinguished by selecting a different cost operator during readout.
H. DQC-based solver: the workflow
The solver workflow converts nonlinear differential equations and boundary conditions into a grid-based hybrid quantum-classical optimization procedure. DQC expectation values and derivatives are evaluated across grid points, then combined into a loss for training.
- Problem specification: The workflow begins with nonlinear differential equations, their boundary conditions, and optional regularization points.These inputs define the problem that the differentiable quantum-circuit solver must satisfy.
- Grid evaluation: Function-variable points are selected on an equidistant, Chebyshev, or random grid, and variational parameters are initialized before expectation values are estimated.At each point, the expectation over the variational quantum state provides a potential solution value after boundary handling.
- Loss construction: Derivative quantum circuits are constructed and evaluated at each grid point, after which function values, derivatives, nonlinear cross-terms, and regularization contributions form the system loss.The required polynomials and cross-terms are assembled by classical postprocessing.
IV. RESULTS
The DQC solver is evaluated on increasingly challenging differential-equation examples, where expressive feature maps and boundary treatments determine solution quality. It also produces a stationary quasi-1D nozzle-flow solution despite singular behavior that prevents classical steady-state solvers from converging.
- Differential equation example: The single-ODE experiment compares DQC solutions with an analytical damped-oscillating solution across feature maps and circuit depths.The study uses λ = 8 and λ = 20 examples, then varies ansatz depth d = 3, 6, 12, 24.
- Differential equation example: For λ = 8, both Chebyshev feature maps converge near the true solution, while the product feature map fails to converge.The Chebyshev tower map takes longer to converge but reaches a solution closer to the true solution.
- Differential equation example: For λ = 20, only the more expressive ChebT feature map continues to perform well as the solution becomes more oscillatory and strongly damped.The product and simpler Chebyshev maps fail to converge, with their full losses rapidly plateauing.
- Highly nontrivial dynamics: Evolution-enhanced ChebT training captures intricate dynamics after a second 200-iteration stage, improving both full loss and solution quality.The initial ChebT stage comes close to the true solution but misses details; its learned angles initialize the evolution-enhanced stage.
- Strongly coupled equations: For strongly coupled equations, pinned and optimized boundaries converge slowly, whereas floating boundaries obtain a near-true solution with LQ approximately 10^-5.Floating boundaries automatically match the initial condition without a boundary-loss term, while competing loss terms cause early full-loss oscillations.
- Quasi-1D fluid dynamics: The nozzle-flow case uses a quasi-1D inviscid Navier–Stokes formulation and finds a stationary DQC solution despite divergence near the nozzle center challenging classical solvers.The computed solution covers the subsonic–supersonic transition and includes velocity, temperature, and density behavior.
- Quasi-1D fluid dynamics: Two-stage training first represents the subsonic region x ∈ (0, 0.4), then expands to the divergent region using 40 points across (0, 0.4) and (0.6, 0.9).In the first region, velocity grows toward the nozzle middle while temperature and density decrease slowly.
V. SUMMARY AND OUTLOOK
The paper presents differentiable quantum circuits as a framework for solving nonlinear differential equations through spectral function representations, analytical differentiation, and trainable loss functions. It discusses expressivity, possible quantum advantage, and future directions for scaling and optimization.
- The framework solves general systems of nonlinear differential equations using differentiable quantum circuits on gate-based quantum hardware.
- Quantum feature maps encode trial solutions in a latent Hilbert space, enabling spectral decompositions with Chebyshev or Fourier polynomial basis sets.
- Analytical circuit differentiation represents differential-equation derivatives, while loss functions guide optimization of the prepared trial solution.
- The method is demonstrated on Navier-Stokes equations and is described as applicable to other disciplines and to both global spectral and local grid-based treatments.
- Future improvements include adaptively growing circuits, stronger classical optimization, noise evaluation, error mitigation, and parallel training protocols.
- Potential quantum advantage depends on expressive representations, circuit trainability, and computational strategies for parallel DQC training across multidimensional grids.