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

[from qiskit] AQGD optimizer groups objective funtion calls by default #50

Closed
ElePT opened this issue Aug 22, 2023 · 2 comments · Fixed by #116
Closed

[from qiskit] AQGD optimizer groups objective funtion calls by default #50

ElePT opened this issue Aug 22, 2023 · 2 comments · Fixed by #116
Assignees
Labels
bug Something isn't working

Comments

@ElePT
Copy link
Collaborator

ElePT commented Aug 22, 2023

What should we add?

Optimizers are normally expected to use the objective function to evaluate a single point being returned a single value. This is as per scipy optimizers, upon which several are based.

However it was recognized that optimizers computing gradient, say by finite diff, want to evaluate a set of points independently, to compute the gradient, and as such this was parallelizable which could help performance. To inform an optimizer that it was able to do this, ie ask the objective function for the values of a lits of points, where the objective function provided supported that, a max_grouped_evals flag could be set on the optimizer to a number bigger than the default of 1. In this case an optimizer could ask for a list of points and get a list of values back, though. Given the current optimizer spec this should only be done if max_grouped_evals allows it. However it seems a change, not too long ago, altered AQGD to do this by default which violates the current accepted spec we have for optimizers.

So either we change the spec, and require all objective functions to support a list in/out, which I do not think I am in favor of, or we correct AGQD to honor max_grouped_evals. The failure to conform was noted when Qiskit/qiskit#6299 was looked where there is a test with Aer which ends up using the Aer qobj re-parameterization in Circuit Sampler, since it passes in multiple values, and fails in the test when it was attempted to be converted to the newer backend interface.

@ElePT
Copy link
Collaborator Author

ElePT commented Aug 22, 2023

Opened by @woodsp-ibm
Original issue & discussion: Qiskit/qiskit#6305

@ElePT ElePT added the bug Something isn't working label Aug 22, 2023
@proeseler
Copy link
Contributor

I would like to work on changing this if someone else isn't already doing it. I've run into similar issues with AQGD a few times now and have had to do a manual assignment for the target function to resolve these issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants