Project

General

Profile

Support #973

GroebnerFanIdeals: verbosity and output style

Added by John Abbott over 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
High
Category:
enhancing/improving
Start date:
17 Nov 2016
Due date:
% Done:

100%

Estimated time:
5.50 h
Spent time:

Description

Two mild criticisms:
  • it prints out an asterisk for each fan ideal found
  • the generators of the ideals are not monic (so they are not strictly ReducedGBasis)

Related issues

Related to CoCoA-5 - Feature #903: New function CallOnGroebnerFanIdeals: call function on GFan idealsClosed2016-07-04

Related to CoCoA-5 - Design #984: GroebnerFanIdeals: order matrices sometimes have "large" entriesNew2016-11-26

Copied to CoCoA-5 - Support #977: "universal denominator" (related with GroebnerFanIdeals)In Progress2016-11-17

History

#1 Updated by John Abbott over 7 years ago

I have given this a higher priority because I think it will be quick and easy to resolve.

@Anna: can you do it? (before releasing 5.1.6?)

#2 Updated by John Abbott over 7 years ago

I tried GroebnerFanIdeals on the following input:

use P::=QQ[x,y,z];
I := ideal(x^5-3*y^3*z+x*y*z-2, y^3-2*z+5, z^2-12*x+7*y);
GF := GroebnerFanIdeals(I);
indent(GF);

The resulting list GF has 195 elements, but many of them seem to be repeats. Is this intended? (Or should there be another issue for this?)

NOTE comparing the printed forms of the ideals there are only 11 different results (perhaps ones that appear equal actually have different LPPs?)

#3 Updated by Anna Maria Bigatti over 7 years ago

John Abbott wrote:

I tried GroebnerFanIdeals on the following input:
[...]
The resulting list GF has 195 elements, but many of them seem to be repeats. Is this intended? (Or should there be another issue for this?)

NOTE comparing the printed forms of the ideals there are only 11 different results (perhaps ones that appear equal actually have different LPPs?)

