---
title: Variational Quantum Linear Solver
url: https://www.emergentmind.com/topics/variational-quantum-linear-solver
type: topic
---

# Variational Quantum Linear Solver

The Variational Quantum Linear Solver (VQLS) is a class of hybrid quantum–classical algorithms developed to prepare quantum states that encode the solution of linear algebraic problems, most prominently systems of linear equations, using shallow, parameterized quantum circuits and classical optimizers. VQLS is tailored to near-term noisy intermediate-scale quantum (NISQ) devices by circumventing the prohibitive circuit depths and error correction demands of algorithms such as the Harrow-Hassidim-Lloyd (HHL) quantum linear system solver. VQLS frameworks not only provide rigorous operational bounds on solution precision but also introduce advanced techniques—such as Hamiltonian morphing, adaptive and dynamic ansatz strategies, and efficient cost function measurement schemes—allowing them to address large, sparse, and structured problems arising in scientific computing, optimization, and machine learning.

## 1. Problem Mapping: Linear Algebra as Ground State Search

At the core of VQLS is the recasting of key linear algebraic problems as ground-state search problems of specially constructed Hamiltonians. For matrix–vector multiplication and matrix inversion tasks, the solution state is the unique ground state (of zero eigenvalue) for an associated positive semi-definite Hamiltonian:

- For matrix–vector multiplication with a sparse (possibly non-Hermitian) matrix $M$ and state $|v_0\rangle$, the normalized solution
  $$
  |v_M\rangle = \frac{M|v_0\rangle}{\|M|v_0\rangle\|}
  $$
  is the ground state of
  $$
  H_M = I - \frac{M|v_0\rangle\langle v_0|M^\dagger}{\|M|v_0\rangle\|^2}\,.
  $$
- For a Hermitian invertible system $M|x\rangle = |v_0\rangle$, the solution
  $$
  |v_{M^{-1}}\rangle = \frac{M^{-1}|v_0\rangle}{\|M^{-1}|v_0\rangle\|}
  $$
  is the ground state of
  $$
  H_{M^{-1}} = M^\dagger (I - |v_0\rangle\langle v_0|) M\,.
  $$

By encoding the linear system as a ground state search, the variational search reduces to minimizing the expectation value of $H$ with respect to a parameterized quantum state [1909.03898].

## 2. Variational Hybrid Quantum-Classical Framework

The VQLS procedure adopts a variational hybrid scheme structurally akin to Variational Quantum Eigensolvers (VQE):

- A parameterized ansatz circuit $U(\vec{\theta})$ prepares the trial state $|\phi(\vec{\theta})\rangle = U(\vec{\theta})|0\rangle$.
- The cost function (energy) is
  $$
  E(\vec{\theta}) = \langle\phi(\vec{\theta})| H |\phi(\vec{\theta})\rangle\,,
  $$
  where $H$ is the Hamiltonian encoding the linear algebraic problem.
- The classical optimizer updates the parameters $\vec{\theta}$ iteratively to minimize $E(\vec{\theta})$, using either stochastic gradient descent or advanced optimizers (e.g., BFGS, AMSGrad, SPSA) [1909.05820, 2106.08682].
- Gradients are typically computed using finite differences, the parameter-shift rule, or dedicated quantum circuits.

Global and local cost functions are employed to quantify proximity to the solution, e.g.,
$$
C_G = 1 - \frac{|\langle b|\psi\rangle|^2}{\langle \psi|\psi\rangle},\quad\text{where}\ \ |\psi\rangle = A|x(\vec{\theta})\rangle.
$$
Operational termination criteria guarantee that for final cost $C$ and system condition number $\kappa$, the error $\epsilon $ satisfies $C \geq \epsilon^2/\kappa^2$ [1909.05820].

## 3. Hamiltonian Morphing, Adaptive, and Dynamic Ansatz Strategies

VQLS addresses the optimization landscape challenges, such as local minima and barren plateaus, through advanced techniques:

- **Hamiltonian morphing:** Instead of optimizing over the full target Hamiltonian, the algorithm evolves through an interpolated family $H(t)$ connecting an easy-to-prepare initial ground state to the target Hamiltonian. At each incremental step $t \rightarrow t+\delta t$, the ansatz parameters are “warm-started” from the previous solution, tracking the ground state and facilitating optimization [1909.03898, 2505.24285].
- **Adaptive ansatz:** The algorithm dynamically increases the complexity or depth of the parameterized circuit only when needed, based on the observed cost function value. For instance, when the residual does not drop below a threshold, additional circuit layers are introduced, thus mitigating over-parameterization and excessive noise accumulation [2107.08606].
- **Dynamic ansatz with switching parameter (SP):** A switching parameter governs when to grow the circuit depth, with total resource cost (TRC) metrics introduced to quantify trade-offs between the number of circuit evaluations and circuit depth [2107.08606].

## 4. Measurement, Circuit Decomposition, and Resource Trade-Offs

Efficient measurement strategies are critical for practical deployment:

