Opened 9 years ago
Closed 9 years ago
#10571 closed enhancement (fixed)
print protocol of Groebner basis computations via Singular and Magma
Reported by: | malb | Owned by: | was |
---|---|---|---|
Priority: | major | Milestone: | sage-4.6.2 |
Component: | interfaces | Keywords: | magma, singular |
Cc: | wjp | Merged in: | sage-4.6.2.alpha4 |
Authors: | Martin Albrecht | Reviewers: | Marshall Hampton |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
It would be nice if this would work:
sage: P.<x,y,z> = GF(32003)[] sage: I = sage.rings.ideal.Katsura(P) sage: _ = I.groebner_basis('magma', prot=True) Homogeneous weights search Number of variables: 3, nullity: 0 Exact search time: 0.000 Found best approx weight vector: [1 1 1] Norm: 3, count: 1 Approx search time: 0.000 ******************** FAUGERE F4 ALGORITHM ******************** Coefficient ring: GF(32003) Rank: 3 Order: Graded Reverse Lexicographical NEW hash table Matrix kind: Modular FP Datum size: 4 No queue sort Initial length: 3 Inhomogeneous Initial queue setup time: 0.000 Initial queue length: 2 ******* STEP 1 Basis length: 3, queue length: 2, step degree: 2, num pairs: 2 Basis total mons: 11, average length: 3.667 Number of pair polynomials: 2, at 8 column(s), 0.000 Average length for reductees: 3.50 [2], reductors: 4.00 [4] Symbolic reduction time: 0.000, column sort time: 0.000 2 + 4 = 6 rows / 10 columns, 38.333% / 52.487% (3.8333/r) Before ech memory: 7.8MB Row sort time: 0.000 0.000 + 0.000 = 0.000 [2] 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 ******* STEP 2 Basis length: 5, queue length: 1, step degree: 3, num pairs: 1 Basis total mons: 19, average length: 3.800 Number of pair polynomials: 1, at 6 column(s), 0.000 Average length for reductees: 4.00 [1], reductors: 4.00 [4] Symbolic reduction time: 0.000, column sort time: 0.000 1 + 4 = 5 rows / 8 columns, 50% / 67.429% (4/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 After ech memory: 7.8MB Queue insertion time: 0.000 Step 2 time: 0.000, [0.001], mat/total: 0.000/0.000 [0.001], mem: 7.8MB ******* STEP 3 Basis length: 6, queue length: 1, step degree: 4, num pairs: 1 Basis total mons: 23, average length: 3.833 Number of pair polynomials: 1, at 6 column(s), 0.000 Average length for reductees: 4.00 [1], reductors: 4.00 [6] Symbolic reduction time: 0.000, column sort time: 0.000 1 + 6 = 7 rows / 9 columns, 44.444% / 63.243% (4/r) Before ech memory: 7.8MB Row sort time: 0.000 0.000 + 0.000 = 0.000 [0] Delete 1 memory chunk(s); time: 0.000 After ech memory: 7.8MB Queue insertion time: 0.000 Step 3 time: 0.000, [0.000], mat/total: 0.000/0.000 [0.001], mem: 7.8MB Reduce 6 final polynomial(s) by 6 2 redundant polynomial(s) removed; time: 0.000 Interreduce 4 (out of 6) polynomial(s) Symbolic reduction time: 0.000 Column sort time: 0.000 4 + 0 = 4 rows / 8 columns, 50% / 68.452% (4/r) Row sort time: 0.000 0.000 + 0.000 = 0.000 [4] Delete 1 memory chunk(s); time: 0.000 Total reduction time: 0.000 Reduction time: 0.000 Final number of polynomials: 4 Number of pairs: 4 Total pair setup time: 0.000 Max num entries matrix: 7 by 9 Max num rows matrix: 7 by 9 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.001
It would also be nice if the protocol is printed live, i.e. whenever Magma prints a new line it is immediately displayed by Sage.
Attachments (1)
Change History (20)
comment:1 Changed 9 years ago by
- Description modified (diff)
- Status changed from new to needs_review
comment:2 Changed 9 years ago by
comment:3 Changed 9 years ago by
The updated patch provides the following functionality:
Pretty printing for Singular logs
sage: P.<x,y> = GF(32003)[] sage: I = sage.rings.ideal.Katsura(P) sage: _ = I.groebner_basis('magma', prot="sage") _ = I.groebner_basis('singular', prot="sage") Leading term degree: 1. Leading term degree: 2. Highest degree reached during computation: 2.
And degree bounds for Magma:
sage: P.<x,y,z,a,b,c,w> = GF(32003)[] sage: I = sage.rings.ideal.Cyclic(P) sage: gbM = I.groebner_basis('magma', deg_bound=3) sage: gbM [y*z^2 - y*z*a + z^2*a + z*b*c - a*b*c - z^2*w - z*b*w + a*b*w + y*c*w + z*c*w + a*c*w + b*c*w + c^2*w - y*w^2 - 2*z*w^2 - a*w^2 - b*w^2 + c*w^2 - w^3, y^2 + y*a - z*a + y*b - a*b + y*c - b*c + 2*y*w + z*w + a*w + b*w + w^2, x + y + z + a + b + c + w]
comment:4 Changed 9 years ago by
This ticket depends on #1396.
comment:5 Changed 9 years ago by
Fixed parsing of 'std' logs.
comment:6 Changed 9 years ago by
- the patch depends on #9599
- the updated patch also parses Magma output.
comment:7 Changed 9 years ago by
Turns out 'slimgb' might print insufficient information for prot='sage' to work, so we throw a warning in that case. cf. http://groups.google.com/group/libsingular-devel/browse_thread/thread/a05725bc1312531c
comment:8 Changed 9 years ago by
- Reviewers set to Marshall Hampton,
- Status changed from needs_review to positive_review
wjp helped test this for magma and because of output changes, some doctests fail. Since that's beyond our control to some extent I am not too worried about it.
I tested everything in sage/rings and all standard doctests passed.
This is very helpful for exploring what algorithm to use, excellent addition.
comment:9 Changed 9 years ago by
Which Magma version is that? I could try to accommodate both versions? Perhaps in a different patch.
comment:11 Changed 9 years ago by
This is now #10631, or do you want this to be in the current patch?
comment:12 Changed 9 years ago by
- Reviewers changed from Marshall Hampton, to Marshall Hampton
- Status changed from positive_review to needs_work
All doctests involving magma should be marked
# optional - magma
comment:13 follow-up: ↓ 14 Changed 9 years ago by
Okay, sorry for the oversight. Do I just change it back to positive review?
comment:14 in reply to: ↑ 13 Changed 9 years ago by
Replying to malb:
Okay, sorry for the oversight. Do I just change it back to positive review?
I will test it and if tests succeed, I will put back the positive review.
comment:15 Changed 9 years ago by
File "/mnt/usb1/scratch/jdemeyer/merger/sage-4.6.2.alpha4/devel/sage-main/sage/interfaces/magma.py", line 2753: sage: _ = I.groebner_basis('magma',prot=True) indirect doctest, optional - magma Exception raised: Traceback (most recent call last): File "/mnt/usb1/scratch/jdemeyer/merger/sage-4.6.2.alpha4/local/bin/ncadoctest.py", line 1231, in run_one_test self.run_one_example(test, example, filename, compileflags) File "/mnt/usb1/scratch/jdemeyer/merger/sage-4.6.2.alpha4/local/bin/sagedoctest.py", line 38, in run_one_example OrigDocTestRunner.run_one_example(self, test, example, filename, compileflags) File "/mnt/usb1/scratch/jdemeyer/merger/sage-4.6.2.alpha4/local/bin/ncadoctest.py", line 1172, in run_one_example compileflags, 1) in test.globs File "<doctest __main__.example_81[4]>", line 1 _ = I.groebner_basis('magma',prot=True) indirect doctest, optional - magma###line 2753: sage: _ = I.groebner_basis('magma',prot=True) indirect doctest, optional - magma ^ SyntaxError: invalid syntax
Changed 9 years ago by
comment:16 Changed 9 years ago by
That was because I'm an idiot. Fixed now.
comment:17 Changed 9 years ago by
- Status changed from needs_work to needs_review
Doing a test again...
comment:18 Changed 9 years ago by
- Status changed from needs_review to positive_review
comment:19 Changed 9 years ago by
- Merged in set to sage-4.6.2.alpha4
- Resolution set to fixed
- Status changed from positive_review to closed
With the attached patch, here's how Magma's output looks like:
And Singular via pexpect (libsingular worked already):
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:
which might be useful on its own.