Skip to main content

ExcitationSolve: a fast globally-informed gradient-free optimizer for physically-motivated ansätze constructed of excitation operators

Project description

ExcitationSolve paper DOI

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

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
res = scipy.optimize.minimize(cost, params, method=optimizer)
energies = excsolve_obj.energies
counts = excsolve_obj.nfevs

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{Jaeger2024Fast,
    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},
}

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

excitationsolve-2.2.1.tar.gz (273.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

excitationsolve-2.2.1-py3-none-any.whl (32.1 kB view details)

Uploaded Python 3

File details

Details for the file excitationsolve-2.2.1.tar.gz.

File metadata

  • Download URL: excitationsolve-2.2.1.tar.gz
  • Upload date:
  • Size: 273.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for excitationsolve-2.2.1.tar.gz
Algorithm Hash digest
SHA256 4a534737a36ed1ea5c4a3f909fb3c341bf7f53eab6f4c2f384b6aa0b0738b66d
MD5 d2044e0fe1ab35719f60d0a244f0aafa
BLAKE2b-256 45907868e8b5422eaba23a9417f06887d9d02ce2bb939d33bef6d7e512199e1b

See more details on using hashes here.

File details

Details for the file excitationsolve-2.2.1-py3-none-any.whl.

File metadata

  • Download URL: excitationsolve-2.2.1-py3-none-any.whl
  • Upload date:
  • Size: 32.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.0rc1

File hashes

Hashes for excitationsolve-2.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 833a213dc3813b5215e076a37e3b0ad1c27703a9974fc0e6926654f9d6ecc53b
MD5 47777d7411e5e82b8f5792a26b9cf899
BLAKE2b-256 b146adb133d550b12bdfd08bb0b0e417cbcf380f8f584e381aafb0b418bf6aef

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page