• Stars
    star
    172
  • Rank 214,244 (Top 5 %)
  • Language
    Julia
  • License
    Other
  • Created over 9 years ago
  • Updated about 3 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

language for symbolic mathematics

Symata.jl

Symbolic mathematics language

Linux, OSX: Build Status   Windows: Build Status       Coverage Status codecov.io

Examples and help

What is Symata?

  • a language for symbolic computations and mathematics, where, for the most part, "mathematics" means what it typically does for a scientist or engineer.

  • a language based mostly on expressions, on "evaluating" and rewriting them, like Wolfram, Maple, or Maxima. It is neither a language, nor an extension of a language, that is mostly procedural, or designed around data types and functions, or a hierarchy of classes, etc., like C or Python or Java. Nor is it language like Sage; that is, one meant to provide a unifying interface to a number of mathematics languages with various programming models.

  • meant to be useful to people who do not like to program computers, as well as those who do. The former includes people who prefer not to think about classes, methods, objects, dispatch, stack traces, etc.

Symata is largely modeled on the pattern matching and evaluation sequence of Mathematica. Evaluation, pattern matching, flow control, etc. are written in Julia. Much of the mathematics and symbolic manipulation is achieved by wrapping SymPy. There are more than 600 functions implemented, including integration, transformation of special functions, expression manipulation, writing and reading expressions to and from a file etc.

Installing

Symata is a registered module. It can be installed like this

(v0.7) pkg> add Symata
julia> using Symata
symata> Help()    # type '=' alone on a line to enter symata mode

Symata can be installed on Linux, OSX, and Windows.

Symata depends on the PyCall package and the python SymPy module. You can install SymPy via pip install sympy. Symata is compatible with SymPy v1.0 and v1.2 (and probably v1.1).

Alternatively, you may install SymPy via Conda.jl. When you load Symata with using Symata, sympy is installed automatically via PyCall, which uses Conda. However, to do this, PyCall must be configured to not use you system version of python. If you do not have PyCall installed, do this

julia> ENV["PYTHON"]=""
julia> Pkg.add("PyCall")

If you do have PyCall installed, but it is configured to use your system python, reconfigure it like this.

julia> ENV["PYTHON"]=""
julia> Pkg.build("PyCall")

If you use linux, you may have your distribution's sympy package installed and it may be out of date. In this case, try the procedure above, and/or try removing your distribution's sympy package.

note

SymPy, or sympy, here refers to the python SymPy distribution (sometimes called sympy), not the Julia package SymPy. Symata does not require the Julia package SymPy.jl, which has a different goal.

Symata requires mpmath package for python. This should be automatically installed when installing sympy via PyCall as described above. This also works on OSX. However, if you use pip, you should just be able to run pip install mpmath.

Running Symata

See below for instructions on precompiling Symata to get more-or-less instant start up and many precompiled function calls.

Three environments for running Symata are supported: the Julia REPL, Jupyter, and a dumb terminal.

Symata REPL mode

A Symata mode is added to the Julia REPL. Enter the mode by typing = as the first character. Exit the mode by typing backspace as the first character.

julia> using Symata

symata 1>     # after entering `=`

Under some circumstances, e.g. when using PackageCompiler, the Symata repl is not initialized after the module is loaded. You can initialize it with the exported Julia command run_repl. After this, the repl is entered with the = key. An executable ./scripts/symata is included. It is a (UNIX sh) shell script that just starts julia, loads the module, and enters Symata mode. There is also a script ./scripts/symatap for starting from an image with Symata precompiled. (See below.) Switch between Julia and Symata modes by typing =, or backspace, as the first character on a line. You can do tab completion to see a list of functions and symbols.

Jupyter / IJulia

In [1]:  using Symata

In [2]:  Expand((a+b)^2)

Out[2]:  a^2 + 2a*b + b^2

In [3]:  Julia()   # return to Julia mode

In Jupyter, the Symata expressions In(n) and Out(n) reevaluate the input and output cells. TAB completion works in Jupyter. To see a list of all possible completions, type *[TAB].

Dumb terminal

If you do using Symata in a dumb terminal, the Symata prompt should appear automatically.

sympy shell

From the julia prompt, type isympy() to enter the sympy shell.

NEW! Instant Symata

You can precompile Symata. It will load very quickly and be generally much more responsive. The script ./scripts/gen_compile_symata.sh writes a Julia image. The shell script ./scripts/symatap runs Julia with this image and immediately enters the Symata repl. See the contents of these files if you can't run shell scripts on your platform.

Instant Symata with Jupyter

You can install a Jupyter kernel using the precompiled image. You must not insert any whitespace between -J and the path to the image.

julia> using IJulia
julia> installkernel("Symata", "-J/home/username/path/to/symataimage.so")

Tests

Run the test suite from the symata prompt with Tests(). This runs tests in the symata_test directory Pkg.test("Symata") runs the same test suite from Julia and some Julia-level unit tests, as well.

More Repositories

1

JuliaQuantumInformation

List of quantum information and computation projects in Julia
52
star
2

ManualDispatch.jl

Avoid method dispatch at runtime
Julia
39
star
3

EmpiricalCDFs.jl

Online empirical cumulative distribution functions
Julia
33
star
4

SymataSyntax.jl

Mathematica syntax for Symata.jl
Julia
13
star
5

julia_project

Manage a Julia project living within a Python package
Python
13
star
6

ZChop.jl

replace small numbers with zero
Julia
13
star
7

qinf

Quantum information library for Maxima
Common Lisp
11
star
8

PrimeSieve.jl

fast generation and counting of primes
Julia
10
star
9

IsApprox.jl

Interface for approximate and exact equality
Julia
10
star
10

StreamToString.jl

redirect stdout and stderr to a string in Julia
Julia
6
star
11

pika-asynchronous-consumer

asynchronous RabbitMQ consumer
Python
6
star
12

FileCmp.jl

Compare two files byte by byte
Julia
6
star
13

PDL-IO-Matlab

Reading and writing matlab format data files for the perl data language.
C
5
star
14

IdentityMatrix.jl

efficient methods for identity matrices
Julia
4
star
15

ranwalk-Julia-vs-Cxx

Compare speed of Julia and C++-11 for random walk simulations
C++
4
star
16

CachePath.jl

Allow caching precompiled Julia code in a specified directory
Julia
3
star
17

Qurt.jl

Qiskit compatible circuit manipulation in Julia
Julia
3
star
18

PDL-DSP-Windows

Signal processing window functions for PDL
Perl
3
star
19

PDL-Fit-Levmar

PDL interface to constrained Levenberg-Marquardt library levmar
C
3
star
20

openqasm-rust

QASM 3.0 parser for the Rust langauge
Rust
3
star
21

DeepConvert.jl

Convenient literal expressions for large numbers
Jupyter Notebook
3
star
22

MaximumLikelihoodPower.jl

Maximum Likelihood Estimate for power laws
Julia
3
star
23

BlockEnums.jl

Like Enums but with more features
Julia
3
star
24

VoronoiCells.jl

Work with Voroni cells of a point process
Julia
3
star
25

DictTools.jl

Improvements on standard dict tools in julia
Julia
2
star
26

mixima

Compatibility tools for porting from Mathematica to Maxima
Common Lisp
2
star
27

SocialNet.jl

Simplified Social Network
Julia
2
star
28

MethodInSrc.jl

Test whether a call is dispatched to a method in your module
Julia
2
star
29

PermPlain.jl

Permutations of integers
Julia
2
star
30

gjlcxx_util

c++ templates for physics simulations and sundry
C++
2
star
31

diffeq_julia

alternative packaging of diffeqpy
Python
2
star
32

mext

Package management and packages for Maxima (the CAS)
Common Lisp
2
star
33

QuantumGlue.jl

Convert types between quantum packages
Julia
1
star
34

TupleArrays.jl

a lot like StructArrays
Julia
1
star
35

SampleShots.jl

experiments with shot sampling
Julia
1
star
36

PDL-StatPhys-Cluster

cluster counting routine for statistical physics (biology,...) 2-d site model
Perl
1
star
37

RowTables.jl

Data table with row-wise storage
Julia
1
star
38

hexdens

create density plots on a triangular or square lattice
Perl
1
star
39

vigenere-crack

program to encode decode decrypt vigenere cipher
Perl
1
star
40

clevo-xsm-wmi

Kernel module for keyboard backlighting of Clevo SM series notebooks. (And several EM/ZM/DM series models)
C
1
star
41

BitsX.jl

bit manipulation and static bit vectors
Julia
1
star
42

Rotate.jl

Cyclic assignment
Julia
1
star
43

ControlFlow.jl

Some constructs for control flow
Julia
1
star
44

msieve-shared

shared library version of msieve
C
1
star
45

PDL-DSP-Iir

Infinite impulse response and recursive filters
Perl
1
star
46

prime-pi-maxima

prime counting function for maxima, the CAS
Common Lisp
1
star
47

CBOOCall.jl

The way of CBOO for Julia
Julia
1
star
48

GraphsExt.jl

Some types and functions that could be in Graphs.jl
Julia
1
star