sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.3k stars 449 forks source link

Computing degree bound GBs with Magma is broken #15672

Closed malb closed 10 years ago

malb commented 10 years ago

This should work:

sage: R.<a,b,c,d,e,f,g,h,i,j> = PolynomialRing(GF(127),10)
sage: I = sage.rings.ideal.Cyclic(R,6)
sage: gb = I.groebner_basis('magma:GroebnerBasis', deg_bound=4)

The culprit is that PolynomialSequence casts to an ideal in Magma, but we need a sequence.

Upstream: None of the above - read trac for reasoning.

CC: @sagetrac-Bouillaguet

Component: interfaces

Keywords: magma, sd59

Author: Martin Albrecht

Branch/Commit: 7e43991

Reviewer: Jakob Kroeker

Issue created by migration from https://trac.sagemath.org/ticket/15672

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

0f45e69fix deg_bound=someint when algorithm='magma' in Gröbner basis computations
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Commit: 0f45e69

malb commented 10 years ago
comment:5

anyone up for reviewing it?

malb commented 10 years ago

Changed keywords from magma to magma, sd59

malb commented 10 years ago
comment:7

ping? It's a quite simple patch

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 10 years ago
comment:8

I get a different ouput for gb, so the doctest fails for me at len(gb)

 sage: R.<a,b,c,d,e,f,g,h,i,j> = PolynomialRing(GF(127),10)
 sage: I = sage.rings.ideal.Cyclic(R,6)
 sage: gb = I.groebner_basis('magma:GroebnerBasis', deg_bound=4)
 sage: len(gb) # optional - magma
 7 # doctest expects 5

Singular tells me 7, too (but we should not rely on that)

So why in your output len(gb) =5 ? I have access to a dated magma version 2.17-8.

Here is the gb output I get:

[a*b*c*d*e*f - 1,
 a*b*c*d*e - 3*b*c*d*e*f - c^2*d*e*f - 2*c*d^2*e*f - 2*c*d*e^2*f - d^2*e^2*f + b*c*d*f^2 + 2*b*c*e*f^2 + 2*b*d*e*f^2 + 3*c*d*e*f^2 + 2*d^2*e*f^2 + b*e^2*f^2 + c*e^2*f^2 + 3*d*e^2*f^2 + e^3*f^2 - b*c*f^3 - c*d*f^3 - 3*b*e*f^3 - 3*c*e*f^3 - d*e*f^3 + b*f^4 + c*f^4 + d*f^4 - 3*e*f^4 + f^5, 
c^3*d - c^2*d^2 + b*c*d*e + 2*c^2*d*e - 2*c*d^2*e - c^3*f - b*c*d*f + 3*c^2*d*f + 2*c*d^2*f - c^2*e*f + b*e^2*f + c*e^2*f + d*e^2*f + e^3*f - b*c*f^2 - 4*c^2*f^2 - b*d*f^2 - d^2*f^2 + 4*b*e*f^2 + 2*c*e*f^2 + 2*d*e*f^2 + 5*e^2*f^2 - 3*b*f^3 - 6*c*f^3 - 4*d*f^3 + 3*e*f^3 - 3*f^4,
 b*c*d^2 - b*c*d*e + c*d^2*e - c*d^2*f + b*c*e*f + c*d*e*f + d*e^2*f - b*c*f^2 + b*d*f^2 + d^2*f^2 - 2*b*e*f^2 - 2*c*e*f^2 - 2*d*e*f^2 - e^2*f^2 + b*f^3 + c*f^3 + 2*d*f^3 - 2*e*f^3 + f^4, 
b*c^2 - b*c*d + c^2*d - c^2*f + b*e*f + c*e*f + d*e*f + e^2*f - b*f^2 - 2*c*f^2 - d*f^2 + e*f^2 - f^3,
 b^2 + b*d - c*d + b*e - d*e + 2*b*f + c*f + d*f + f^2,
 a + b + c + d + e + f]
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

d5e02d4Merge branch 'develop' of trac.sagemath.org:sage into u/malb/magma_gb_deg_bound
7e43991fixed wrong doctest
7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 10 years ago

Changed commit from 0f45e69 to 7e43991

malb commented 10 years ago
comment:10

I checked with my Magma install and indeed 5 was wrong. It also returns 7. I've fixed the doctest.

vbraun commented 10 years ago
comment:12

Reviewer name (full name)

ea1d0bf8-c27a-4548-8cb7-de0b1d02441a commented 10 years ago

Reviewer: Jakob Kroeker

vbraun commented 10 years ago

Changed branch from u/malb/magma_gb_deg_bound to 7e43991