Symbolics.jl
StaticArrays.jl
Symbolics.jl | StaticArrays.jl | |
---|---|---|
13 | 6 | |
1,291 | 738 | |
1.0% | 1.1% | |
9.4 | 7.6 | |
5 days ago | 25 days ago | |
Julia | Julia | |
GNU General Public License v3.0 or later | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Symbolics.jl
- Symbolics.jl
-
What packages would you like Julia to have?
It’s not up to parity with SymPy/Matlab by far yet - here’s the tracking issue on it https://github.com/JuliaSymbolics/Symbolics.jl/issues/59
- Converting Symbolics.jl Objects to SymPy.jl Objects
-
Error With StaticArrays Module & Symbolics.jl
Hello Juila Community. This is my second day working with Julia, having come over from Sympy due to performance reasons. I am working on a project that requires calculating matrix determinants and adjugates for families of matrices with symbolics entries. I am using Symbolics.jl for the symbols and using Juilia 1.8.2.
- ModelingToolkit over Modelica
-
A Mature Library For Symbolic Computation?
After spending some time reading the documentation, it turns out that JuliaSymbolics also lacks factorizations functionality (according to [Link](https://github.com/JuliaSymbolics/Symbolics.jl/issues/59))
-
Looking for numerical/iterative approach for determining a value
You can also get an expression for the partial of β with respect to h using Symbolics.jl:
-
In 2022, the difference between symbolic computing and compiler optimizations will be erased in #julialang. Anyone who can come up with a set of symbolic mathematical rules will automatically receive an optimized compiler pass to build better code
The example is applied to the right-hand side of a generated mass-matrix ODE (DAE) which is then solved using the adaptive time stepping methods of DifferentialEquations.jl. It's a test example that comes from the robotics / rigid body dynamics simulation groups (specifically interested in control) where they before were generating the governing equations with SymPy, and recently switched to try Symbolics.jl (and we got the example because of some performance issues that needed fixing). The comparison is with and without applying the code simplifier before solving. The table shows an average global induced error of 1e-12 when chopping off the 1e-11 * sin(x) terms and smaller. Thus there's nothing "competitive" against standard adaptive time stepping here: it's used to enhance the simulation of generated models that are simulated with the adaptive time steppers.
- From Julia to Rust
-
Fractions in Julia Symbolics
Done. https://github.com/JuliaSymbolics/Symbolics.jl/issues/215
StaticArrays.jl
- How to efficiently get the i-th element of every matrix in an array?
-
Error With StaticArrays Module & Symbolics.jl
Performance is already 100 times faster than Sympy, but I was running into slowdowns computing the adjugate of the matrices I'm working with. I turned to the StaticArrays.jl module, which did speed up performance, but threw an error at me when the matrix in question went from a 4x4 to a 5x5. Here is the code used to generate the matrices:
-
An optimization story
I know this is the Rust subreddit, but I have to ask if you considered Julia? It seems purpose-built for what you're trying to do. It has built-in multidimensional arrays which are significantly more ergonomic to use than either Python or Rust, and because of the way the type system works there are tons of specialized array types you can use with optimized operations (and writing your own is quite easy). In particular you might be interested in StaticArrays.jl which if your arrays have a known, small size at compile-time can give a massive speedup by essentially automatically doing many of the optimizations you did by hand. They show a 25x speedup on eigendecompositions for a 3x3 matrix on their microbenchmark.
-
Easy things to implement to optimize code?
Use StaticArrays.jl instead of the built-in Array whenever you need some statically sized array/matrix.
-
From Julia to Rust
2. Persistent data structures as found in most FP languages.
Note how neither of these capture the large, (semi-)contiguous array types used for most numerical computing. These arrays are only "easier to optimize" if one has a Sufficiently Smart Compiler to work with. Here we don't even need to talk about Julia: the reason even Numba kernels in Python land are written in a mutating style is because such a compiler does not exist. You may be able to define something for a limited subset of programs like TensorFlow does, but the moment you step outside that small closed world you're back to needing mutation and loops to get a reasonable level of performance. What's more, the fancy ML graph compiler (as well as Numpy and vectorized R) is dispatching to C++/Fortran/CUDA routines that, not surprisingly, are also loop-heavy and mutating.
Should Julia do a better job of trying to optimize non-mutating array operations? Most definitely. Is this a hard problem that has consumed untold FAANG developer hours [2] and spawned an entire LLVM subproject [3] to address it? Also yes.
> The iteration protocol can be made more memory-efficient for large collections and simpler...
Yup, this has been a consistent bugbear of the core team as well. The JuliaFolds ecosystem [4] offers a compelling alternative with fusion, automatic parallelism, etc. in line with that blog post (which, I should note, is a much different beast from Rust's iterator interface/Rayon), but it doesn't seem like the API will be changing until a breaking language release is planned.
> In general, systems languages don't make language decisions lightly. They have committees, discuss how other languages do things, make proposals. This allows more perspectives on each decision. That would be an improvement over the more ad-hoc style of Julia development, as long as Julia can avoid adding every possible feature, which is a risk of expanding the decision-making body.
I'd argue this is a property of mature, widely used languages instead of systems languages. Python, Ruby, JS, PHP, C# and Java are all examples of "non-systems" languages that do everything you list, while Nim and Zig (note: both less well adopted) are examples of "systems" languages that don't have such a formalized governance model.
Julia (along with Elixir) are somewhere in between: All design talk and decision making is public and relatively centralized on GitHub issues. There is no fixed RFC template, but proposals go through a lot of scrutiny from both the core team and community, as well as at least one round of a formal triage (run by the core team, but open to all). Any changes are also tested for backwards compat via PkgEval, which works much like Crater in Rust. There was a brief effort to get more structured RFCs [5], but I think it failed because the community just isn't large enough yet. Note how all the languages with a process like this are a) large, and b) developed it organically as the userbase grew. In other words, you'll probably see something similar pop up when the time savings provided by a more structured/formal process outweighs the overhead of additional formalization.
[1] https://github.com/JuliaArrays/StaticArrays.jl
-
Is there a reason type constraints can't be applied to value-types?
If you want to lift your value into the type domain, you may be able to use value-types, like Val(2). If you are interested in seeing how to use value-type parameters efficiently, https://github.com/JuliaArrays/StaticArrays.jl does that to great effect.
What are some alternatives?
julia - The Julia Programming Language
JET.jl - An experimental code analyzer for Julia. No need for additional type annotations.
Octavian.jl - Multi-threaded BLAS-like library that provides pure Julia matrix multiplication
ModelingToolkit.jl - An acausal modeling framework for automatically parallelized scientific machine learning (SciML) in Julia. A computer algebra system for integrated symbolics for physics-informed machine learning and automated transformations of differential equations
Catlab.jl - A framework for applied category theory in the Julia language
fricas - Official repository of the FriCAS computer algebra system
SumTypes.jl - An implementation of Sum types in Julia
Dagger.jl - A framework for out-of-core and parallel execution
glow - Compiler for Neural Network hardware accelerators
egg - egg is a flexible, high-performance e-graph library