- Matrices are generally decomposed via Linear Combination of Unitaries (LCU) as $A = \sum_l c_l A_l$. Cost function evaluation requires quantum circuits for overlapping terms such as $\langle 0|V^\dagger A_l^\dagger A_k V|0\rangle$, commonly estimated via Hadamard tests or Hadamard-Overlap Test circuits which minimize controlled gate overhead [1909.05820].
- For structured sparse matrices, alternate decompositions (e.g., sigma basis with unitary completion, or multi-qubit gate decompositions such as SWAP and center-switch gates) can reduce the number of terms from $\mathcal{O}(N^2)$ (Pauli basis) to $\mathcal{O}(\log N)$, thus alleviating the scaling of circuit evaluations, albeit sometimes at the expense of increased circuit depth [2404.16991, 2412.04938].
- Sophisticated error mitigation strategies, including probabilistic error cancellation, can restore operational fidelity under NISQ noise [1909.05820, 2106.08682].

## 5. Numerical Performance, Resource Scaling, and Solution Certification

Numerical and hardware implementations validate VQLS accuracy and scaling:

- For sparse, structured matrices (sizes up to $64\times64$), the required circuit depth to reach fidelity $>99\%$ scales linearly with the matrix condition number $\kappa$.
- For random $n$-qubit systems, computation time fits $y = 0.0024 \cdot (\text{matrix size})^{3.1}$ [1909.03898].
- Hardware experiments yield high solution fidelities (e.g., $99.95\%$ for a $2$-dimensional problem on IBM Quantum) [1909.03898].
- Preconditioning via incomplete LU (ILU) factorization further reduces required circuit depth and mitigates the impact of matrix conditioning by better homogenizing the spectrum of $A$ [2312.15657].
- Solution verification is inherent: the ground state energy of the constructed Hamiltonian is zero, so the cost function minimum provides a direct fidelity guarantee; e.g., $E_{M^{-1}} \approx 0$ implies high overlap with the exact solution, up to a term set by $\kappa^2 E_{M^{-1}}$.

## 6. Practical Implications, Limitations, and Applications

VQLS is particularly effective for:

- **Sparse and structured matrices**, where the off-diagonal pattern can be exploited for efficient decomposition and measurement [1909.03898, 2404.16991].
- **NISQ hardware:** Shallow circuits and resource-aware ansatz tuning ensure near-term implementability [1909.05820, 2107.08606].
- **Machine learning and optimization:** Key subroutines such as matrix inversion and matrix–vector multiplication are central to regression, kernel methods, quantum SVMs, and broader optimization frameworks [2309.07770].
- **Physical simulation:** Large-scale PDEs, computational fluid dynamics, and open quantum system simulations harness structured matrices, where VQLS has demonstrated competitive accuracy and scaling [2409.03241, 2508.20887].
- **Quantum transport and device simulation:** Extension to problems with complex, nonsymmetric matrices further broadens application scope [2509.07005].

Limitations include:

- **Circuit execution overhead:** The number of quantum circuit evaluations for cost function estimation may scale as $\mathcal{O}(L^2)$ (for $L$ LCU terms), which can be prohibitive for general dense matrices [2409.06339, 2412.04938].
- **Ansatz expressivity:** The need for sufficiently expressive circuits becomes acute for general, unstructured matrices or in problems where the solution wavefunction lies in a complex subspace; shallow circuits may fail to reach high fidelity in these instances.
- **State preparation:** Efficiently preparing the right-hand side $|b\rangle$ as a quantum state is non-trivial for arbitrary $b$, and may require additional circuit depth [2409.06339].
- **Noise sensitivity:** While noise-resilience is observed (due to the robustness of the cost minimum), performance degradation can occur for particularly deep or highly parameterized circuits, or for ill-conditioned systems [2106.08682].

## 7. Extensions, Variants, and Future Directions

Variants and ongoing developments include:

- **Hybrid multi-ansatz architectures:** Combining several circuit branches in a tree-like structure to expand the expressible state space and further mitigate barren plateaus, particularly effective in high-dimensional, stiff systems (e.g., compressible Navier–Stokes solvers) [2508.20887].
- **Evolutionary/genetic ansatz construction:** Leveraging algorithmic (genetic) search for hardware-efficient circuit structures tuned for the problem instance [2108.11362].
- **Logical ansatz/CQS methods:** Building the solution as a linear combination of shallow circuits, with classical regression for optimal weights [2108.11362].
- **Adiabatic/variational-adiabatic protocols with warm starts:** Adiabatically morphing the system Hamiltonian through a parametric family, warm-starting the optimizer at every step to robustly track the ground state and mitigate barren plateaus, even with shallow circuits [2505.24285].
- **Mod-2 and non-Hermitian extensions:** Adapting VQLS protocols to solve binary-valued systems modulo $2$ (using CNOT networks and rotation-only ansätze) or to address quantum transport with complex nonsymmetric Hamiltonians via new cost functions and decomposition schemes [2311.12771, 2509.07005].
- **Classical analogues and benchmarking:** Neural network–based classical variational solvers (VNLS) constructed in parallel with VQLS for benchmarking quantum advantage and for identifying where true hardness lies (i.e., efficient quantum state sampling) [2211.02929, 2504.08141].

VQLS continues to be a focus in quantum algorithm and application research, with advances in ansatz design, problem mapping, measurement reduction, and hybridization bridging the gap between quantum resource constraints and the need for efficient, scalable linear algebra in simulation, optimization, and data science.

Source: https://www.emergentmind.com/topics/variational-quantum-linear-solver