All Projects → symengine → Symengine.jl

symengine / Symengine.jl

Licence: mit
Julia wrappers of SymEngine

Programming Languages

julia
2034 projects

Projects that are alternatives of or similar to Symengine.jl

Mppp
Multiprecision for modern C++
Stars: ✭ 196 (+41.01%)
Mutual labels:  math, computer-algebra
Mathnet Symbolics
Math.NET Symbolics
Stars: ✭ 256 (+84.17%)
Mutual labels:  math, computer-algebra
Oscar.jl
A comprehensive open source computer algebra system for computations in algebra, geometry, and number theory.
Stars: ✭ 182 (+30.94%)
Mutual labels:  math, computer-algebra
Reduce.jl
Symbolic parser generator for Julia language expressions using REDUCE algebra term rewriter
Stars: ✭ 172 (+23.74%)
Mutual labels:  math, computer-algebra
Symengine
SymEngine is a fast symbolic manipulation library, written in C++
Stars: ✭ 703 (+405.76%)
Mutual labels:  math, computer-algebra
symengine.rb
Ruby wrappers for SymEngine
Stars: ✭ 26 (-81.29%)
Mutual labels:  math, computer-algebra
Hecke.jl
Computational algebraic number theory
Stars: ✭ 142 (+2.16%)
Mutual labels:  math, computer-algebra
Angourimath
Open-source symbolic algebra library for C# and F#. One of the most powerful in .NET
Stars: ✭ 266 (+91.37%)
Mutual labels:  math, computer-algebra
Gap
Main development repository for GAP - Groups, Algorithms, Programming, a System for Computational Discrete Algebra
Stars: ✭ 447 (+221.58%)
Mutual labels:  math, computer-algebra
Grassmann.jl
⟨Leibniz-Grassmann-Clifford⟩ differential geometric algebra / multivector simplicial complex
Stars: ✭ 289 (+107.91%)
Mutual labels:  math, computer-algebra
Sage
Mirror of the Sage source tree -- please do not submit PRs here -- everything must be submitted via https://trac.sagemath.org/
Stars: ✭ 1,656 (+1091.37%)
Mutual labels:  math, computer-algebra
Sympy
A computer algebra system written in pure Python
Stars: ✭ 8,688 (+6150.36%)
Mutual labels:  math, computer-algebra
Symengine.py
Python wrappers for SymEngine
Stars: ✭ 110 (-20.86%)
Mutual labels:  math, computer-algebra
Dwsim5
DWSIM - Open Source Chemical Process Simulator (5.x series)
Stars: ✭ 120 (-13.67%)
Mutual labels:  math
Remark Math
remark and rehype plugins to support math
Stars: ✭ 129 (-7.19%)
Mutual labels:  math
Dmitrysengine
[abandoned] C99 cross-platform 3D game engine with absolute minimum of external dependencies
Stars: ✭ 119 (-14.39%)
Mutual labels:  math
The Math Behind A Neural Network
📄 The math behind the neural network used for Olivia
Stars: ✭ 119 (-14.39%)
Mutual labels:  math
Kalk
A calculator/expression evaluator written in rust that supports variables and functions.
Stars: ✭ 134 (-3.6%)
Mutual labels:  math
Polynomials.jl
Polynomial manipulations in Julia
Stars: ✭ 127 (-8.63%)
Mutual labels:  math
Roots.jl
Root finding functions for Julia
Stars: ✭ 118 (-15.11%)
Mutual labels:  math

SymEngine.jl

Build Status Build status Codecov Coveralls

SymEngine SymEngine

Julia Wrappers for SymEngine, a fast symbolic manipulation library, written in C++.

Installation

You can install SymEngine.jl by giving the following command.

julia> Pkg.add("SymEngine")

Quick Start

Working with scalar variables

Defining variables

One can define variables in a few ways. The following three examples are equivalent.

Defining two symbolic variables with the names a and b, and assigning them to julia variables with the same name.

julia> a=symbols(:a); b=symbols(:b)
b

julia> a,b = symbols("a b")
(a, b)

julia> @vars a b
(a, b)

Simple expressions

We are going to define an expression using the variables from earlier:

julia> ex1 = a + 2(b+2)^2 + 2a + 3(a+1)
3*a + 3*(1 + a) + 2*(2 + b)^2

One can see that values are grouped, but no expansion is done.

Working with vector and matrix variables

Defining vectors of variables

A vector of variables can be defined using list comprehension and string interpolation.

julia> [symbols("α_$i") for i in 1:3]
3-element Array{SymEngine.Basic,1}:
 α_1
 α_2
 α_3

Defining matrices of variables

Some times one might want to define a matrix of variables. One can use a matrix comprehension, and string interpolation to create a matrix of variables.

julia> W = [symbols("W_$i$j") for i in 1:3, j in 1:4]
3×4 Array{Basic,2}:
 W_11  W_12  W_13  W_14
 W_21  W_22  W_23  W_24
 W_31  W_32  W_33  W_34

Matrix-vector multiplication

Now using the matrix we can perform matrix operations:

julia> W*[1.0, 2.0, 3.0, 4.0]
3-element Array{Basic,1}:
 1.0*W_11 + 2.0*W_12 + 3.0*W_13 + 4.0*W_14
 1.0*W_21 + 2.0*W_22 + 3.0*W_23 + 4.0*W_24
 1.0*W_31 + 2.0*W_32 + 3.0*W_33 + 4.0*W_34

Operations

expand

julia> expand(a + 2(b+2)^2 + 2a + 3(a+1))
11 + 6*a + 8*b + 2*b^2

subs

Performs subsitution.

julia> subs(a^2+(b-2)^2, b=>a)
a^2 + (-2 + a)^2

julia> subs(a^2+(b-2)^2, b=>2)
a^2

julia> subs(a^2+(b-2)^2, a=>2)
4 + (-2 + b)^2

julia> subs(a^2+(b-2)^2, a^2=>2)
2 + (-2 + b)^2

julia> subs(a^2+(b-2)^2, a=>2, b=>3)
5

diff

Peforms differentiation

julia> diff(a + 2(b+2)^2 + 2a + 3(a+1), b)
4*(2 + b)

License

SymEngine.jl is licensed under MIT open source license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].