giac/giacpy packages

112 views
Skip to first unread message

Han Frederic

unread,
Jun 21, 2015, 5:35:19 AM6/21/15
to sage-...@googlegroups.com
I'd like to point out that recently  http://trac.sagemath.org/ticket/12375
 was closed. I'd like also to thank here all the participants.

Since sage 6.8.beta5, giac and its cython interface giacpy are avaible as optional packages.

It provides interesting features in symbolic computations (gcd, factor, solving more inequalites)
and also in groebner basis computation:

Ex: I was able to compute a groebner basis over QQ of cyclic9 in 7h of wall time (but 49h of cpu time). (7h30 wall and cpu time with magma)
http://webusers.imj-prg.fr/~frederic.han/xcas/giacpy/index.html#cyclic9
the giacpy result was saved to a 1.1G file in 28s, loaded in 68s, converted to a list of sage polynomials in 170s.

computation of groebner basis over prime fields p<2**31 are also avaible:
Ex: Katsura12 mod 65521 took 90s with giacpy and 810s with libsingular.
http://webusers.imj-prg.fr/~frederic.han/xcas/giacpy/grobner-libgiac.pdf

Nicolas M. Thiery

unread,
Jun 22, 2015, 12:17:26 PM6/22/15
to sage-...@googlegroups.com
On Sun, Jun 21, 2015 at 02:35:19AM -0700, Han Frederic wrote:
> I'd like to point out that recently
> http://trac.sagemath.org/ticket/12375
> was closed. I'd like also to thank here all the participants.
> Since sage 6.8.beta5, giac and its cython interface giacpy are avaible
> as optional packages.

Nice! Thanks for the hard work!

> It provides interesting features in symbolic computations (gcd, factor,
> solving more inequalites)
> and also in groebner basis computation:
> Ex: I was able to compute a groebner basis over QQ of cyclic9 in 7h of
> wall time (but 49h of cpu time). (7h30 wall and cpu time with magma)

Impressive :-)

Kind regards,
Nicolas
--
Nicolas M. Thiéry "Isil" <nth...@users.sf.net>
http://Nicolas.Thiery.name/

Martin Albrecht

unread,
Jun 29, 2015, 9:11:33 AM6/29/15
to sage-...@googlegroups.com, Han Frederic


On Sunday 21 Jun 2015 02:35:19 Han Frederic wrote:
> I'd like to point out that recently http://trac.sagemath.org/ticket/12375
> was closed. I'd like also to thank here all the participants.
>
> Since sage 6.8.beta5, giac and its cython interface giacpy are avaible as
> optional packages.
>
> It provides interesting features in symbolic computations (gcd, factor,
> solving more inequalites)
> and also in groebner basis computation:
>
> Ex: I was able to compute a groebner basis over QQ of cyclic9 in 7h of wall
> time (but 49h of cpu time). (7h30 wall and cpu time with magma)
> http://webusers.imj-prg.fr/~frederic.han/xcas/giacpy/index.html#cyclic9
>
>
> * the giacpy result was saved to a 1.1G file in 28s, loaded in 68s,
> converted to a list of sage polynomials in 170s.*computation of groebner
> basis over prime fields p<2**31 are also avaible:
> Ex:
>
> *Katsura12 mod 65521 took 90s with giacpy and 810s with
> libsingular.http://webusers.imj-prg.fr/~frederic.han/xcas/giacpy/grobner-lib
> giac.pdf*

Very nice indeed.

Can we add a more convenient interface for computing Gröbner bases with Sage.
That is, I'd like to be able to say

I.groebner_basis('giac')

and be done with it :) I'm happy to help.

Cheers,
Martin

--
.www: https://martinralbrecht.wordpress.com
.pgp: 40BC 7F0D 724B 4AB1 CC98 4014 A040 043C 6532 AFB4
.xmpp: martinr...@jabber.ccc.de
.twitter: https://twitter.com/martinralbrecht
.keybase: https://keybase.io/martinralbrecht

Simon King

unread,
Jun 29, 2015, 10:59:30 AM6/29/15
to sage-...@googlegroups.com
Hi Martin,

On 2015-06-29, 'Martin Albrecht' via sage-devel <sage-...@googlegroups.com> wrote:
> Can we add a more convenient interface for computing Gröbner bases with Sage.
> That is, I'd like to be able to say
>
> I.groebner_basis('giac')
>
> and be done with it :) I'm happy to help.

If I understand correctly, we have two idioms for similar purposes:
- Obj.method(algorithm='bla') chooses the algorithm to be used for
comutation

- Obj = Foo(implementation='bar') chooses the implementation for the
object.

IIRC, we use the first idiom in the .groebner_basis() method already.
So, all what is left to do is add a new item to the case distinction
in that method.

Best regards,
Simon

Martin Albrecht

unread,
Jun 29, 2015, 11:19:26 AM6/29/15
to sage-...@googlegroups.com
Agreed, I was just hoping someone else would do the work for me :)

On Monday 29 Jun 2015 14:59:15 Simon King wrote:
> Hi Martin,
>
> On 2015-06-29, 'Martin Albrecht' via sage-devel <sage-

Han Frederic

unread,
Jun 29, 2015, 12:57:27 PM6/29/15
to sage-...@googlegroups.com
I can help also for the giacpy syntax.
We need 2 cases: only for grevlex, prime fields of char p< 2^31 or QQ
(I think that in other cases giac could be very bad)

may be the easiest for me is if you could start a branch with those 2 cases and some tags where I should insert the conversions and computations.
So that I will see quickly what files to modify

don't you mind?

Frederic

Han Frederic

unread,
Jun 29, 2015, 5:06:19 PM6/29/15
to sage-...@googlegroups.com
I think I can start something it looks to be in
src/sage/rings/polynomial/multi_polynomial_ideal.py
It may not be necessary to modify the cython interface for this.

best
Frederic

Martin Albrecht

unread,
Jun 30, 2015, 4:19:35 AM6/30/15
to sage-...@googlegroups.com
Hi,

I'd just add a function groebner_basis(F) to sage.libs.giac (or wherever the
Giac Cython interface lives) which takes a Sage sequence, computes a Gröbner
basis and returns a Sage sequence.

Integrating that into multi_polynomial_ideal.py is then very easy.

I've created

http://trac.sagemath.org/ticket/18824

Let's move this there.

Cheers,
Martin


On Monday 29 Jun 2015 14:06:19 Han Frederic wrote:
> I think I can start something it looks to be in
> src/sage/rings/polynomial/multi_polynomial_ideal.py
> <http://git.sagemath.org/sage.git/tree/src/sage/rings/polynomial/multi_polyn
> omial_ideal.py?id=c0e721783317f205106c9c3c552e366ce4e6c50e> It may not be
> necessary to modify the cython interface for this.
>
> best
> Frederic
Reply all
Reply to author
Forward
0 new messages