Qiskit / qiskit

Qiskit is an open-source SDK for working with quantum computers at the level of extended quantum circuits, operators, and primitives.
https://www.ibm.com/quantum/qiskit
Apache License 2.0
5.23k stars 2.36k forks source link

Decouple solvers from NaturalGradient class. #7588

Closed dlasecki closed 1 year ago

dlasecki commented 2 years ago

The NaturalGradient class from the Gradient framework (qiskit/opflow/gradients/natural_gradient.py) is strongly coupled with the logic of solvers that are used for solving systems of linear equations.

The goal of this issue is to decouple solvers from the NaturalGradient class and allow the class to accept a solver as an argument (or a method for solving SLEs).

This way, a user can provide their preferred method for solving SLEs. This change will allow the same for other features that use NaturalGradient, e.g. Variational Quantum Time Evolution algorithm. In certain scenarios, specific methods might expose numerical instability and therefore it would be reasonable to have flexibility to choose a different method.

ElePT commented 1 year ago

Given the gradient refactoring that has taken place + opflow deprecation, this issue has become out of date, so I think it can be safely closed.