Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliasymbolics/symbolicutils.jl
Symbolic expressions, rewriting and simplification
https://github.com/juliasymbolics/symbolicutils.jl
julia pattern-matching symbolic-manipulation symbolic-math
Last synced: 6 days ago
JSON representation
Symbolic expressions, rewriting and simplification
- Host: GitHub
- URL: https://github.com/juliasymbolics/symbolicutils.jl
- Owner: JuliaSymbolics
- License: other
- Created: 2020-02-09T04:49:02.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2024-10-26T01:37:34.000Z (4 months ago)
- Last Synced: 2024-10-29T15:47:45.312Z (4 months ago)
- Topics: julia, pattern-matching, symbolic-manipulation, symbolic-math
- Language: Julia
- Homepage: https://docs.sciml.ai/SymbolicUtils/stable/
- Size: 5.54 MB
- Stars: 544
- Watchers: 18
- Forks: 114
- Open Issues: 159
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# SymbolicUtils.jl
[](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged)
[](https://docs.sciml.ai/SymbolicUtils/stable/)[](https://app.codecov.io/gh/JuliaSymbolics/SymbolicUtils.jl)
[](https://github.com/JuliaSymbolics/SymbolicUtils.jl/actions?query=workflow%3ACI)
[](https://buildkite.com/julialang/symbolicutils-dot-jl)[](https://github.com/SciML/ColPrac)
[](https://github.com/SciML/SciMLStyle)## Tutorials and Documentation
For information on using the package,
[see the stable documentation](https://docs.sciml.ai/SymbolicUtils/stable/). Use the
[in-development documentation](https://docs.sciml.ai/SymbolicUtils/dev/) for the version of
the documentation, which contains the unreleased features.SymbolicUtils.jl provides various utilities for symbolic computing. SymbolicUtils.jl is what one would use to build
a Computer Algebra System (CAS). If you're looking for a complete CAS, similar to SymPy or Mathematica, see
[Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl). If you want to build a crazy CAS for your weird
Octonian algebras, you've come to the right place.[Symbols in SymbolicUtils](https://docs.sciml.ai/SymbolicUtils/stable/#Creating-symbolic-expressions) carry type information. Operations on them propagate this information. [A rule-based rewriting language](https://docs.sciml.ai/SymbolicUtils/stable/manual/rewrite/) can be used to find subexpressions that satisfy arbitrary conditions and apply arbitrary transformations on the matches. The library also contains a set of useful [simplification](https://docs.sciml.ai/SymbolicUtils/stable/#Simplification) rules for expressions of numeric symbols and numbers. These can be remixed and extended for special purposes.
If you are a Julia package developer in need of a rule rewriting system for your own types, have a look at the [interfacing guide](https://docs.sciml.ai/SymbolicUtils/stable/manual/interface/#Interfacing-with-SymbolicUtils.jl).
### "I don't want to read your manual, just show me some cool code"
```julia
julia> using SymbolicUtilsjulia> SymbolicUtils.show_simplified[] = true
julia> @syms x::Real y::Real z::Complex f(::Number)::Real
(x, y, z, f(::Number)::Real)julia> 2x^2 - y + x^2
(3 * (x ^ 2)) + (-1 * y)julia> f(sin(x)^2 + cos(x)^2) + z
f(1) + zjulia> r = @rule sinh(im * ~x) => sin(~x)
sinh(im * ~x) => sin(~x)julia> r(sinh(im * y))
sin(y)julia> simplify(cos(y)^2 + sinh(im*y)^2, RuleSet([r]))
1
```# Citations
- The pattern matcher is an adaption of the one by Gerald Jay Sussman (as seen in [6.945](https://groups.csail.mit.edu/mac/users/gjs/6.945/) at MIT), his use of symbolic programming in the book [SICM](https://groups.csail.mit.edu/mac/users/gjs/6946/sicm-html/book.html) inspired this package.
- [Rewrite.jl](https://github.com/HarrisonGrodin/Rewrite.jl) and [Simplify.jl](https://github.com/HarrisonGrodin/Simplify.jl) by [Harrison Grodin](https://github.com/HarrisonGrodin) also inspired this package.