The function GroebnerFanIdeals returns the IDEALS.
(Renzo's happy you had the same problem as his!)
Inside the ideals there are the GBases.
If you want them do

indent([ReducedGBasis(J) | J in GroebnerFanIdeals(I)]);

It would be nice to have result the ideals generated by the reduced GBases, but in that way (in CoCoA-5!) we would lose that those are the GBases! In CoCoALib we can declare that the generators are a GBasis, but in CoCoA-5 we cannot.
Should we allow that? (indeed it would be quite useful in a few places)

#4 Updated by Anna Maria Bigatti over 7 years ago

  • Related to Feature #903: New function CallOnGroebnerFanIdeals: call function on GFan ideals added

#5 Updated by John Abbott over 7 years ago

moved to #977

Does this code correctly compute the "universal denominator" for the ideal I? (...)

#6 Updated by Anna Maria Bigatti over 7 years ago

  • Subject changed from GroebnerFanIdeals to GroebnerFanIdeals: verbosity
  • Assignee set to Anna Maria Bigatti

#7 Updated by Anna Maria Bigatti over 7 years ago

  • Subject changed from GroebnerFanIdeals: verbosity to GroebnerFanIdeals: verbosity and output style

#8 Updated by John Abbott over 7 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 10

moved to #977

Robbiano suggested that it could be interesting to find the first (or at least a smallish) good prime. (...)

#9 Updated by Anna Maria Bigatti over 7 years ago

  • Copied to Support #977: "universal denominator" (related with GroebnerFanIdeals) added

#10 Updated by Anna Maria Bigatti over 7 years ago

  • % Done changed from 10 to 0

It would be nice to have as result the list of ideals generated by the reduced GBases, but in that way (in CoCoA-5!) we would lose that those polynomials are the GBases!

In CoCoALib we can declare that the generators are a GBasis, but in CoCoA-5 we cannot.
Should we allow that in CoCoA-5? (indeed it would be quite useful in a few places)

#11 Updated by John Abbott over 7 years ago

I think the confusion came from the way the documentation is worded.

I have rerun the example from comment 2, and can (fairly) safely say that no-one wants to see the reduced G-bases (the whole output was more than 2Mbytes).

What was not entirely clear to me was whether these ideals already had their reduced G-bases memorized inside, or whether the G-bases are computed "on demand". Maybe it does not matter; maybe "on demand" is actually a better option, as I imagine non-trivial examples quickly give gigantic results (i.e. the sum of the sizes of all the various G-bases).

I'm still amazed at how "ugly" some of the reduced G-bases are (i.e. the coeffs are very complicated).

#12 Updated by Anna Maria Bigatti over 7 years ago

John Abbott wrote:

I think the confusion came from the way the documentation is worded.

I have rerun the example from comment 2, and can (fairly) safely say that no-one wants to see the reduced G-bases (the whole output was more than 2Mbytes).

indeed.

What was not entirely clear to me was whether these ideals already had their reduced G-bases memorized inside, or whether the G-bases are computed "on demand". Maybe it does not matter; maybe "on demand" is actually a better option, as I imagine non-trivial examples quickly give gigantic results (i.e. the sum of the sizes of all the various G-bases).

This actually memorizes the GBases.
The clever function is "CallOnGroebnerFanIdeals".

But it is true that the user gets confused. (both you and Robbiano were tricked by lists which were identical, but did NOT LOOK so)
One possibility, for small examples (or for convincing the user it is not a good idea ;-) is writing the function "GroebnerFanReducedGBases", which is trivial to write, and exactly what the user expects (even though it is often not what he wants!)

Or maybe I should write some good examples in the manual?

#13 Updated by Anna Maria Bigatti over 7 years ago

Anna Maria Bigatti wrote:

One possibility, for small examples (or for convincing the user it is not a good idea ;-) is writing the function "GroebnerFanReducedGBases"

Or maybe I should write some good examples in the manual?

I will do both: indeed I'll write a good example in the manual of the new function with an explicatory example.

#14 Updated by John Abbott over 7 years ago

  • % Done changed from 0 to 30

I have rewritten the man page for GroebnerFanIdeals (and already checked in, if I recall correctly).

#15 Updated by John Abbott over 7 years ago

Out of curiosity.... Does GFan produce order matrices with smallest possible non-negative entries?
In the example from comment 2, there are two order matrices with entries larger than 1000...
If negative entries are allowed then these number can be greatly reduced (though internally they are probably made non-negative again because of the coding we use for order vectors).

#16 Updated by Anna Maria Bigatti over 7 years ago

  • % Done changed from 30 to 60
  • Estimated time set to 5.00 h

Added GroebnerFanReducedGBases.

For the "*" I could use the new "VerbosityLevel". Working on it.

#17 Updated by Anna Maria Bigatti over 7 years ago

  • Status changed from In Progress to Feedback
  • % Done changed from 60 to 90

Now prints "*" with verbosity >=10 /// updated

/**/ SetVerbosityLevel(10);
/**/ use R ::= QQ[a,b,c];
/**/ I := ideal(b^2-1, a^2+c-1, c^2-b);
/**/ indent(GroebnerFanReducedGBases(I));
/**/ ****[
  [c^2 -b, b^2 -1, a^2 +c -1],
  [b -c^2, a^2 +c -1, c^4 -1],
  [c +a^2 -1, b -a^4 +2*a^2 -1, a^8 -4*a^6 +6*a^4 -4*a^2],
  [c +a^2 -1, b^2 -1, a^4 -b -2*a^2 +1]
]

#18 Updated by John Abbott over 7 years ago

  • Related to Design #984: GroebnerFanIdeals: order matrices sometimes have "large" entries added

#19 Updated by Anna Maria Bigatti about 7 years ago

now prints
  • with verbosity >=10 (each call of recursive, CallOnRecursive)
    . with verbosity >=20 (each call of GetFlippableInequalities)
    maxdeg with verbosity >=80 (GetFlippableInequalities)
    timings with verbosity >=90 (GroebnerFanIdeals, CallOnGroebnerFanIdeals)

#20 Updated by Anna Maria Bigatti about 7 years ago

Now using IdealOfGBasis, so that the generators of the ideals are the different GBasis.

/**/ use R ::= QQ[a,b,c];
/**/ I := ideal(b^2-1, a^2+c-1, c^2-b);
/**/ indent(GroebnerFanIdeals(I));
[
  ideal(c^2 -b, b^2 -1, a^2 +c -1),
  ideal(b -c^2, a^2 +c -1, c^4 -1),
  ideal(c +a^2 -1, b -a^4 +2*a^2 -1, a^8 -4*a^6 +6*a^4 -4*a^2),
  ideal(c +a^2 -1, b^2 -1, a^4 -b -2*a^2 +1)
]

#21 Updated by John Abbott almost 7 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100
  • Estimated time changed from 5.00 h to 5.50 h

This seems to work well now.
Sometimes it is slow, but I think that is GFan's fault.

Closing.

Also available in: Atom PDF