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

Rule works with SymbolicUtils.jl but not Symbolics.jl #1175

Closed
dpsanders opened this issue Jun 23, 2024 · 3 comments · Fixed by #1176
Closed

Rule works with SymbolicUtils.jl but not Symbolics.jl #1175

dpsanders opened this issue Jun 23, 2024 · 3 comments · Fixed by #1176

Comments

@dpsanders
Copy link

The following example from the SymbolicUtils.jl docs works with @syms from SymbolicUtils, but returns empty when using @variables from Symbolics:

julia> using Symbolics

julia> @variables w z α::Real β::Real;

julia> r3 = @rule ~x * +(~~ys) => sum(map(y-> ~x * y, ~~ys));

julia> r3(2 * (w+w+α+β))
@dpsanders
Copy link
Author

r3(value(2 * (w+w+α+β))) works

@Vaibhavdixit02
Copy link
Collaborator

Vaibhavdixit02 commented Jun 23, 2024

With @variables you'd need to unwrap the expression. So this works r3(2 * (w+w+α+β) |> unwrap), which is the same as what you achieve with the value call on it

@ChrisRackauckas
Copy link
Member

Was simple enough to handle, might as well make it automatic.

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 a pull request may close this issue.

3 participants