This gives a python class (Pygen) which works with pointer to giac gen. There is a version for python and another one for sage.

The Giac/Xcas Forum is a good place to ask questions about giacpy.

**Sources of the python version :**tarballs and zip files of giacpy sources can be downloaded from the giacpy GIT repository

**Debian Packages**are avaible in Giac/Xcas debian repository:Chose python-giacpy for python2.x or python3-giacpy for Python3.

But if your python version/subversion is not supported in these debian package look here:

Some Linux binaries (ex: for python 3.5) The python version and subversion must match yours, and the architecture (32bits/64bits) too. The .whl or .tar.gz are just 2 different ways to distribute the same thing.

*To have graphic support, you
first need to build the* libqcas (qmake
libqcas.pro;make). *then on linux install
giacpy with:*

python
setup.py install ( *or
just build it with: ) *python
setup.py build_ext

*Choose the
appropirate version : On macosx 10.6 the default python version
is 2.6, and for osx 10.7 and 10.8 it is python 2.7. The .pkg files are macosx installer. They require adminitrator rights. If you can't install giacpy from the .pkg files, then you can consider giacpy.dmg. It is a portable version of giacpy and can be installed anywhere. But you will need to adjust your python path. Cf the README file in giacpy.app. *

**Windows binaries of giacpy are now avaible (as wheels) on Pypi**

*To install the giacpy wheel on windows from pypi:*

python.exe -mpip install giacpyNB: recent versions of giacpy are currently compiled without Qcas output for older windows binaries: (x86 Python win32) and (x86_64 Python win64)**.***To install giacpy on windows (old way), choose the version adapted to your python version (Python version,subversion and 32/64bits should match; example python 3.4 32bits) and install giacpy in the directory Lib/site-packages of your Python installation. If you are not allowed to do this, put giacpy anywhere and do as in exemple.py.*

NB: The french keywords might not be functional with the windows version of giacpy.

New style spkg of giacpy_sage:

Some differences with the python version of giacpy:

*Only:
Pygen,libgiac,giacsettings,loadgiacgen are exported by import *. (There are too
many words in sage that whould be overwriten. ex gcd...) *

*The qcas output,
htmlhelp are disabled. It has some extra features like Pygen gets
sage Integers directly from mpz_t, *

Warning. in sage the giac command calls the external giac program. To use this interface use libgiac.

Some Timings for Groebner Basis in sage with magma/giacpy and multithreading. and the sage worksheet

Groebner basis over QQ of cyclic9 in sage with giacpy and magma and the sage worksheet

*The magma 2.20-10 result was not imported in sage.*- The computation is around 7h or 8h of Wall time, but 49h of CPU time for giacpy.

- On a server with /home mounted via nfs, the giacpy result is saved to a 1.1G file in 28s, loaded in 68s, converted to a list of sage polynomials in 170s. The saved giacpy computation can be compared in sage with the magma result. (pdf or sage worksheet)

Other examples (including mod p) of groebner basis with giacpy from sage: A sage worksheet or the pdf screenshot)

*Ex Katsura12 mod 65521 takes 90s*

Formal determinant, libgiac magic mode examples and tests A sage worksheet or the pdf screenshot)

A non trivial determinantal relation in many variables A sage worksheet or the pdf screenshot)

Formal calculus and basic plots the sage worksheet or the pdf screenshot)

from
giacpy_sage import *

libgiac.ifactor(2**128+1)

x,y=libgiac('x,y')

cos(x+y).texpand()

n=9;R=PolynomialRing(QQ,n,'x');

I
= sage.rings.ideal.Katsura(R,n);

I.gens()

time B =
I.groebner_basis("libsingular:std") # to compute with
singular. about 18s on my notebook.

giacsettings.proba_epsilon=1e-15;

Igiac=libgiac(I.gens());

time
Bgiac=Igiac.gbasis([R.gens()],'revlex') # about 3s on my
notebook

simplify(Bgiac[-1]/B[0])

giacsettings.proba_epsilon=0;
# impose deterministic algorithm

Igiac=libgiac(I.gens());

time
Bgiac=Igiac.gbasis([R.gens()],'revlex') # about 25s on my
notebook

simplify(Bgiac[-1]/B[0]) # a big constant

sage setup.py install

sage
setup.py build_ext --inplace

and in sage do:

import
sys; sys.path.add('/home/fred/giacpy-sage')

from giacpy import
*

libgiac.ifactor(2^128+1)

Last modified: Sat Nov 19 18:08:28 CET 2016