Singular uses a set of global options to determine verbosity and the behavior of certain algorithms. We provide an interface to these options in the most ‘natural’ python-ic way. Users who do not wish to deal with Singular functions directly usually do not have to worry about this interface or Singular options in general since this is taken care of by higher level functions.
We compute a Groebner basis for Cyclic-5 in two different contexts:
sage: P.<a,b,c,d,e> = PolynomialRing(GF(127))
sage: I = sage.rings.ideal.Cyclic(P)
sage: std = sage.libs.singular.ff.std
By default, tail reductions are performed:
sage: from sage.libs.singular.option import opt, opt_ctx
sage: opt['redTail']
True
sage: std(I)[-1]
d^2*e^6 + 28*b*c*d + ...
If we don’t want this, we can create an option context, which disables this:
sage: with opt_ctx(redTail=False,redSB=False):
... std(I)[-1]
d^2*e^6 + 8*c^3 + ...
However, this does not affect the global state:
sage: opt['redTail']
True
On the other hand, any assignment to an option object will immediately change the global state:
sage: opt['redTail'] = False
sage: opt['redTail']
False
sage: opt['redTail'] = True
sage: opt['redTail']
True
Assigning values within an option context, only affects this context:
sage: with opt_ctx:
... opt['redTail'] = False
sage: opt['redTail']
True
Option contexts can also be safely stacked:
sage: with opt_ctx:
... opt['redTail'] = False
... print opt
... with opt_ctx:
... opt['redThrough'] = False
... print opt
...
general options for libSingular (current value 0x00000082)
general options for libSingular (current value 0x00000002)
sage: print opt
general options for libSingular (current value 0x02000082)
The same interface is available for verbosity options:
sage: from sage.libs.singular.option import opt_verb
sage: opt_verb['notWarnSB']
False
AUTHOR:
Bases: sage.libs.singular.option.LibSingularOptions_abstract
Pythonic Interface to libSingular’s options.
Supported options are:
- returnSB - the functions syz, intersect, quotient, modulo return a standard base instead of a generating set if returnSB is set. This option should not be used for lift.
- fastHC - tries to find the highest corner of the staircase (HC) as fast as possible during a standard basis computation (only used for local orderings).
- intStrategy - avoids division of coefficients during standard basis computations. This option is ring dependent. By default, it is set for rings with characteristic 0 and not set for all other rings.
- lazy - uses a more lazy approach in std computations, which was used in SINGULAR version before 2-0 (and which may lead to faster or slower computations, depending on the example)
- length - select shorter reducers in std computations,
- notRegularity - disables the regularity bound for res and mres (see regularity).
- notSugar - disables the sugar strategy during standard basis computation.
- notBuckets - disables the bucket representation of polynomials during standard basis computations. This option usually decreases the memory usage but increases the computation time. It should only be set for memory-critical standard basis computations.
- oldStd - uses a more lazy approach in std computations, which was used in SINGULAR version before 2-0 (and which may lead to faster or slower computations, depending on the example)
- prot - shows protocol information indicating the progress during the following computations: facstd, fglm, groebner, lres, mres, minres, mstd, res, slimgb,``sres``, std, stdfglm, stdhilb, syz.
- redSB - computes a reduced standard basis in any standard basis computation.
- redTail - reduction of the tails of polynomials during standard basis computations. This option is ring dependent. By default, it is set for rings with global degree orderings and not set for all other rings.
- redThrough - for inhomogenous input, polynomial reductions during standard basis computations are never postponed, but always finished through. This option is ring dependent. By default, it is set for rings with global degree orderings and not set for all other rings.
- sugarCrit - uses criteria similar to the homogeneous case to keep more useless pairs.
- weightM - automatically computes suitable weights for the weighted ecart and the weighted sugar method.
EXAMPLE:
sage: from sage.libs.singular.option import LibSingularOptions
sage: libsingular_options = LibSingularOptions()
sage: libsingular_options
general options for libSingular (current value 0x02000082)
Bases: object
Option context
This object localizes changes to options.
EXAMPLE:
sage: from sage.libs.singular.option import opt, opt_ctx
sage: opt
general options for libSingular (current value 0x02000082)
sage: with opt_ctx(redTail=False):
... print opt
... with opt_ctx(redThrough=False):
... print opt
...
general options for libSingular (current value 0x00000082)
general options for libSingular (current value 0x00000002)
sage: print opt
general options for libSingular (current value 0x02000082)
Bases: object
Abstract Base Class for libSingular options.
EXAMPLE:
sage: from sage.libs.singular.option import opt as sopt
sage: bck = int(sopt); hex(bck)
'0x2000082'
sage: sopt['redTail'] = False
sage: hex(int(sopt))
'0x82'
sage: sopt.load(bck)
sage: sopt['redTail']
True
Bases: sage.libs.singular.option.LibSingularOptions_abstract
Pythonic Interface to libSingular’s verbosity options.
Supported options are:
- mem -
- yacc -
- redefine -
- reading -
- loadLib -
- debugLib -
- loadProc -
- defRes -
- debugMem -
- usage -
- Imap -
- prompt -
- notWarnSB - do not warn if a basis is not a standard basis
- contentSB -
- cancelunit -
EXAMPLE:
sage: from sage.libs.singular.option import LibSingularVerboseOptions
sage: libsingular_verbose = LibSingularVerboseOptions()
sage: libsingular_verbose
verbosity options for libSingular (current value 0x00002851)