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

CeresMinimizer from bqskitrs requires num_residuals, which is neither documented nor properly implemented in the Python code #264

Open
WolfLink opened this issue Jul 22, 2024 · 1 comment · May be fixed by #268
Labels
bug Something isn't working documentation Improvements or additions to documentation

Comments

@WolfLink
Copy link
Collaborator

CeresMinimizer from bqskitrs makes a call to num_residuals on DifferentiableResidualsFunction objects. The string num_residuals is not present anywhere in the Python bqskit repo, making it unclear that this is a requirement for DifferentiableCostFunction.

Also HilbertSchmidtResiduals does not implement num_residuals, which is problematic for what I am trying to do (I'm writing a residuals function that modifies another residuals function).

@WolfLink WolfLink added bug Something isn't working documentation Improvements or additions to documentation labels Jul 22, 2024
@WolfLink
Copy link
Collaborator Author

A workaround I have come up with: a wrapper class that implements num_residuals by saving the parameters from the circuit passed in gen_cost, passing those parameters to get_residuals, and counting the number of residuals that come out of it.

@edyounis edyounis linked a pull request Aug 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant