Skip to main content

ExcitationSolve paper DOI PyPI

An optimization algorithm for ansätze consisting of excitation operators in variational quantum eigensolvers (VQEs).

Abstract

We introduce ExcitationSolve, a fast globally-informed gradient-free optimizer for physically-motivated ansätze constructed of excitation operators, a common choice in variational quantum eigensolvers. ExcitationSolve is to be classified as an extension of quantum-aware and hyperparameter-free optimizers such as Rotosolve, from parameterized unitaries with generators $G$ of the form $G^2=I$, e.g., rotations, to the more general class of $G^3=G$ exhibited by the physically-inspired excitation operators such as in the unitary coupled cluster approach. ExcitationSolve is capable of finding the global optimum along each variational parameter using the same quantum resources that gradient-based optimizers require for a single update step. We provide optimization strategies for both fixed- and adaptive variational ansätze, as well as a multi-parameter generalization for the simultaneous selection and optimization of multiple excitation operators. Finally, we demonstrate the utility of ExcitationSolve by conducting electronic ground state energy calculations of molecular systems and thereby outperforming state-of-the-art optimizers commonly employed in variational quantum algorithms. Across all tested molecules in their equilibrium geometry, ExcitationSolve remarkably reaches chemical accuracy in a single sweep over the parameters of a fixed ansatz. This sweep requires only the quantum circuit executions of one gradient descent step. In addition, ExcitationSolve achieves adaptive ansätze consisting of fewer operators than in the gradient-based adaptive approach, hence decreasing the circuit execution time.

Examples

VQE convergence for different molecules and optimizers, including ExcitationSolve in red, using a UCCSD ansatz.

Convergence

Installation

ExcitationSolve is available on PyPI:

pip install excitationsolve

Alternatively, install directly from GitHub:

pip install git+https://github.com/dlr-wf/ExcitationSolve.git

Usage

See the examples folder for usage examples for qiskit and pennylane. The core (1D) algorithm is implemented in excitation_solve.py and can be used independently of any quantum computing SDK like qiskit or pennylane. The 2D ExcitationSolve algorithm is implemented in excitation_solve_2d.py. An implementation for using ExcitationSolve in combination with ADAPT-VQE in PennyLane can be found in excitation_solve_adapt.py.

Qiskit

from excitationsolve.excitation_solve_qiskit import ExcitationSolveQiskit

Then use the ExcitationSolveQiskit optimizer instead of other qiskit optimizers, like COBYLA or L-BFGS, as demonstrated in the qiskit example.

Optimal energies and parameters

The qiskit VQE callback function can only track the energies and parameters of executed circuit. ExcitationSolve does not need to execute the circuit at optimal parameter configurations to perform the optimization. Therefore, the callback function never recieves optimal energies and parameters. Plotting these, would show false optimization progress, although the final optimized energy and paramters are saved in the VQEResult object, returned from the VQE.compute_minimum_eigenvalue function. To better track the optimization progress, the ExcitationSolveQiskit optimizer object internally saves all energies in its energies member variable, corresponding number of energy evaluations nfevs and optionally the parameters params (if save_parameters is set to True). These are saved after each optimization step, i.e. after optimizing each single parameter. For plotting the optimization progress use the data stored in counts and values from the following code snippet:

optimizer = ExcitationSolveQiskit(maxiter=100, save_parameters=True)
# Perfrom optimization here...
counts = optimizer.nfevs
values = optimizer.energies
params = optimizer.params

Pennylane

Use the excitationsolve.excitation_solve_pennylane.excitationsolve_pennylane function in a VQE loop as used in the pennylane (dataset) example or the pennylane (pyscf) example. Alternatively, one can use the excitationsolve.excitation_solve_step function to optimize a single parameter. The excitationsolve.excitation_solve_pennylane.excitationsolve_pennylane optimizes all parameters, or a subset of them, in the quantum circuit using excitationsolve.excitation_solve_step.

SciPy

Use the excitationsolve.ExcitationSolveScipy class in combination with the scipy.optimize.minimize function:

excsolve_obj = ExcitationSolveScipy(maxiter=100, tol=1e-10, save_parameters=True)
optimizer = excsolve_obj.minimize
def callback(xk): # or callback(intermediate_result)
    print(xk)
