Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify callback signatures in qiskit.algorithms.optimizers #10109

Closed
Cryoris opened this issue May 13, 2023 · 1 comment
Closed

Unify callback signatures in qiskit.algorithms.optimizers #10109

Cryoris opened this issue May 13, 2023 · 1 comment
Labels
mod: algorithms Related to the Algorithms module type: feature request New feature or request

Comments

@Cryoris
Copy link
Contributor

Cryoris commented May 13, 2023

What should we add?

As previously already discussed eg. in #8628 (comment), it would be great it all Qiskit Optimizers have the same signature for the callback function.

The callback function allows to pass back information on the state of the optimization to the user during the optimization. This is useful to track additional information like the optimization history or to check whether the optimization is converging. However, currently each optimizer has it's own signature on the callback, which makes it difficult to write modular code. It would be great it they had consistent signature, such as:

callback(current_parameters, optimizer_state)

The current parameters are known to each optimizer (also the SciPy optimizers) and additional information could be stored in an optimization state, such as introduced in https://github.com/Qiskit/qiskit-terra/blob/5177db6e09917809895fe37878422ba8fcb6321a/qiskit/algorithms/optimizers/gradient_descent.py#L28

@Cryoris Cryoris added the type: feature request New feature or request label May 13, 2023
@woodsp-ibm woodsp-ibm added the mod: algorithms Related to the Algorithms module label May 15, 2023
@Cryoris Cryoris added this to the 0.25.0 milestone May 17, 2023
@mtreinish mtreinish removed this from the 0.25.0 milestone Jul 19, 2023
@ElePT
Copy link
Contributor

ElePT commented Aug 22, 2023

Transferred to new repo: qiskit-community/qiskit-algorithms#60

@ElePT ElePT closed this as not planned Won't fix, can't repro, duplicate, stale Aug 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: algorithms Related to the Algorithms module type: feature request New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants