PyGiNaC is a Python package that provides an interface to C++ library GiNaC - GiNaC is Not a CAS. GiNaC is open framework for symbolic computation within the C++ programming language. See GiNaC tutorial for more information about GiNaC capabilities and limitations.
Currently PyGiNaC exposes the following GiNaC classes to Python:
symbol
numeric
constant
add, mul, power,
ncmul
matrix
pseries
relational
function
lst
indexed,
idx, etc. will be wrapped soon.
All GiNaC's symbolic classes are exposed to Python through a light-weighted
wrapper class ex.
Currently PyGiNaC lacks tutorial for Python users. But to get started, see GiNaC tutorial and doctest strings in ginac.doc.html.
To install PyGiNaC, unpack the source file, change to directory PyGiNaC-?.?.? and
run python setup4.py install.
To test PyGiNaC, run cd test4 && python test_all.py.
PyGiNaC is developed on Intel Linux (Debian Potato,
Redhat Mandrake 7.0) with gcc
(2.95.2) compiler. If you are able to build GiNaC and CLN then there
should be no problems to compile and use PyGiNaC.
Target Python version is currently 2.1.
[Applies only for PyGiNaC-0.4:]
PyGiNaC compiles also for Python 2.0 but be aware that
due to the changes of coersion rules in Python 2.1 incorrect behaviour
is expected when using it with Python 2.0.
For example, multiplication a * b of symbolic objects is carried
out in Python 2.0 as b.__mul__(a) (for some reasons that I don't
understand). This will affect results where multiplication is
non-commutative, for example, matrix multiplication.
[This is fixed now for Python 2.0 and earlier, but there are no guarantees.]
[Applies only for PyGiNaC-0.4:]
To compile PyGiNaC for Python 1.5, change to directory
PyGiNaC-?.?.?/python1.5, run make install
(if that fails, study Makefile and change it to your
needs). Note that in Python 1.5 user-defined symbolic
functions are not supported (but it is not impossible to use
them under Python 1.5, study ginac.build_function() and
try to adapt its Python 2.1 code to Python 1.5).
PyGiNaC is being developed under
CVS and those who are
interested in the really latest version of PyGiNaC (possibly
unstable) can get it from the repository as follows:
guest):
> cvs -d :pserver:anonymous@cens.ioc.ee:/home/cvs login
> cvs -z6 -d :pserver:anonymous@cens.ioc.ee:/home/cvs checkout pyGiNaC
pyGiNaC you can get the updates by hitting
> cvs -z6 update -P -d
PyGiNaC CVS repository here.