Symbolica 2.0: Programmable Symbols for Python and Rust
Symbolica 2.0 launches with "programmable symbols," a significant upgrade to its high-performance symbolic computation framework for Python and Rust. This release focuses on user customization for mathematical objects and boasts substantial performance improvements, making complex algebraic manipulation and numerical evaluation more ergonomic and efficient. Developers are taking notice of its advanced capabilities for generating fast numerical kernels and its innovative approach to type-erased evaluation callbacks.
The Lowdown
Symbolica 2.0 is a major release for the high-performance symbolic computation framework, designed for Python and Rust. The core theme of this update is "programmable symbols," allowing users unprecedented control to customize how mathematical objects behave, including simplification, differentiation, expansion, and evaluation. This empowers users to define custom mathematical objects that integrate seamlessly into the framework's existing capabilities.
Key enhancements and features in Symbolica 2.0 include:
- Programmable Symbols: Users can now install custom hooks for normalization, printing, derivatives, series expansion, and numerical evaluation, significantly extending the framework's flexibility.
- Improved Rust API: The Rust API has been refined for better ergonomics, reducing boilerplate with a new prelude, more operator overloading, builder-style APIs, and clearer error handling.
- Advanced Evaluators: Expression evaluation has received substantial engineering, including JIT compilation (via
symjit) which is now the default for Python, and a new double-float arithmetic path offering 106 bits of precision while maintaining performance. - Expanded Mathematical Vocabulary: Symbolica now supports a wider range of built-in special functions like polygamma, polylogarithms, Bessel functions, and Riemann zeta, complete with evaluation hooks and series behavior around poles.
- Performance Gains: Significant under-the-hood improvements to expression manipulation, such as optimized pattern matching, term sorting, and polynomial GCD computations, have led to performance increases ranging from 2x to 10,000x.
- Better Output: New features like automatic line-wrapping with colorized brackets, colorful HTML output for notebooks, and Typst output enhance readability and integration with documentation tools.
- AI Integration: The author shares insights into how AI tools were used during development, noting their value for large refactors and peripheral tasks, though critical code and complex debugging still require manual oversight.
This release solidifies Symbolica's position as a powerful tool for converting symbolic expressions into highly optimized numerical kernels, making it invaluable for tasks like Jacobian computation, numerical optimization, and integration, with a strong focus on user programmability and high performance.