options = dict(parameter_occ=parameter_occ) # optional, use if parameters occur multiple times in the ansatz
res = scipy.optimize.minimize(cost, params, method=optimizer, callback=callback, options=options)
energies = excsolve_obj.energies
counts = excsolve_obj.nfevs

Optimal parameters of double excitations w.r.t. the Hartree-Fock state

Use exitationsolve.optimal_theta and excitationsolve.optimal_theta_pyscf to calculate analytic optimal parameter values for individual double excitations when applied to the Hartree-Fock reference state. Both functions return the optimal parameter and the energy difference to the Hartree-Fock energy. The optimal parameter is defined as $\theta^*=\argmin_\theta\bra{\mathrm{HF}}U^\dagger(\theta) H U(\theta)\ket{\mathrm{HF}}$ where $H$ is the electronic structure Hamiltonian, $U(\theta)$ is one double excitation, and $\ket{\mathrm{HF}}$ is the Hartree-Fock state. In Haas et al., 2026 it has been shown that initializing doubles in their respective optimal parameter and appending them to the ansatz in order of energy impact is an efficient operator selection and warm-start strategy.

Testing

To run the tests, install the needed dependencies with

uv pip install .[test]

and execute

pytest

Authors

  • Jonas Jäger
  • Thierry N. Kaldenbach
  • Max Haas
  • Erik Schultheis

Contact

Feel free to contact David Melching if you have any questions.

Citation

If you use portions of this code please cite our paper:

@article{Jaeger2025Fast,
    title={Fast gradient-free optimization of excitations in variational quantum eigensolvers},
    author={Jäger, Jonas and Kaldenbach, Thierry N. and Haas, Max and Schultheis, Erik},
    year={2025},
    volume={8},
    number={1},
    journal={Communications Physics},
    publisher={Springer Science and Business Media LLC},
    language={en},
    url={http://dx.doi.org/10.1038/s42005-025-02375-9},
    DOI={10.1038/s42005-025-02375-9},
}

If you use the exitationsolve.optimal_theta or excitationsolve.optimal_theta_pyscf functionalities please also cite Haas et al., 2026:

@article{Haas2026Efficient,
    title={Efficient Operator Selection and Warm-Start Strategy for Excitations in Variational Quantum Eigensolvers}, 
    url={https://arxiv.org/abs/2602.10776},
    DOI={10.48550/ARXIV.2602.10776},
    publisher={arXiv},
    author={Haas, Max and Kaldenbach, Thierry N. and Hammerschmidt, Thomas and Barragan-Yani, Daniel}, 
    year={2026} 
} 

Acknowledgment

This project was made possible by the DLR Quantum Computing Initiative and the Federal Ministry for Economic Affairs and Climate Action; https://qci.dlr.de/quanticom.

Metadata

Release files for excitationsolve 2.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for excitationsolve 2.2.3
File Size Uploaded
excitationsolve-2.2.3.tar.gz 276.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for excitationsolve 2.2.3
File Interpreter ABI Platform
excitationsolve-2.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 309.3 kB

Release files / excitationsolve-2.2.3.tar.gz

Download URL excitationsolve-2.2.3.tar.gz
Size 276.0 kB
Tags Source
SHA-256 checksum
How to use checksums
67a5f794b8453b69d7b6ce31597490f0702ab79e88aef91f7692e5f1a50061b5
BLAKE2b-256 checksum
How to use checksums
04dfe6c710adfcf6ef292f90c40d1c5fab57ead3d269e804534ab66d3d61dc7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Release files / excitationsolve-2.2.3-py3-none-any.whl

Download URL excitationsolve-2.2.3-py3-none-any.whl
Size 33.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
46380d725c8c0dab2133c57b4de76b2266608b218d578a089218aac5c88cb828
BLAKE2b-256 checksum
How to use checksums
079a2842b255c63159b08f2f689a9c7497141facd1f27d5a6648271091aed7dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.0rc1

Release history Release notifications | RSS feed

2.5.0

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.5

2 release files

2.2.4

2 release files

This release

2.2.3 This release

2 release files

2.2.2

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.2

2 release files

2.1.1

2 release files

2.1.0

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page