From 4cb5c17a4e7f03dfc597d94666eca7afc1bd9b6b Mon Sep 17 00:00:00 2001 From: Alexandru Iosif Date: Fri, 12 Oct 2018 15:27:53 +0200 Subject: [PATCH 1/5] Fixing an error which was causing the function monomialParameterization enter an infinite loop. Fixing another minor error. Adding a test. --- Binomials.m2 | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Binomials.m2 b/Binomials.m2 index 4c648c1..19786dd 100644 --- a/Binomials.m2 +++ b/Binomials.m2 @@ -561,12 +561,12 @@ monomialParameterization = I ->( imageDimension := rank exponentMatrix_{0..(numColumns exponentMatrix-2)}; i := 0; while (imageDimension =!= numRows exponentMatrix) do ( - if rank submatrix'(exponentMatrix,{i},) == imageDimension then ( - exponentMatrix = submatrix'(exponentMatrix,{i},); - i = i-1; + if rank (submatrix'(exponentMatrix,{i},))_{0..(numColumns matrix exponentList-2)} == imageDimension then ( + exponentMatrix = (submatrix'(exponentMatrix,{i},)); + i = i-1; ); - i = i+1; - ); + i = i+1; + ); r := numRows exponentMatrix; v := symbol v; S := R[v_1..v_r,MonomialOrder => Lex]; @@ -587,8 +587,8 @@ monomialParameterization = I ->( -- construct the Laurent polynomial ring by hand. numv := numColumns solution-r; G := K[tt_1..tt_numv, ti_1..ti_numv]; - posvars := unique (gens G)_{0, numv-1}; -- unique solves the case L_{0,0}; - invvars := unique (gens G)_{numv, 2*numv-1}; + posvars := unique (gens G)_{0..numv-1}; -- unique solves the case L_{0,0}; + invvars := unique (gens G)_{numv..2*numv-1}; laurentRels := ideal for i from 1 to (numColumns solution-r) list tt_i*ti_i - 1; H := G/laurentRels; charValues := flatten entries sub(sub(vars S, storeVarMap),K); @@ -2369,6 +2369,11 @@ K = frac(QQ[a,b]) R = K[x,y] I = ideal(a*x-b*y) assert (ker monomialParameterization I == I) + +R = QQ[a,b,c,d,e,f] +A = matrix {{1,1,1,1,1,1},{1,2,3,5,7,11},{1,2,4,6,8,10}} +I = toricMarkov_A R +assert (ker monomialParameterization I == I) /// @@ -2454,4 +2459,4 @@ end restart uninstallPackage "Binomials" installPackage "Binomials" -check "Binomials" \ No newline at end of file +check "Binomials" From 118cd450543ef1987f13228ff8745de837101e0d Mon Sep 17 00:00:00 2001 From: Alexandru Iosif Date: Fri, 12 Oct 2018 15:33:24 +0200 Subject: [PATCH 2/5] removing a blank line --- Binomials.m2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Binomials.m2 b/Binomials.m2 index 19786dd..0450e3b 100644 --- a/Binomials.m2 +++ b/Binomials.m2 @@ -2459,4 +2459,4 @@ end restart uninstallPackage "Binomials" installPackage "Binomials" -check "Binomials" +check "Binomials" \ No newline at end of file From 7ffa6df3fd05a5dd9959d4c33fb1d1ec7559fc61 Mon Sep 17 00:00:00 2001 From: Alexandru Iosif Date: Thu, 18 Apr 2019 18:04:31 +0200 Subject: [PATCH 3/5] solving a problem which was causing isBinomial to compute a Groebner Basis independet of if the Groebner free method was providing a binomial basis. --- Binomials.m2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Binomials.m2 b/Binomials.m2 index 0450e3b..5328f8c 100644 --- a/Binomials.m2 +++ b/Binomials.m2 @@ -380,6 +380,7 @@ isBinomial Ideal := Ideal => o -> I -> ( if not o#GroebnerFree then return isBinomialGroebner I; isB := (isBinomialGroebnerFree I)#0; + if isB then return isB; if isHomogeneous I then return isB; if not isB then print "Gröbner free method failed.\nStarting computation of Gröbner basis...\n"; @@ -2459,4 +2460,4 @@ end restart uninstallPackage "Binomials" installPackage "Binomials" -check "Binomials" \ No newline at end of file +check "Binomials" From a4f3572b91cac7419d497cfb4dc4a630f7da184b Mon Sep 17 00:00:00 2001 From: Alexandru Iosif Date: Tue, 4 Jun 2019 14:33:04 +0200 Subject: [PATCH 4/5] Solving an issue with the function monomialParameterization: When the variety of the ideal contained only one point, the function monomialParameterization was trying to find variables for the monomial Parameterization, and this was resulting in an error. Now it returns a more meaningfull error. --- Binomials.m2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Binomials.m2 b/Binomials.m2 index 5328f8c..0b5f5cf 100644 --- a/Binomials.m2 +++ b/Binomials.m2 @@ -587,6 +587,9 @@ monomialParameterization = I ->( -- polynomial rings are not implemented yet. Therefore we -- construct the Laurent polynomial ring by hand. numv := numColumns solution-r; + if (numv == 0) then ( + error "The variety of this ideal contains only one point. Please use another method to compute that point."; + ); G := K[tt_1..tt_numv, ti_1..ti_numv]; posvars := unique (gens G)_{0..numv-1}; -- unique solves the case L_{0,0}; invvars := unique (gens G)_{numv..2*numv-1}; From b5b1e9a79cb12a4ef063979a8c2a38a771c59463 Mon Sep 17 00:00:00 2001 From: Alexandru Iosif Date: Tue, 4 Jun 2019 15:36:52 +0200 Subject: [PATCH 5/5] Slighlty improving the last commit. Now the last implemented error appears much earlier. --- Binomials.m2 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Binomials.m2 b/Binomials.m2 index 0b5f5cf..6d63b68 100644 --- a/Binomials.m2 +++ b/Binomials.m2 @@ -533,8 +533,9 @@ monomialParameterization = I ->( if not char R == 0 then eligible = false; if not isBinomial I then eligible = false; if not binomialIsPrime I then eligible = false; + if dim I == 0 then eligible = false; if not eligible then ( - error "Sorry, only implemented for prime binomial ideals in characteristic zero"; + error "Sorry, only implemented for prime binomial ideals of dimension greater than zero in characteristic zero."; ); n := numgens R; @@ -587,9 +588,6 @@ monomialParameterization = I ->( -- polynomial rings are not implemented yet. Therefore we -- construct the Laurent polynomial ring by hand. numv := numColumns solution-r; - if (numv == 0) then ( - error "The variety of this ideal contains only one point. Please use another method to compute that point."; - ); G := K[tt_1..tt_numv, ti_1..ti_numv]; posvars := unique (gens G)_{0..numv-1}; -- unique solves the case L_{0,0}; invvars := unique (gens G)_{numv..2*numv-1};