#10571: print protocol of Groebner basis computations via Singular and Magma
-------------------------------+--------------------------------------------
   Reporter:  malb             |       Owner:  was            
       Type:  enhancement      |      Status:  needs_review   
   Priority:  major            |   Milestone:  sage-4.6.2     
  Component:  interfaces       |    Keywords:  magma, singular
     Author:  Martin Albrecht  |    Upstream:  N/A            
   Reviewer:                   |      Merged:                 
Work_issues:                   |  
-------------------------------+--------------------------------------------

Comment(by malb):

 With the attached patch, here's how Magma's output looks like:

 {{{
 #!python
 sage: P.<x,y> = GF(32003)[]
 sage: I = sage.rings.ideal.Katsura(P)
 sage: _ = I.groebner_basis('magma', prot=True)
 Append(~_sage_, 0);
 Append(~_sage_, 0);
 >>>_sage_[7]:=_sage_[8];
 _sage_[7]:=_sage_[8];
 >>>Append(~_sage_, 0);
 Append(~_sage_, 0);
 >>>_sage_[6]:=GroebnerBasis(_sage_[7]);
 _sage_[6]:=GroebnerBasis(_sage_[7]);
 Homogeneous weights search
 Number of variables: 2, nullity: 0
 Exact search time: 0.000
 Found best approx weight vector: [1 1]
 Norm: 2, count: 1
 Approx search time: 0.000
 ********************
 FAUGERE F4 ALGORITHM
 ********************
 Coefficient ring: GF(32003)
 Rank: 2
 Order: Graded Reverse Lexicographical
 NEW hash table
 Matrix kind: Modular FP
 Datum size: 4
 No queue sort
 Initial length: 2
 Inhomogeneous

 Initial queue setup time: 0.000
 Initial queue length: 1

 *******
 STEP 1
 Basis length: 2, queue length: 1, step degree: 2, num pairs: 1
 Basis total mons: 6, average length: 3.000
 Number of pair polynomials: 1, at 4 column(s), 0.000
 Average length for reductees: 3.00 [1], reductors: 3.00 [3]
 Symbolic reduction time: 0.000, column sort time: 0.000
 1 + 3 = 4 rows / 6 columns, 50% / 65% (3/r)
 Before ech memory: 7.8MB
 Row sort time: 0.000
 0.000 + 0.000 = 0.000 [1]
 Delete 1 memory chunk(s); time: 0.000
 Number of unused reductors: 1
 After ech memory: 7.8MB
 Queue insertion time: 0.000
 Step 1 time: 0.000, [0.000], mat/total: 0.000/0.000 [0.000], mem: 7.8MB

 Reduce 3 final polynomial(s) by 3
 1 redundant polynomial(s) removed; time: 0.000
 Interreduce 2 (out of 3) polynomial(s)
 Symbolic reduction time: 0.000
 Column sort time: 0.000
 2 + 0 = 2 rows / 4 columns, 62.5% / 75% (2.5/r)
 Row sort time: 0.000
 0.000 + 0.000 = 0.000 [2]
 Delete 1 memory chunk(s); time: 0.000
 Total reduction time: 0.000
 Reduction time: 0.000
 Final number of polynomials: 2

 Number of pairs: 1
 Total pair setup time: 0.000
 Max num entries matrix: 4 by 6
 Max num rows matrix: 4 by 6
 Total symbolic reduction time: 0.000
 Total column sort time: 0.000
 Total row sort time: 0.000
 Total matrix time: 0.000
 Total new polys time: 0.000
 Total queue update time: 0.000
 Total Faugere F4 time: 0.000, real time: 0.000
 >>>_sage_[7]:=0;
 _sage_[7]:=0;
 >>>
 }}}

 And Singular via pexpect (libsingular worked already):

 {{{
 #!python
 sage: _ = I.groebner_basis('singular', prot=True)
 1+1995986538;
 1995986539
 > def sage25=groebner(sage22);
 def sage25=groebner(sage22);
 std in (32003),(x,y),(dp(2),C)
 [4294967295:2]1s2s
 (S:1)-
 product criterion:1 chain criterion:0
 >
 }}}

 There's some crap surrounding the log, but this is already a big step up.
 Note that the update is also live. If we want we can write filter for
 Singular and Magma such that only the wanted lines are actually printed,
 but I think this should be left for another ticket. The attached patch
 also implements this:

 {{{
 #!python
 sage: from sage.interfaces.expect import StdOutContext
 sage: with StdOutContext(gp):
 ....:     gp('1+1')
 ....:
 sage=vector(1024,k,0);
 sage=vector(1024,k,0);
 ? sage[1]=1+1;
 sage[1]=1+1;
 ? print(sage[1])
 print(sage[1])
 2
 ? 2
 }}}

 which might be useful on its own.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10571#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to