This project analyzes the practical limits of Variational Quantum Eigensolvers (VQE) by separating two dominant sources of error:
- Discretization Error from finite difference representations of the Hamiltonian
- Variational Error from ansatz expressibility and optimization
Rather than evaluating VQE in isolation, it is benchmarked against the best achievable classical solution under identical discretization constraints.
The project evaluates this by computing the ground state energy level of the Hydrogen atom in two different ways:
- A pure C++ Eigen based eigendecomposition of the Hamiltonian for high resolution, exact decomposition
- Using qiskit in Python to perform a VQE on the Hamiltonian
This work demonstrates that in the low-qubit VQE simulations of the Hydrogen atom, discretization error dominates algorithmic error. This suggests that VQE is better understood as a representation-limited, rather than optimization-limited, problem
We showcase how both discretization and variational errors transform as a function of
- In low-qubit regimes, VQE error is dominated by Hamiltonian discretization, not ansatz or optimizer choice.
- Improving VQE performance requires improving the problem representation (discretization + encoding), not only the quantum circuit.
- Classical exact diagonalization provides a much more stable and accurate baseline under the same discretization constraints.
- Increasing the number of qubits alone does not guarantee improved accuracy without corresponding improvements in the underlying discretized model.
- The dominant error source transitions from discretization-limited → variational-limited as system expressibility increases.
- This project reframes VQE evaluation as a representation-limited simulation problem rather than purely an optimization problem.
The analytic Hamiltonian for the radial component of the wavefunction
in SI units and
in atomic units. A brief note that the C++ eigensolver uses SI units, and the python VQE uses atomic units (for consistency in Qiskit implementations). The ground state energy is
- Choose grid size
$N$ - Choose maximum radial cutoff
$r_{\max}$
- Exact diagonalization using Eigen
- Scaling:
$O(N^{3})$ - Outputs:
- First
$N$ energies (default: ground state energy) in eV - Wavefunctions (default: ground and first excited state)
- Discretization error observation
- First
- Encodes system using
$\lceil\log_{2}\left(N_{states}\right)\rceil$ qubits - Ansatz: hardware-efficient SU(2)
- Optimizer: L-BFGS-B
- Simulator: statevector
- Outputs:
- Ground state energy (in Ha)
We separate total VQE error into
Procedure:
- For each
$N, r_{max}$ :- Compute the theoretical lower bound via exact diagonalization under the same discretization
- Compare VQE output to this lower bound
This isolates
- Error due to finite-resolution discretization (numerical precision)
- Error due to variational uncertainty (quantum algorithm)
The quantitative results below should be interpreted relative to the discretization limits identified in the error landscape.
- Classical Solver (
$N=1000$ )- Error:
$\approx0.02%$ - Runtime:
$\approx0.3$ seconds - Deterministic result
- Error:
- Chosen VQE (3 qubits,
$N=8$ ,$r_{\text{max}}=16$ )- Mean error:
$38.50\pm0.55%$ - Best error:
$38.20%$ - Runtime:
$0.17\pm0.05$ seconds - Best runtime:
$0.12$ seconds - Number of restarts: 10
- Mean error:
The number of qubits and
Combining the key results plots below allows for a detailed study into the optimal tradeoffs between the number of qubits, maximum radius in Hamiltonian discretization and the resulting "best case" energy for this setup.
Variability in the VQE approach arises from sensitivity to initial parameter choice, as well as the non-convex optimization landscape. In a more expressive ansatz, the barren plateau effect may become more significant due to the expressibility and depth of the ansatz.
Results of scanning phase space of number of qubits vs
- Increasing qubits alone does not guarantee better error performance; neither does increasing or decreasing
$r_{\max}$ - Each set (
$N_{\text{qubits}}, r_{\max}$ ) has an optimal solution that balances each error to find the minima - The impact of discretization error is reduced as the effective resolution of the encoded system increases with additional qubits
- Each set (
Results of scanning phase space of number of qubits vs
- As the number of qubits increases, the variational error (with respect to the discretization error) increases
- At low qubits (
$N_{\text{qubits}}=1$ ), the landscape is trivially covered, leading to very small variational uncertainty
Average time to perform minimization of ansatz as a function of number of qubits and
- 10 runs per bin
- As the number of qubits increases, the average runtime exponentially increases
$\rightarrow$ run time must also be considered when choosing optimal running parameters
Classical solutions match analytic hydrogen wavefunctions, validating our choice of discretization.
The classical method operates in a large Hilbert space (
- Classical: increasing accuracy
$\rightarrow$ higher computational cost - VQE - reduced dimensionality
$\rightarrow$ increased optimization complexity
For example:
Implication: In low-qubit regimes, improving VQE performance is often a bottleneck on numerical modeling and problem framing, not on the quantum algorithm. As the number of qubits grows, the variational error becomes the bottleneck due to features such as optimization landscape complexity.
- Cross-language pipeline: C++ (Eigen) + Python (Qiskit)
- Automated sweeps over
$\left(N, r_{\max}\right)$ for error mapping - Reproducible plotting via gnuplot + LaTeX
- Numerical stability near
$r\to0$ - End-to-end pipeline via Makefile
Future extensions could incorporate shot-based estimation and noise models to study the robustness of VQE under realistic NISQ hardware constraints.
After installing all dependencies, you can simply run make from the main directory of the repository. If you wish to run only the classical approach, run make classic. For just the quantum portion: make quantum. For just the studying of the phase space of the VQE: make evaluation.
├── quantum/
├── classical/
├── data/
├── Plots/
├── Plotting/
├── Makefile
├── LICENSE
├── requirements.txt
├── README.md
quantum/: Directory that performs a VQE in Python and qiskit to solve for the ground state energy of the Hydrogen atom. Contains two files:vqe.py: file that handles the VQE solving, as well as creating the Hamiltonian for the VQEerror_estimation.py: file that benchmarks and evaluates top achievable VQE model performance for varying number of qubits, N and max radius
classical/: Directory that houses C++ code to perform classical eigendecomposition of Hamiltonian to solve for energy levels of Hydrogen atom. This file also outputs the data for the reconstructed wavefunctions of the Hydrogen atom and stores them indata/wavefunctions.datsrc/Houses the source code to run the eigensolverinclude/Houses the header file to define the eigenSolver class, various constants and other methods
data/: Directory that contains data for output wavefunctions from classical approachMakefile: Top-level Makefile that, upon running "make", will run all the code and produce the output comparisonsPlots/: Directory that contains output oferror_estimation.py, including various quantitative evaluations of the VQE project on Hydrogen. As well, output wave functions from the classical approach (done in thePlotting/directory)LICENSE: MIT License for this reporequirements.txt: requirements for this repository in python. Can runpip install -r requirements.txtfor simplicity.Plotting/: usage of gnuplot-latex-utils as a submodule to create publication-quality plots on the fly through gnuplot and LaTeX. Please see original documentation for more information.wave_functions/: Directory that plots the extracted wave functions from the classical approach vs the analytic curves.pdfs/: Where the output pdf is stored/
- Classical:
- C++ >= C++17
- CMake
- Eigen3
- Quantum:
- numpy
- matplotlib
- scipy (scipy.optimize)
- qiskit
- Dependencies outlined in gnuplot-latex-utils including
- Gnuplot
- LaTeX