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

feat: lambdify with common sub-expressions #374

Merged
merged 1 commit into from Dec 6, 2021
Merged

Conversation

redeboer
Copy link
Member

@redeboer redeboer commented Dec 6, 2021

See cse argument in sympy.lambdify(). This fixes #345 (comment).

Note that lambdified source code becomes significantly smaller in larger expressions. Finding common sub-expressions has a small hit in performance when lambdifying, but in larger expressions, this is overcome by the fact that the output source code is smaller.

@redeboer redeboer added this to the 0.4.0 milestone Dec 6, 2021
@redeboer redeboer self-assigned this Dec 6, 2021
@redeboer redeboer merged commit 7e2c2af into ComPWA:main Dec 6, 2021
@redeboer redeboer deleted the cse branch December 6, 2021 11:24
redeboer added a commit to redeboer/ComPWA-tensorwaves that referenced this pull request Dec 6, 2021
Fix-up to ComPWA#374

Additional fixes:
* Enforce specifying use_cse in hidden functions.
* Remove `**kwargs` from lambdify functions. This helps mypy/pyright
  identify whether functions calls miss certain arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant