source: git/doc/usercard.tex @ 888936

spielwiese
Last change on this file since 888936 was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 17.9 KB
Line 
1
2%
3% usercard.tex - Singular user quick reference card.
4%
5
6\input singcard.tex
7
8\centerline{\hbf SINGULAR Quick Reference}
9
10\centerline{\srm {\ssc Singular} Version 3-0}
11
12\bigskip
13
14Do not forget to terminate all commands with a {\tt ;} (semicolon)!
15
16In particular if \Singular\ prints the continuation prompt {\tt .}
17(peri\-od) instead of the regular command prompt {\tt >}, then it
18waits for a command to be terminated by a {\tt ;}.  If that does
19not help, try one or more {\tt "} or {\tt \char`}} to close an
20opened string or block.
21
22Comments start with {\tt //} and extend to end of line.
23
24\smallskip
25Some of the topics concerning interactive use are system dependent.
26
27\sec Starting SINGULAR(2.5cm)
28Singular&                       start \Singular\cr
29Singular {\it file} \rep&       read {\it files\/} and prompt for further commands\cr
30Singular --help&                print help on command line options and exit\cr
31\endsec
32
33\sec Stopping SINGULAR()
34quit;&                          exit \Singular; also {\tt exit;} or {\tt \$}\cr
35\ctl c&                         interrupt \Singular\cr
36\endsec
37
38\sec Getting help()
39help;&                          enter online help system\cr
40help {\it topic\/};&            describe {\it topic\/}; also {\tt? {\it topic\/};}\cr
41\subsec{Inside the info help system:}
42\ctl h&                         get help on help system\cr
43q&                              exit from help system\cr
44n\rmslash p\rmslash u&          go to next/previous/upper node\cr
45m&                              pick menu item by name\cr
46l&                              go to last visited node/exit from help on help\cr
47SPC\rmslash DEL&                scroll forward/backward one page\cr
48\endsec
49
50\sec Commandline editing()
51\sectext
52Commandline editing is similar to that of, e.g., {\tt bash} or {\tt tcsh}:\cr
53BS\rmslash\ctl d&               remove character on the left/right of cursor\cr
54\ctl p\rmslash\ctl n&           get previous/next line from history\cr
55\ctl b\rmslash\ctl f&           move cursor left/right\cr
56\ctl a\rmslash\ctl e&           go to beginning/end of line\cr
57\ctl u\rmslash\ctl k&           delete to beginning/end of line\cr
58\endsec
59
60\sec Names and objects()
61\sectext
62Names (= identifiers) have to be declared before they are used:\cr
63\entryskip
64\longentry {\it type\/} {\it name\/} \opt{= {\it expression\/}};&
65                                declare variable {\it name}\cr
66kill({\it name\/})&             delete variable {\it name}\cr
67\entryskip
68\sectext
69\parskip=\verysmallskipamount
70Names of type {\tt number}, {\tt poly}, {\tt ideal}, {\tt vector}, {\tt
71module}, {\tt matrix}, {\tt map}, and {\tt resolution} may be declared
72only inside a ring.  They are local to that ring.  The same holds for a {\tt
73list} if it contains an object of the above types.  All other types may be
74declared at any time.  They are globally visible.
75
76Names may consist of alphanumeric characters including {\tt \_}
77(underscore) and have to start with a letter.  Capital and small letters
78are distinguished.  Names may be followed by an integer expression in
79parentheses, resulting in so-called {\it indexed names}.\cr
80\entryskip
81{\it name\/}({\it n}..{\it m\/})&
82                                shortcut for {\tt {\it name\/}({\it
83                                n\/}), $\ldots$, {\it name\/}({\it
84                                m\/})}\hfil\break
85                                (\eg {\tt ring r = 0, x(1..3), dp;})\cr
86\_ {\rm (underscore)}&          refers to the value of the last expression
87                                printed\cr
88\endsec
89
90\vfill
91\centerline{\srm \copyright 1998-2005 \qquad Permissions on back}
92
93\eject
94
95\sec Ring declaration()
96\longentry ring {\it name\/} = {\it basefield}, ({\it ringvars\/}), {\it ordering\/};&
97                                \hyphenpenalty=50 \tolerance=200 declare ring
98                                {\it name\/} and make it the new base\-ring.
99                                {\it ringvars\/} has to be a list of names, the
100                                other items are described below.  Example:\par
101                                {\tt ring r = 32003, (x, y, z), dp;}\cr
102\longentry qring {\it name\/} = {\it ideal\/};&
103                                declare quotient ring {\it name\/} of the
104                                current base\-ring with respect to {\it
105                                ideal\/}{\it ideal\/} has to be a standard
106                                basis.  Make {\it name\/} the new basering.\cr
107\subsec{Examples of available {\bit basefields\/}:}
1080&                              the rational numbers\cr
109\it p&                          the finite field $Z_p$ with {\it p\/}
110                                elements,\par
111                                $2 \le p \le 2147483647$ a prime\cr
112({\it p\/}\^{}{\it n}, {\it gen\/})&
113                                the finite field with $p^n$ elements, {\it p\/}
114                                a prime and\par $4 \le p^n \le 32671$. The name
115                                {\it gen\/} refers to some generator of the
116                                cyclic group of unities.\cr
117({\it p}, {\it alpha\/})&       algebraic extension of $Q$ or $Z_p$ ($p =
118                                0$ or as above) by {\it alpha}.  The minpoly
119                                $\mu_{\hbox{\tit alpha}}$ for {\it alpha\/} has
120                                to be specified with an assignment to {\tt
121                                minpoly} (\eg {\tt minpoly=a\^{}2+1;}, for
122                                $\hbox{\it alpha}=\hbox{\tt a}$).  {\it
123                                alpha\/} has to be a name.\cr
124({\it p}, $t_1$, $\ldots$)&     transcendental extension of $Q$ or $Z_p$
125                                ($p = 0$ or as above) by~$t_i$.  The $t_i$ have
126                                to be names.\cr
127real,{\it len}&                 the real numbers represented by long floating
128                                point numbers of length{\it len}\cr
129\endsec
130
131\sec Term orderings()
132\sectext
133An {\it ordering\/} as referred to in the ring declaration may either be
134a global, local, or matrix ordering or a list of these resulting in a
135pro\-duct ordering.  The list may include extra weight vectors and may be
136preceded or followed by a module ordering specification.\cr
137\subsec{Global orderings}
138lp&                             lexicographical ordering\cr
139dp&                             degree reverse lexicographical ordering\cr
140Dp&                             degree lexicographical ordering\cr
141wp($w_1$, $\ldots$)&            weighted reverse lexicographical ordering\cr
142Wp($w_1$, $\ldots$)&            weighted lexicographical ordering\cr
143&                               The $w_i$ have to be positive integers.\cr
144\subsec{Local orderings}
145ls&                             negative lexicographical ordering\cr
146ds&                             negative degree reverse lexicographical ordering\cr
147Ds&                             negative degree lexicographical ordering\cr
148ws($w_1$, $\ldots$)&            general weighted reverse lexicographical ordering\cr
149Ws($w_1$, $\ldots$)&            general weighted lexicographical ordering\cr
150&                               $w_1$ has to be a non-zero integer, every other
151                                $w_i$ may be any integer\cr
152\subsec{Matrix orderings}
153\longentry M($m_{11}$, $m_{12}$, $\ldots$, $m_{nn}$)&
154                                {\it m\/} has to be an invertible matrix with
155                                integer coeffi\-cients.  Coefficients have to be
156                                specified row-wise.\cr
157\subsec{Product orderings}
158\longentry($o_1$\opt{($k_1$)}, $o_2$\opt{($k_2$)}, $\ldots$, $o_n$\opt{($k_n$)})&
159                                the $o_i$ have to be any of the above orderings.
160                                {\tt lp}, {\tt dp}, {\tt Dp}, {\tt ls}, {\tt
161                                ds}, {\tt Ds} may be followed by an integer
162                                expression $k_i$ in parentheses specifying the
163                                number of variables $o_i$ refers to (\eg {\tt
164                                (lp(3), dp(2))}).\cr
165\subsec{Extra weight vector}
166a($w_1$, $\ldots$)&             any of the above degree orderings may be
167                                preceded by an extra weight vector\cr
168\noalign{\eject}
169\subsec{Module orderings}
170({\it c}, $o_1$, $\ldots$)&     sort by components first\cr
171($o_1$, $\ldots$, {\it c\/})&   sort by variables first\cr
172&                               $o_i$ may be any of the above orderings or an
173                                extra weight vector, {\it c\/} may be one of
174                                {\tt C} or {\tt c}:\cr
175C&                              sort generators in ascending order (\ie {\tt
176                                gen({\it i\/})} $<$ {\tt gen({\it j\/})} iff $i <
177                                j$)\cr
178c&                              sort generators in descending order\cr
179\endsec
180
181\sec Data types(1.5cm)
182\sectext
183Examples of ring-independent types:\cr
184\entryskip
185\longitem
186int i1 = 101; int i2 = 13 div 3;\cr
187\entryskip
188\longitem
189intvec iv = 13 div 3, -4, i1;\cr
190\entryskip
191\longentry
192intmat im[2][2] = 13 div 3, -4, i1;&
193                                a $2\times 2$ matrix.  Entries are filled
194                                row-wise, missing entries are set to zero, extra
195                                entries are ignored.  vector/matrix elements are
196                                accessed using the {\tt[$\ldots$]} operator,
197                                where the first element has index one (\eg {\tt
198                                iv[3]; im[1, 2];}).\cr
199\entryskip
200\longitem
201string s1 = "a quote \char"5C " and a backslash \char"5C \char"5C";\par
202string s2 = "con" + "catenation";\cr
203\entryskip
204\sectext
205Basering in the following is {\tt ring r = 0, (x, y, z, mu, nu), dp;}\cr
206\entryskip
207\longitem
208number n = 5/3;\cr
209\entryskip
210\longentry
211poly p(1) = 3/4x3yz4+2xy2;\par
212poly p(2) = (5/3)*mu\^{}2*nu\^{}3+n*yz2;&
213                                {\tt p(1)} equals $3/4x^3yz^4+2xy^2$.  Short
214                                format of mono\-mials is valid for one-character
215                                ring variables only.\cr
216\entryskip
217\longentry
218ideal i = p(1..2), x+y;&        note the use of indexed names\cr
219\entryskip
220\longentry
221vector v = [p(1), p(2), x+y];\par
222vector w = 2*p(1)*gen(6)+n*nu*gen(1);&
223                                vectors may be written in brackets ({\tt
224                                [$\ldots$]}) or expressed as linear
225                                combinations of the canonical generators {\tt
226                                gen({\it i\/})}\cr
227\entryskip
228\longitem
229module mo = v, w, x+y*gen(1);\cr
230\entryskip
231\longitem
232resolution r = sres(std(mo), 0);\cr
233\entryskip
234\longentry
235matrix ma[2][2] = 5/3, p(1), 101;&
236                                the rules for declaring, filling, and accessing
237                                integer matrices apply to types {\tt matrix}
238                                and {\tt vector}, too\cr
239\entryskip
240\longentry
241list l = iv, v, p(1..2), mo;&
242                                lists may collect objects of any type.  They are
243                                ring-dependent iff one of the entries is.\cr
244\entryskip
245\longentry
246def d = read("MPfile:r example.mp");&
247                                a name of type {\tt def} inherits the type of
248                                the object assigned first to it.  Useful if the
249                                actual type of an object is unknown.\cr
250\endsec
251
252\sec Monitoring and debugging tools()
253timer = 1;&                     print time used for commands to execute\cr
254\longentry int t = timer; {\it command\/}; \rep; timer-t;&
255                                print time used for {\it commands\/} to execute\cr
256memory(1);&                     print number of bytes allocated from system\cr
257option(prot);&                  show algorithm protocol\cr
258option(mem);&                   show algorithm memory usage\cr
259\entryskip
260TRACE = 1;&                     print protocol on execution of procedures\cr
261listvar(all);&                  list all (user-)defined names\cr
262\longentry listvar({\it ringname\/});&
263                                list all names belonging to {\it ringname}\cr
264\endsec
265
266\eject
267
268\sec Options()
269option();&                      show current option settings\cr
270\longentry option($option_1$, no$option_2$, $\ldots$);&
271                                switch $option_1$ on and $option_2$ off, resp.\cr
272option(none);&                  reset all options to default values\cr
273\sectext
274Type {\tt help option;} for a list of all options.\cr
275\subsec{Monitoring}
276debugLib&                       show loading of procedures from libraries\cr
277mem&                            show algorithm memory usage\cr
278prot&                           show algorithm protocol\cr
279\subsec{Standard bases}
280fastHC&                         try to find highest corner as fast as possible\cr
281intStrategy&                    avoid divisions\cr
282morePairs&                      create additional pairs\cr
283notSugar&                       disable sugar strategy\cr
284redSB&                          compute reduced standard bases\cr
285redTail&                        reduce tails\cr
286sugarCrit&                      use sugar criteria\cr
287weightM&                        automatically compute weights\cr
288\subsec{Resolutions}
289minRes&                         do additional minimizing\cr
290notRegularity&                  disable regularity bound\cr
291\subsec{Miscellany}
292returnSB&                       let some functions return standard bases\cr
293\endsec
294
295\sec System variables()
296\sectext
297Type {\tt help System variables;} for a list of all system variables.\cr
298\subsec{Standard bases}
299degBound&                       stop if (weighted) total degree exceeds {\tt
300                                degBound}\cr
301multBound&                      stop if multiplicity gets smaller than {\tt
302                                multBound}\cr
303noether&                        cut off all monomials above monomial {\tt
304                                noether}\cr
305\subsec{Miscellany}
306basering&                       current basering\cr
307minpoly&                        minimal polynomial for algebraic extensions\cr
308short&                          do not print monomials in short format if zero\cr
309timer&                          on assignment of a non-zero value show time
310                                used for execution of executed commands.  On
311                                evaluation, return system time in seconds used
312                                by \Singular\ since start\cr
313TRACE&                          print information on procedures being executed
314                                if larger than one\cr
315\endsec
316
317\sec Input and output()
318< "{\it filename\/}";&          load and execute {\it filename\/}\cr
319\longentry write("{\it filename\/}", {\it expression}, \rep)&
320                                write {\it expressions\/} to ASCII file {\it
321                                filename}\cr
322\longentry read("{\it filename\/}");&
323                                read ASCII file {\it filename\/} and return
324                                content as a string.  See also example below.\cr
325\longentry
326dump("MPfile: {\it filename\/}");\par
327getdump("MPfile: {\it filename\/}");&
328                                dump current state of {\sc Singular} to {\it
329                                filename} and retrieve it, resp.\cr
330\entryskip
331\sectext
332An example how to write one single expression (in this case the
333ideal {\tt i}) to a file and read it back from there:
334
335{\tt
336write("i.save", i);\par
337execute("ideal i=" + read("i.save") + ";");
338}\cr
339\endsec
340
341\eject
342                               
343\sec Libraries()
344LIB "{\it library\/}";&         load {\it library}\cr
345help {\it library\/};&          show help on {\it library}\cr
346help all.lib;&                  show list of all libraries\cr
347\endsec
348
349\sec Mapping(1.5cm)
350\longentry map {\it name\/} = {\it ringname}, {\it ideal\/};&
351                                declare a map {\it name\/} from {\it ringname\/}
352                                to current basering.  The $i$-th ring variable
353                                from {\it ringname\/} is mapped to the $i$-th
354                                generator of {\it ideal}.\cr
355\longentry {\it mapname\/}({\it expression\/})&
356                                apply map {\it mapname\/} to {\it expression}\cr
357\entryskip
358\sectext
359Coefficients between rings with different basefields are mapped in the following
360way (non-canonical maps only):\strut
361\abovedisplayskip=0pt
362\belowdisplayskip=0pt
363$$
364\eqalign{Z_p \rightarrow Q&  :[i]_p \mapsto i \in [-p/2,p/2] \subset Z\cr
365         Z_p \rightarrow Z_q&:[i]_p \mapsto i \in [-p/2,p/2] \subset Z, i \mapsto [i]_q}
366$$
367\cr
368\noalign{\vskip -9pt} % dirty trick, gobbles the trailing \strut from \sectext
369\entryskip
370\longentry fetch({\it ringname}, {\it name\/})&
371                                map from ring {\it ringname\/} to current
372                                base\-ring.  The rings have to be identical up
373                                to names of ring variables\cr
374\longentry imap({\it ringname}, {\it name\/})&
375                                map from subring {\it ringname\/} to current
376                                basering\cr
377\longentry subst({\it expression}, {\it ringvar}, {\it monomial\/})&
378                                substitute {\it ringvar\/} by {\it monomial\/}
379                                in {\it expression}\cr
380\endsec
381
382\sec Miscellany(1.5cm)
383\longentry setring({\it ringname\/})&
384                                make {\it ringname\/} the current basering\cr
385\subsec{Data on polynomials}
386\longentry ord({\it poly\/\alt vector\/})&
387                                return (weighted) degree of initial term\cr
388\longentry deg({\it poly\/\alt vector\/})&
389                                return maximal (weighted) degree\cr
390\longentry
391size({\it ideal\/\alt module\/})\par
392size({\it poly\/\alt vector\/})\par
393size({\it string\/\alt intvec\/\alt list\/})&
394                                return (1) number of non-zero generators;
395                                (2) number of monomials; (3) length\cr
396\longentry lead({\it expression\/})&
397                                return initial term(s)\cr
398\subsec{Operations on polynomials}
399\longentry gcd({\it $\hbox{poly}_1$}, {\it $\hbox{poly}_2$\/})&
400                                return greatest common divisor\cr
401\longentry factorize({\it poly\/}\opt{, {\it int\/}})&
402                                return irreducible factors.  Return constant
403                                factor and multiplicities in dependency on {\it
404                                int}.\cr
405\endsec
406
407\sec Differentiation and jets(1.5cm)
408\longentry
409diff({\it expression}, {\it ringvar\/})\par
410diff({\it $\hbox{ideal}_1$}, {\it $\hbox{ideal}_2$\/})&
411                                (1) return partial derivation by {\it
412                                ringvar\/}; (2) differentiate each elt.\ of {\it
413                                $\hbox{ideal}_2$\/} by the differential
414                                operators corres\-pon\-ding to the elements of {\it
415                                $\hbox{ideal}_1$}\cr
416\longentry jacob({\it poly\/\alt ideal\/})&
417                                return jacobi ideal or matrix, resp.\cr
418\longentry jet({\it expression}, {\it int\/}\opt{, {\it intvec\/}})&
419                                return {\it int\/}-jet of {\it expression}.
420                                Return weighted {\it int\/}-jet if {\it
421                                intvec\/} is specifified.\cr
422\endsec
423
424\eject
425
426\sec Standard bases(1.5cm)
427\longentry groebner({\it ideal\/\alt module\/}\opt{, {\it int\/}})&
428                                compute a standard basis (SB) of {\it ideal\/}
429                                resp.\ {\it module\/} using a heuristically
430                                chosen method.  Delimit com\-pu\-tation time to
431                                {\it int\/} seconds.\cr
432\longentry std({\it ideal\/\alt module\/}\opt{, {\it intvec\/}})&
433                                compute a SB.  Use first Hilbert series {\it
434                                intvec\/} (result from {\tt hilb($\ldots$, 1)})
435                                for Hilbert-driven computation.\cr
436\longentry stdfglm({\it ideal\/}\opt{, {\it string\/}})&
437                                use FGLM algorithm to compute a SB from a SB
438                                w.r.t.\ the ``simpler'' ordering {\it string\/}
439                                (de\-faults to {\tt dp})\cr
440\longentry stdhilb({\it ideal\/}\opt{, {\it intvec\/}})&
441                                use Hilbert-driven algorithm to compute a SB.
442                                If Hil\-bert series {\it intvec\/} is not
443                                specified compute it first.\cr
444\longentry fglm({\it ringname}, {\it idealname\/})&
445                                use FGLM algorithm to transform SB {\it
446                                idealname\/} from ring {\it ringname\/} to a SB
447                                w.r.t.\ the ordering of the current basering\cr
448\longentry reduce({\it expression}, {\it ideal\/\alt module\/}\opt{, {\it int\/}})&
449                                reduce {\it expression\/} w.r.t.\ second
450                                argument which should be a SB.  Use lazy
451                                reduction if {\it int\/} equals one.\cr
452\endsec
453
454\sec Computation of invariants(1.5cm)
455\sectext
456Most of the results are meaningful only if the input ideal or module is
457represented by a standard basis.\cr
458\longentry degree({\it ideal\/\alt module\/})&
459                                display (Krull) dimension, codimension and
460                                multiplicity\cr
461\longentry dim({\it ideal\/\alt module\/})&
462                                return (Krull) dimension\cr
463\longentry hilb({\it ideal\/\alt module\/}\opt{, {\it int\/}})&
464                                display first and second Hilbert series with one
465                                argument.  Return {\it int}-th Hilber series
466                                otherwise (${\it \hbox{int}} = 1,2$).\cr
467\longentry mult({\it ideal\/\alt module\/})&
468                                return multiplicity\cr
469\longentry vdim({\it ideal\/\alt module\/})&
470                                return vector space dimension of current
471                                basering modulo {\it ideal\/} or {\it module},
472                                resp.\cr
473\endsec
474
475\sec Resolutions(1.5cm)
476\sectext
477An integer argument {\it length\/} in the following descriptions specifies the
478length of the resolution to compute.  If {\it length\/} equals zero, the whole
479resolution is computed.\cr
480\longentry res({\it ideal\/\alt module}, {\it length\/}\opt{, {\it int\/}})&
481                                compute a free resolution (FR) of {\it ideal\/}
482                                resp.\ {\it module\/} using a heuristically
483                                chosen method.  Compute a minimal resolution if
484                                a third argument is given.\cr
485\longentry mres({\it ideal\/\alt module}, {\it length\/})&
486                                compute a minimal FR using the standard basis
487                                method\cr
488\longentry lres({\it ideal\/\alt module}, {\it length\/})&
489                                compute a FR using LaSacala's method\cr
490\longentry sres({\it ideal\/\alt module}, {\it length\/})&
491                                compute a FR using Schreyer's method\cr
492\longentry syz({\it ideal\/\alt module\/})&
493                                compute the first syzygy\cr
494\longentry minres({\it resolution\/\alt list\/})&
495                                minimize a free resolution\cr
496\longentry betty({\it resolution\/\alt list\/})&
497                                compute the graded Betti numbers of a module
498                                represented by a resolution\cr
499\endsec
500
501\bye
Note: See TracBrowser for help on using the repository browser.