-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Recursively get property downwards for Add
and Mul
#26538
Comments
Not only Add don't have There would be easy or more obvious answers, such as defining
It may be possible to override |
Some objects, like the ones from the
physics.quantum
submodule, contain properties like that yield a derived expression. However, this same property can't be accessed for a linear combination of these same objects.For example,
Suppose I create two
Ket
objects:Then, I could call the property$|1\rangle$ and $|2\rangle$ without a problem to generate bras from them:
dual
separately on ketsHowever, for any linear combination of$|1\rangle$ and $|2\rangle$ , that no longer works:
This forces the user to implement a recursive function to call
dual
on the expression on every new project. This also applies toexpr
fromphysics.quantum.state.Wavefunction
, for which I created a PR #26520 to temporarily solve it.The solution that I suggest is to "send" a property or method call down the expression tree whenever it is invalid for
Add
orMul
.The text was updated successfully, but these errors were encountered: