Closed MilesCranmer closed 2 years ago
For example, this is SymbolicUtils.jl v0.6:
julia> SymbolicUtils.operation(x * x)
* (generic function with 444 methods)
Unfortunately, SymbllicUtils.jl bakes in some rules at the constructor level. So if you don’t want those rules, your only option is to roll your own types that don’t do those.
Is there a way I can manually create SymbolicUtils.jl types, rather than calling these auto-simplifying constructors? This would be good for me.
@shashi how hard would it be to support a @variables x::NoSimplifyReal
type?
Yeah I'm gonna add it soon -- have an issue here https://github.com/JuliaSymbolics/SymbolicUtils.jl/issues/340
I was wondering if there is a way to turn off automatic simplification? Perhaps there is something like #340 set up, also discussed in #327? cc @shashi @ChrisRackauckas @AlCap23
For example:
This automatic simplification seems to have broken SymbolicRegression.jl's simplification algorithm in the current SymbolicUtils.jl versions.
For example, if a user provides operators
(+, *, /, -)
, then it is impossible for me to convert the expression:back and forth between SymbolicRegression.jl and SymbolicUtils.jl. I can only go SymbolicRegression.jl => SymbolicUtils.jl, but not backwards.
What I did in previous versions of SymbolicUtils.jl was run
simplify()
as usual (defining a set of valid simplification rules given the operators, adding^
to their set), but then convertx ^ 2 => x * x
at the very end. However, it seems like I can no longer do this as even writingx * x
simplifies directly to a power. i.e., the algebra is no longer literal:I also tried this:
but the issue still occurs.
Is there anything I can do to prevent auto-simplification to operators I do not manually specify?
Thanks, Miles