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

Support parameter expression inheritance #11

Open
mstechly opened this issue May 3, 2024 · 0 comments
Open

Support parameter expression inheritance #11

mstechly opened this issue May 3, 2024 · 0 comments

Comments

@mstechly
Copy link
Contributor

mstechly commented May 3, 2024

In the current implementation when one defines an estimator for a non-leaf, one can use the inherited_params to pass input parameters down to the component's descendants. However, it would be nice if it was possible to pass down functions of input parameters as well.

For example, the QROM estimator must take the input parameters N and λ . However, the parameter that one wants to pass down to the select subcomponent is actually N / λ . This is can be currently achieved by passing down both N and λ and having select subroutine perform the necessary division. But since select shouldn't have any concept of N or λ , this is not an ideal solution.

This issue is to implement support of such parameter inheritance.

We will probably have to change the current inherited_params interface. Currently the format is a dictionary with the keys as the input parameter being inherited and the value as a list of places it will be inherited. However, I think this should instead be changed to a dictionary where the key is the parameter function expression (e.g. N/lambda) and the value be a list of locations of inheritance.

I think the best way to do this will be to introduce a function that implements any such function over the inherited parameters and then have the inheritor's function merged into this, thereby producing a new function over the parameters input to the expression.

(Originally by @sammorley-short )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant