-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Move Parameter classes from Python to Rust #14207
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
Conversation
One or more of the following people are relevant to this code:
|
There are some issues I'm feeling difficulty in solving with ParameterExpression implemented in Rust space.
|
I'm not sure I understand what your asking about here. Do you mean something like
I think this is probably fine, we have this limitation already for many things that get returned from circuits already. There might be a backwards compatibility concern here depending on exactly where this comes up. But if you write an upgrade release note documenting exactly what and how this is changing we can discuss the specifics during the full review. But in a lot of places tests that were doing
This isn't sufficient. The exact typing here is part of our API contract and doing |
I'm going to close this as #14757 just merged. That PR took this as a starting point and continued it so this has effectively merged. Thanks for all the work on this. |
Summary
This PR is follow up PR to #13278
This PR implements
ParameterExpression
class in Rust that has Python interface forParameter
,ParameterExpression
,ParameterVectorElement
Python classesDetails and comments
Rust's
ParameterExpression
is implemented as base class for Python'sParameter
,ParameterExpression
,ParameterVectorElement
classes, so that we can use Rust'sParameterExpression
data directly in other Rust codes.Python's
ParameterExpression
class is now a wrapper interface to Rust's implementation and that has set ofParameter
symbols to keep symbol objects to support comparing 2 Parameters byis
operation in some test cases.Now
ParameterExpression
does not haveqpy_replay
, but it can be built on the fly as needed by traversingSymbolExpr
. So we do not useSUBS
andGRAD
operations inqpy_replay
.