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

simplify removes metadata on certain terms created by substitution #576

Closed
hexaeder opened this issue Apr 21, 2022 · 1 comment
Closed

Comments

@hexaeder
Copy link
Contributor

hexaeder commented Apr 21, 2022

MWE

import Pkg; Pkg.activate(temp=true); Pkg.add("Symbolics")
using Symbolics

@variables t a(t) b(t) c(t) d(t)
term1 = a - c - d |> Symbolics.unwrap
term2 = substitute(a - b, b=>c + d) |> Symbolics.unwrap

term1s = simplify(term1)
term2s = simplify(term2)

Symbolics.metadata.(Symbolics.get_variables(term1))
Symbolics.metadata.(Symbolics.get_variables(term2))
Symbolics.metadata.(Symbolics.get_variables(term1s))
Symbolics.metadata.(Symbolics.get_variables(term2s)) # all metadata gone!

The only difference between term1 and term2 i found is that term 1 creates a + operation with 3 arguments. Term 2 on the other hand is a + with two arguments, one of which is a + operation itself.

This might be related to JuliaSymbolics/SymbolicUtils.jl#434.

Sorry the ecosystem is moving to fast for me to follow closely, I am not sure whether this should go to Symbolics, SymbolicUtils or MetaTheory.

@hexaeder
Copy link
Contributor Author

hexaeder commented Sep 4, 2024

mwe works now

@hexaeder hexaeder closed this as completed Sep 4, 2024
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

No branches or pull requests

1 participant