Releases: JuliaSymbolics/SymbolicUtils.jl
v4.2.1
v4.2.0
v4.1.1
SymbolicUtils v4.1.1
Merged pull requests:
- fix: fix
promote_symtypefor non-Arrayarrays (#803) (@AayushSabharwal)
v4.1.0
v4.0.0
SymbolicUtils v4.0.0
Breaking changes
SymbolicUtils has undergone a major refactor aimed at improving performance and type stability.
Use of Moshi.jl
The internal data structure for a BasicSymbolic is updated to use Moshi.jl for the sum type instead of Unityper. The type alias BasicSymbolic is still provided. The Moshi.Match.@match macro should be used to pattern match variants.
New variant structure
The following variants are retained from v3:
SymTermDiv
Add and Mul have been merged into one AddMul variant with the same structure. The field variant::AddMulVariant.T is used to differentiate between them. AddMulVariant is an enum from EnumX.jl. The old Pow term has been deprecated, and is replaced by a Term.
The Const variant has been added. Any constants (non-symbolic values) in expressions are now wrapped in a Const variant for type-stability. Thus, tree operations such as arguments, substitute will now return (arrays of) BasicSymbolic. The function unwrap_const can be used to obtain the value inside a Const. It acts as the identity function if given a non-Const value. Consts are printed in blue in the REPL, to avoid ambiguity with true literal values.
All variants now have a shape field. This allows first-class support for symbolic arrays. SymbolicUtils now implements an array algebra. Arrays of symbolics are now represented as a Term with hvncat as the operation. The shape of a symbolic or non-symbolic value can be obtained with the shape function. SymbolicUtils.promote_shape is a new interface function that returns the shape of the result of an operation, given the operation and the shape(s) of its argument(s).
The ArrayOp variant has been added to represent tensor-contraction-like operations. See the docstring for @arrayop for more information.
Change of symtype representation and new vartype
The symtype of a symbolic variable is no longer stored in type information. It is now present in the type field of a variant. This allows storing the entire tree in a type-stable manner and considerably improves inference and precompile-friendliness of symbolic code.
BasicSymbolic{T} is now used to represent the form of algebra to use when manipulating symbolic variables. T can take the following values:
SymReal: The default, expected form of symbolic algebra.SafeReal: Identical toSymReal, except that identical terms in the numerator and denominator of an expression are not cancelled.TreeReal: Does not assume associativity or commutativity of operations. All operations are represented using theTermstructure.
This is known as the vartype of a symbolic variable. Note that a tree must be pure - it cannot contain symbolic variables with different vartypes. The vartype can be specified in the @syms macro by using vartype=Value as the last argument to it. For example, @syms a b c vartype=SafeReal.
Removal of Symbolic
SymbolicUtils no longer allows defining custom Symbolic subtypes. The Symbolic type has been removed. This allows much greater performance by concretely typing the entire symbolic tree structure. As required, additional variants may be added to BasicSymbolic in the future.
Removal of PolyForm
PolyForm is now removed. The function to_poly! should be used to convert a symbolic tree into a DynamicPolynomials.Polynomial. The function from_poly provides the reverse transformation.
Merged pull requests:
- Fix interpolation into error message (#701) (@fkastner)
- refactor: revert
PolyformtoAddMul(#786) (@AayushSabharwal) - feat: support symbolic arrays (#789) (@AayushSabharwal)
- refactor: remove
issafecanon(#790) (@AayushSabharwal) - fix: fix
hashimplementation (#791) (@AayushSabharwal) - [WIP] feat: add
ArrayOp(#793) (@AayushSabharwal) - feat: V4 (#794) (@AayushSabharwal)
- fix: more test/bug fixes (#795) (@AayushSabharwal)
- fix: add missing compat entries (#797) (@AayushSabharwal)
v3.32.0
SymbolicUtils v3.32.0
Merged pull requests:
- [WIP] Commutative operations and negative exponent match in rules (#752) (@Bumblebee00)
- [WIP] feat: add
Constvariant (#761) (@AayushSabharwal) - feat: add
Polyformvariant, removeAddOrMul,Pow(#771) (@AayushSabharwal) - added functionality to return matches dictionary (#774) (@Bumblebee00)
- sped up matching process in the commutative_term_matcher (#779) (@Bumblebee00)
- refactor: use type tag instead of storing
symtypein type (#781) (@AayushSabharwal) - added defslot documentation to rewrite.md (#783) (@Bumblebee00)
- refactor: move some code around (#784) (@AayushSabharwal)
- Add comprehensive docstrings for core inspection functions (#788) (@ChrisRackauckas-Claude)
v3.31.0
SymbolicUtils v3.31.0
Merged pull requests:
- CompatHelper: bump compat for DataStructures to 0.19, (keep existing compat) (#758) (@github-actions[bot])
- fix: ensure equivalent expressions on different tasks are compared properly (#766) (@AayushSabharwal)
- fix: fix negative coefficient
Mulraised to fractional power (#770) (@AayushSabharwal) - Add comprehensive docstrings for all public API functions (#775) (@ChrisRackauckas-Claude)
Closed issues:
v3.30.0
SymbolicUtils v3.30.0
Merged pull requests:
- Refactor get_degrees() to make it faster (#732) (@alyst)
- first prototype of default value rules implemented (#749) (@Bumblebee00)
- fix issue #717 (#751) (@karlwessel)
- Grammar fix in error message on types.jl (#753) (@lukketotte)
- [WIP] refactor: move to Moshi (#754) (@AayushSabharwal)
- Fix backward compatibility for deprecated polynorm parameter in simplify() (#756) (@ChrisRackauckas)
- Fix spelling errors flagged by CI spell checker (#757) (@ChrisRackauckas)
- fix: fix ordering test with complex exponent (#762) (@AayushSabharwal)
- Simplify sqrt to ^(1//2) [Rebased #760] (#763) (@ChrisRackauckas)
- refactor: use new
WeakCacheSetfor hashconsing (#764) (@AayushSabharwal) - fixed typo in error message (#765) (@Bumblebee00)
- fix: fix codegen of single-element SArray of SArray (#767) (@AayushSabharwal)
- Revert "Simplify sqrt to ^(1//2) [Rebased #760]" (#768) (@AayushSabharwal)
Closed issues:
v3.29.0
v3.28.0
SymbolicUtils v3.28.0
Merged pull requests:
- fix: fix hashconsed ID collisions due to precompilation (#746) (@AayushSabharwal)
Closed issues:
- Generated functions no longer re-tracable with Symbolics (#544)