This is RandomComplexes.info, produced by Macaulay2, version 1.25.11

RandomComplexes -- support for creating random complexes over the integers
**************************************************************************

Description
===========

We implement two methods to create a random ChainComplex (OldChainComplexes),
over the integers. The first method (see
randomChainComplex) builds the complex from products of
randomly chosen matrices of desired rank. The limitation of this method to
produce large complexes over the integers with moderate Height is the use of
the LLL algorithm to improve the presentation of syzygy matrices.

The second method (see randomSimplicialComplex)
uses Stanley-Reisner rings from randomly chosen monomial ideals.

Caveat
======

Some functionality here should be moved elsewhere, e.g. see disturb,
see histogram, maximalEntry, and
normalize.

Authors
=======

  * Frank-Olaf Schreyer (see http://www.math.uni-sb.de/ag/schreyer/ )
    <schreyer@math.uni-sb.de>
  * Michael E. Stillman (see
    http://www.math.cornell.edu/People/Faculty/stillman.html )
    <mike@math.cornell.edu>

Version
=======

This documentation describes version 0.2 of RandomComplexes, released 4 April
2018.

Citation
========

If you have used this package in your research, please cite it as follows:

+-----------------------------------------------------------------------------+
|@misc{RandomComplexesSource,                                                 |
|  title = {{RandomComplexes: random complexes over fields or the integers.   |
|  author = {Frank-Olaf Schreyer and Michael E. Stillman},                    |
|  howpublished = {A \emph{Macaulay2} package available at                    |
|    \url{https://github.com/Macaulay2/M2/tree/stable/M2/Macaulay2/packages   |
|}                                                                            |
|-----------------------------------------------------------------------------|
| Version~0.2}},                                                              |
|                                                                             |
|                                                                             |
|}}                                                                           |
+-----------------------------------------------------------------------------+

Exports
=======

  * Functions and commands
      * disturb -- disturb the matrices of a chain complex over
        RR
      * histogram -- histogram of a list of real numbers
      * maximalEntry -- maximal absolute value of the
        entries of the matrix or matrices
      * normalize -- normalize a ChainComplex over QQ or RR
      * randomChainComplex -- random chain complex
        over the integers with prescribed ranks of the homology group and ranks
        of the matrices
      * randomSimplicialComplex -- the
        chainComplex over ZZ of a random Stanley-Reisner simplicial complex
      * testTimeForLLLonSyzygies -- test
        timing for LLL on syzygies
  * Methods
      * "disturb(ChainComplex,RR)" -- see disturb, -- disturb
        the matrices of a chain complex over RR
      * "histogram(List,ZZ)" -- see histogram, -- histogram of
        a list of real numbers
      * "maximalEntry(ChainComplex)" -- see maximalEntry,
        -- maximal absolute value of the entries of the matrix or matrices
      * "maximalEntry(Matrix)" -- see maximalEntry, --
        maximal absolute value of the entries of the matrix or matrices
      * "normalize(ChainComplex)" -- see normalize, --
        normalize a ChainComplex over QQ or RR
      * "randomChainComplex(List,List)" -- see randomChainComplex,
        -- random chain complex over the integers with
        prescribed ranks of the homology group and ranks of the matrices
      * "randomSimplicialComplex(ZZ,ZZ)" -- see randomSimplicialComplex,
        -- the chainComplex over ZZ of a random
        Stanley-Reisner simplicial complex
      * "testTimeForLLLonSyzygies(ZZ,ZZ)" -- see
        testTimeForLLLonSyzygies, -- test timing for
        LLL on syzygies
  * Symbols
      * "Continuous" -- see Discrete, -- Value for the Strategy
        in disturb
      * Discrete -- Value for the Strategy in disturb
      * WithLLL -- Option for randomComplex
      * ZeroMean -- Option for randomComplex

For the programmer
==================

The object RandomComplexes, is a package (Macaulay2Doc),
defined in RandomComplexes.m2.

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:248:0.

Discrete -- Value for the Strategy in disturb
*********************************************

Description
===========

If Strategy=>Continuous then we disturb the complex by floating point numbers
otherwise by discrete values.

See also
========

  * disturb -- disturb the matrices of a chain complex over RR

For the programmer
==================

The object Discrete, is a symbol (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:527:0.

disturb -- disturb the matrices of a chain complex over RR
**********************************************************

  * Usage:
        B = disturb(C,epsilon)
  * Inputs:
      * C, a chain complex (OldChainComplexes), over RR or
        QQ
      * epsilon, a real number (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Strategy => a symbol (Macaulay2Doc), default value
        Discrete, either Discrete or Continuous, whether the disturbed values
        should be drawn from a discrete distribution or a continuous
        distribution
  * Outputs:
      * B, a chain complex (OldChainComplexes), a sequence
        of matrices over RR

Description
===========

We disturb the entries of the matrices by a relative error of size epsilon
depending on either a discrete with values in \{-1,1\}\ or a continuous random
variable with values in [-1..1].

+----------------------------------------------------------------------------+
|i1 : needsPackage "RandomComplexes"                                         |
|                                                                            |
|o1 = RandomComplexes                                                        |
|                                                                            |
|o1 : Package                                                                |
+----------------------------------------------------------------------------+
|i2 : setRandomSeed "nice example 2";                                        |
| -- setting random seed to 12638458417381289481402307077                    |
+----------------------------------------------------------------------------+
|i3 : C=randomChainComplex({1,1,1},{2,2})                                    |
|                                                                            |
|       3       5       3                                                    |
|o3 = ZZ  <-- ZZ  <-- ZZ                                                     |
|                                                                            |
|     0       1       2                                                      |
|                                                                            |
|o3 : ChainComplex                                                           |
+----------------------------------------------------------------------------+
|i4 : C.dd                                                                   |
|                                                                            |
|           3                              5                                 |
|o4 = 0 : ZZ  <------------------------- ZZ  : 1                             |
|                | -14 -7  5 5   3   |                                       |
|                | 8   13  1 -17 -21 |                                       |
|                | -13 -15 1 18  21  |                                       |
|                                                                            |
|           5                        3                                       |
|     1 : ZZ  <------------------- ZZ  : 2                                   |
|                | -11 5   -10 |                                             |
|                | 26  -29 37  |                                             |
|                | 19  -16 23  |                                             |
|                | -41 -1  -22 |                                             |
|                | 46  -16 38  |                                             |
|                                                                            |
|o4 : ChainComplexMap                                                        |
+----------------------------------------------------------------------------+
|i5 : B=disturb(C,1e-4)                                                      |
|                                                                            |
|         3         5         3                                              |
|o5 = RR    <-- RR    <-- RR                                                 |
|       53        53        53                                               |
|                                                                            |
|     0         1         2                                                  |
|                                                                            |
|o5 : ChainComplex                                                           |
+----------------------------------------------------------------------------+
|i6 : B.dd                                                                   |
|                                                                            |
|             3                                                         5    |
|o6 = 0 : RR    <-------------------------------------------------- RR    : 1|
|           53     | -13.9986 -6.9993  5.0005 5.0005   2.9997   |     53     |
|                  | 8.0008   12.9987  1.0001 -17.0017 -20.9979 |            |
|                  | -13.0013 -15.0015 1.0001 18.0018  20.9979  |            |
|                                                                            |
|             5                                         3                    |
|     1 : RR    <---------------------------------- RR    : 2                |
|           53     | -10.9989 4.9995   -10.001  |     53                     |
|                  | 26.0026  -29.0029 37.0037  |                            |
|                  | 18.9981  -16.0016 23.0023  |                            |
|                  | -40.9959 -1.0001  -21.9978 |                            |
|                  | 46.0046  -16.0016 37.9962  |                            |
|                                                                            |
|o6 : ChainComplexMap                                                        |
+----------------------------------------------------------------------------+
|i7 : B.dd^2                                                                 |
|                                                                            |
|             3                                               3              |
|o7 = 0 : RR    <---------------------------------------- RR    : 2          |
|           53     | -.0307969    -.0030031 .00020458 |     53               |
|                  | -4.26326e-14 .00020002 .148183   |                      |
|                  | -.0780078    .080208   -.239992  |                      |
|                                                                            |
|o7 : ChainComplexMap                                                        |
+----------------------------------------------------------------------------+
|i8 : B1=disturb(C,1e-4,Strategy => Continuous)                              |
|                                                                            |
|         3         5         3                                              |
|o8 = RR    <-- RR    <-- RR                                                 |
|       53        53        53                                               |
|                                                                            |
|     0         1         2                                                  |
|                                                                            |
|o8 : ChainComplex                                                           |
+----------------------------------------------------------------------------+
|i9 : B1.dd^2                                                                |
|                                                                            |
|             3                                            3                 |
|o9 = 0 : RR    <------------------------------------- RR    : 2             |
|           53     | -.0274814 .0279033  -.0248834 |     53                  |
|                  | -.0316963 -.0630671 .0213659  |                         |
|                  | .0211089  .0524756  -.0148725 |                         |
|                                                                            |
|o9 : ChainComplexMap                                                        |
+----------------------------------------------------------------------------+

Caveat
======

The result is only approximately a complex

See also
========

  * Continuous -- Value for the Strategy in disturb
  * Discrete -- Value for the Strategy in disturb

Ways to use disturb:
====================

  * "disturb(ChainComplex,RR)"

For the programmer
==================

The object disturb, is a method function with options (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:425:0.

histogram -- histogram of a list of real numbers
************************************************

  * Usage:
        h = histogram(L,n)
  * Inputs:
      * L, a list (Macaulay2Doc), of numbers in RR or QQ or ZZ
      * n, an integer (Macaulay2Doc), the number of subintervals to
        be considered.
  * Outputs:
      * h, a list (Macaulay2Doc), of n integers, the number of
        entries in L in i-th equidistant subdivision of the interval from min L
        to max L

Description
===========

We compute h_i the number to elements in the i-th equidistant subdivision of
the interval [min L, max L] into n parts

+-----------------------------------------------------------------------------+
|i1 : M=(randomChainComplex({20,20},{20},ZeroMean=>true)).dd_1;               |
|                                                                             |
|              40       40                                                    |
|o1 : Matrix ZZ   <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i2 : (svds,U,Vt)=SVD(M**RR_53);                                              |
+-----------------------------------------------------------------------------+
|i3 : (entries matrix {svds})_0/log                                           |
|                                                                             |
|o3 = {6.37106, 6.31472, 6.27245, 6.10348, 6.02102, 5.98252, 5.92934, 5.83927,|
|     ------------------------------------------------------------------------|
|     5.72509, 5.63923, 5.51957, 5.51441, 5.45378, 5.3237, 5.14787, 5.11063,  |
|     ------------------------------------------------------------------------|
|     4.80679, 4.71988, 4.56427, 3.9834, -30.2198, -30.2438, -30.3018,        |
|     ------------------------------------------------------------------------|
|     -30.5182, -30.8016, -30.8016, -30.8016, -30.8016, -30.8016, -30.8016,   |
|     ------------------------------------------------------------------------|
|     -30.8016, -30.8016, -30.8016, -30.8016, -30.8016, -30.8016, -30.8016,   |
|     ------------------------------------------------------------------------|
|     -30.8016, -31.2522, -31.3015}                                           |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : maximalEntry M                                                          |
|                                                                             |
|o4 = 138                                                                     |
|                                                                             |
|o4 : RR (of precision 53)                                                    |
+-----------------------------------------------------------------------------+
|i5 : histogram(svds/log,10)                                                  |
|                                                                             |
|o5 = {20, 0, 0, 0, 0, 0, 0, 0, 0, 20}                                        |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : histogram(svds_{0..19}/log,10)                                          |
|                                                                             |
|o6 = {1, 0, 1, 2, 2, 1, 4, 2, 4, 3}                                          |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : histogram(svds_{20..39}/log,10)                                         |
|                                                                             |
|o7 = {2, 0, 0, 0, 14, 0, 0, 1, 0, 3}                                         |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use histogram:
======================

  * "histogram(List,ZZ)"

For the programmer
==================

The object histogram, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:456:0.

maximalEntry -- maximal absolute value of the entries of the matrix or matrices
*******************************************************************************

  * Usage:
        m = maximalEntries C
  * Inputs:
      * C, a chain complex (OldChainComplexes), or a
        Matrix (Macaulay2Doc), over ZZ, QQ, or RR
  * Outputs:
      * m, a list (Macaulay2Doc), of the maximal absolute values of
        the entries in matrices defining the differential

Description
===========

For each matrix we compute the of maximal absolute value of the entries

+------------------------------------------------------------------+
|i1 : setRandomSeed "nice example 2";                              |
| -- setting random seed to 12638458417381289481402307077          |
+------------------------------------------------------------------+
|i2 : C=randomChainComplex({1,1,1},{2,2},Height=>10)               |
|                                                                  |
|       3       5       3                                          |
|o2 = ZZ  <-- ZZ  <-- ZZ                                           |
|                                                                  |
|     0       1       2                                            |
|                                                                  |
|o2 : ChainComplex                                                 |
+------------------------------------------------------------------+
|i3 : C.dd                                                         |
|                                                                  |
|           3                              5                       |
|o3 = 0 : ZZ  <------------------------- ZZ  : 1                   |
|                | -14 -7  5 5   3   |                             |
|                | 8   13  1 -17 -21 |                             |
|                | -13 -15 1 18  21  |                             |
|                                                                  |
|           5                        3                             |
|     1 : ZZ  <------------------- ZZ  : 2                         |
|                | -11 5   -10 |                                   |
|                | 26  -29 37  |                                   |
|                | 19  -16 23  |                                   |
|                | -41 -1  -22 |                                   |
|                | 46  -16 38  |                                   |
|                                                                  |
|o3 : ChainComplexMap                                              |
+------------------------------------------------------------------+
|i4 : maximalEntry C                                               |
|                                                                  |
|o4 = {21, 46}                                                     |
|                                                                  |
|o4 : List                                                         |
+------------------------------------------------------------------+
|i5 : B=randomChainComplex({2,2,4,2,5,2,2},{2,3,3,2,3,3},Height=>5)|
|                                                                  |
|       4       7       10       7       10       8       5        |
|o5 = ZZ  <-- ZZ  <-- ZZ   <-- ZZ  <-- ZZ   <-- ZZ  <-- ZZ         |
|                                                                  |
|     0       1       2        3       4        5       6          |
|                                                                  |
|o5 : ChainComplex                                                 |
+------------------------------------------------------------------+
|i6 : maximalEntry B                                               |
|                                                                  |
|o6 = {6, 28, 14, 15, 16, 11}                                      |
|                                                                  |
|o6 : List                                                         |
+------------------------------------------------------------------+
|i7 : apply(min B..max B,i->rank HH_i(B**QQ))                      |
|                                                                  |
|o7 = (2, 2, 4, 2, 5, 2, 2)                                        |
|                                                                  |
|o7 : Sequence                                                     |
+------------------------------------------------------------------+

Ways to use maximalEntry:
=========================

  * "maximalEntry(ChainComplex)"
  * "maximalEntry(Matrix)"

For the programmer
==================

The object maximalEntry, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:385:0.

normalize -- normalize a ChainComplex over QQ or RR
***************************************************

  * Usage:
        B = normalize C
  * Inputs:
      * C, a chain complex (OldChainComplexes), over RR or
        QQ
  * Outputs:
      * B, a chain complex (OldChainComplexes), an
        isomorphic ChainComplex over QQ or RR

Description
===========

We divide each matrix by its entry of maximal absolute value, to obtain a
complex with entries of absolute size $\le 1$.

+----------------------------------------------------------+
|i1 : setRandomSeed "nice example 2";                      |
| -- setting random seed to 12638458417381289481402307077  |
+----------------------------------------------------------+
|i2 : C=randomChainComplex({1,1,1},{2,2})                  |
|                                                          |
|       3       5       3                                  |
|o2 = ZZ  <-- ZZ  <-- ZZ                                   |
|                                                          |
|     0       1       2                                    |
|                                                          |
|o2 : ChainComplex                                         |
+----------------------------------------------------------+
|i3 : C.dd                                                 |
|                                                          |
|           3                              5               |
|o3 = 0 : ZZ  <------------------------- ZZ  : 1           |
|                | -14 -7  5 5   3   |                     |
|                | 8   13  1 -17 -21 |                     |
|                | -13 -15 1 18  21  |                     |
|                                                          |
|           5                        3                     |
|     1 : ZZ  <------------------- ZZ  : 2                 |
|                | -11 5   -10 |                           |
|                | 26  -29 37  |                           |
|                | 19  -16 23  |                           |
|                | -41 -1  -22 |                           |
|                | 46  -16 38  |                           |
|                                                          |
|o3 : ChainComplexMap                                      |
+----------------------------------------------------------+
|i4 : B=normalize C                                        |
|                                                          |
|       3       5       3                                  |
|o4 = QQ  <-- QQ  <-- QQ                                   |
|                                                          |
|     0       1       2                                    |
|                                                          |
|o4 : ChainComplex                                         |
+----------------------------------------------------------+
|i5 : B.dd                                                 |
|                                                          |
|           3                                         5    |
|o5 = 0 : QQ  <------------------------------------ QQ  : 1|
|                | -2/3   -1/3  5/21 5/21   1/7 |          |
|                | 8/21   13/21 1/21 -17/21 -1  |          |
|                | -13/21 -5/7  1/21 6/7    1   |          |
|                                                          |
|           5                                 3            |
|     1 : QQ  <---------------------------- QQ  : 2        |
|                | -11/46 5/46   -5/23  |                  |
|                | 13/23  -29/46 37/46  |                  |
|                | 19/46  -8/23  1/2    |                  |
|                | -41/46 -1/46  -11/23 |                  |
|                | 1      -8/23  19/23  |                  |
|                                                          |
|o5 : ChainComplexMap                                      |
+----------------------------------------------------------+

Ways to use normalize:
======================

  * "normalize(ChainComplex)"

For the programmer
==================

The object normalize, is a method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:357:0.

randomChainComplex -- random chain complex over the integers with prescribed ranks of the homology group and ranks of the matrices
**********************************************************************************************************************************

  * Usage:
        C = randomChainComplex(h,r)
  * Inputs:
      * h, a list (Macaulay2Doc), of desired ranks of the homology
        groups, of some length $n$
      * r, a list (Macaulay2Doc), of desired ranks of the matrices
        in the complex, of length $n-1$
  * Optional inputs (Macaulay2Doc),:
      * Height => an integer (Macaulay2Doc), default value 10, the
        sizes of the random integers used
      * WithLLL => a Boolean value (Macaulay2Doc), default value
        true, use the LLL algorithm to keep the sizes of the integers small
      * ZeroMean => a Boolean value (Macaulay2Doc), default
        value true, whether to balance the random numbers around zero
  * Outputs:
      * C, a chain complex (OldChainComplexes), a random
        chain complex over the integers whose homology ranks match $h$, and
        whose matrices have ranks given by $r$

Description
===========

+------------------------------------------+
|i1 : h={1,4,6,5,1}                        |
|                                          |
|o1 = {1, 4, 6, 5, 1}                      |
|                                          |
|o1 : List                                 |
+------------------------------------------+
|i2 : r={1,3,3,4}                          |
|                                          |
|o2 = {1, 3, 3, 4}                         |
|                                          |
|o2 : List                                 |
+------------------------------------------+
|i3 : C=randomChainComplex(h,r)            |
|                                          |
|       2       8       12       12       5|
|o3 = ZZ  <-- ZZ  <-- ZZ   <-- ZZ   <-- ZZ |
|                                          |
|     0       1       2        3        4  |
|                                          |
|o3 : ChainComplex                         |
+------------------------------------------+
|i4 : prune HH C                           |
|                                          |
|           1                              |
|o4 = 0 : ZZ                               |
|                                          |
|           4                              |
|     1 : ZZ                               |
|                                          |
|           6                              |
|     2 : ZZ                               |
|                                          |
|           5                              |
|     3 : ZZ                               |
|                                          |
|           1                              |
|     4 : ZZ                               |
|                                          |
|o4 : GradedModule                         |
+------------------------------------------+
|i5 : for i from 0 to 4 list rank HH_i C   |
|                                          |
|o5 = {1, 4, 6, 5, 1}                      |
|                                          |
|o5 : List                                 |
+------------------------------------------+
|i6 : for i from 1 to 4 list rank(C.dd_i)  |
|                                          |
|o6 = {1, 3, 3, 4}                         |
|                                          |
|o6 : List                                 |
+------------------------------------------+

The optional argument Height chooses the maximum sizes of the random numbers
used. The actual numbers are somewhat larger (twice as many bits), as matrices
are multiplied together.

+-----------------------------------------------------------------------------+
|i7 : h={1,4,0,5,1}                                                           |
|                                                                             |
|o7 = {1, 4, 0, 5, 1}                                                         |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : r={2,3,3,4}                                                             |
|                                                                             |
|o8 = {2, 3, 3, 4}                                                            |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : C=randomChainComplex(h,r, Height=>1000)                                 |
|                                                                             |
|       3       9       6       12       5                                    |
|o9 = ZZ  <-- ZZ  <-- ZZ  <-- ZZ   <-- ZZ                                     |
|                                                                             |
|     0       1       2       3        4                                      |
|                                                                             |
|o9 : ChainComplex                                                            |
+-----------------------------------------------------------------------------+
|i10 : C.dd                                                                   |
|                                                                             |
|            3                                                                |
|o10 = 0 : ZZ  <--------------------------------------------------------------|
|                 | 44424  -8775 -2160 -53262  -62508  -10437 -6822  -62838  1|
|                 | 90516  14087 19368 -141214 -90936  2397   -10686 -117210 2|
|                 | 138645 31572 37098 -226521 -127899 11070  -15363 -176148 4|
|                                                                             |
|            9                                                              6 |
|      1 : ZZ  <--------------------------------------------------------- ZZ  |
|                 | 330985  16445   756805   1698     330472  348418  |       |
|                 | 713026  -154053 -42697   1538759  531828  793108  |       |
|                 | 1313518 -554313 -1321367 952247   994858  2800    |       |
|                 | 1504309 -561736 -934444  734919   1193028 74986   |       |
|                 | -566001 95813   3887     -1731404 -398918 -893718 |       |
|                 | -940456 315736  168999   191100   -803825 96554   |       |
|                 | -505191 256413  438512   888174   -448781 587460  |       |
|                 | -380977 341680  1286800  724845   -281448 878246  |       |
|                 | 1910440 -687155 -752920  2107     1588083 -178598 |       |
|                                                                             |
|            6                                                                |
|      2 : ZZ  <--------------------------------------------------------------|
|                 | 41388167  -95238274 5488161   12322184  -52314315 -1585451|
|                 | 9777314   29735878  8710464   42894623  -632054   -3113942|
|                 | 21143227  -17020460 17282979  975209    12792629  -2778763|
|                 | 20760737  -1043822  21170415  7109264   22491307  -3611535|
|                 | -40854113 120671920 421659    2171879   64292129  1029525 |
|                 | -47055725 11588622  -43668471 -17943160 -39150723 76088519|
|                                                                             |
|            12                                                         5     |
|      3 : ZZ   <---------------------------------------------------- ZZ  : 4 |
|                  | -2098931 -882197  -1197770 192505   -821100  |           |
|                  | -540649  1132991  -2558060 653635   -1393888 |           |
|                  | -1333740 3364752  -3624762 -4878996 2320266  |           |
|                  | -1425716 -2621421 1862275  564680   -64468   |           |
|                  | 1352058  -1470320 3544570  -96870   1495604  |           |
|                  | -121418  1868293  -1472318 -1881704 649512   |           |
|                  | -37268   -77123   -385029  440508   -259828  |           |
|                  | -469251  -460737  -885687  1959819  -1865142 |           |
|                  | -1299118 659729   -1037071 -1031938 -476574  |           |
|                  | 28821    -1464654 -120682  2377619  -941278  |           |
|                  | -857790  -1893725 2246803  -1115706 1519562  |           |
|                  | -1160441 -1211038 -190488  1500701  -1537374 |           |
|                                                                             |
|o10 : ChainComplexMap                                                        |
|-----------------------------------------------------------------------------|
|           9                                                                 |
|-------- ZZ  : 1                                                             |
|011  |                                                                       |
|4977 |                                                                       |
|5423 |                                                                       |
|                                                                             |
|                                                                             |
|: 2                                                                          |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                     12      |
|------------------------------------------------------------------ ZZ   : 3  |
|3 50425642  -29862626 -100716183 -78673592 -64535295 57729071  |             |
|4 6643135   83313808  -38773955  -56265921 3886477   -86494233 |             |
|5 -357149   9785294   -29488934  -28260935 -29357422 16504066  |             |
|9 -6466526  30843814  -27310181  -32178816 -24665021 -4404699  |             |
|  -57179939 69499514  98152576   65571655  71827928  -98294804 |             |
|  6825892   -62888800 68596487   76741536  56882559  6646445   |             |
+-----------------------------------------------------------------------------+
|i11 : C.dd^2 == 0                                                            |
|                                                                             |
|o11 = true                                                                   |
+-----------------------------------------------------------------------------+
|i12 : prune HH C                                                             |
|                                                                             |
|o12 = 0 : cokernel | 3 0 0 0 0 0 0 0 |                                       |
|                   | 0 0 0 0 0 0 0 0 |                                       |
|                                                                             |
|            4                                                                |
|      1 : ZZ                                                                 |
|                                                                             |
|      2 : cokernel | 64931150 0 0 0 0 0 0 0 0 |                              |
|                                                                             |
|      3 : cokernel | 6 |                                                     |
|                   | 0 |                                                     |
|                   | 0 |                                                     |
|                   | 0 |                                                     |
|                   | 0 |                                                     |
|                   | 0 |                                                     |
|                                                                             |
|            1                                                                |
|      4 : ZZ                                                                 |
|                                                                             |
|o12 : GradedModule                                                           |
+-----------------------------------------------------------------------------+
|i13 : for i from 0 to 4 list rank HH_i C                                     |
|                                                                             |
|o13 = {1, 4, 0, 5, 1}                                                        |
|                                                                             |
|o13 : List                                                                   |
+-----------------------------------------------------------------------------+
|i14 : for i from 1 to 4 list rank(C.dd_i)                                    |
|                                                                             |
|o14 = {2, 3, 3, 4}                                                           |
|                                                                             |
|o14 : List                                                                   |
+-----------------------------------------------------------------------------+

Caveat
======

This returns a chain complex over the integers.  Notice that if one gives h to
be a list of zeros, then that doesn't mean that the complex is exact, just that
the ranks are as expected.

See also
========

  * SVDComplexes -- support for computing homology,
    ranks and SVD complexes, for a chain complex over the real numbers

Ways to use randomChainComplex:
===============================

  * "randomChainComplex(List,List)"

For the programmer
==================

The object randomChainComplex, is a method function with options (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:304:0.

randomSimplicialComplex -- the chainComplex over ZZ of a random Stanley-Reisner simplicial complex
**************************************************************************************************

  * Usage:
        C = randomSimplicialComplex(k,n)
  * Inputs:
      * k, an integer (Macaulay2Doc),
      * n, an integer (Macaulay2Doc),
  * Outputs:
      * C, a chain complex (OldChainComplexes), the
        chainComplex of the Stanley-Reisner simplicial complex of a random
        square free monomial ideal in k+1 variables and n generators

Description
===========

We compute the simplicial complex associated to a square free monomial ideal in
k+1 variables whose n generators we choose randomly among the square free
monomials.

+--------------------------------------------------------+
|i1 : setRandomSeed "nice example 2";                    |
| -- setting random seed to 12638458417381289481402307077|
+--------------------------------------------------------+
|i2 : C = randomSimplicialComplex(7,20)                  |
|                                                        |
|       8       24       34       21       3             |
|o2 = ZZ  <-- ZZ   <-- ZZ   <-- ZZ   <-- ZZ              |
|                                                        |
|     0       1        2        3        4               |
|                                                        |
|o2 : ChainComplex                                       |
+--------------------------------------------------------+
|i3 : prune HH C                                         |
|                                                        |
|           1                                            |
|o3 = 0 : ZZ                                             |
|                                                        |
|     1 : 0                                              |
|                                                        |
|     2 : 0                                              |
|                                                        |
|           1                                            |
|     3 : ZZ                                             |
|                                                        |
|     4 : 0                                              |
|                                                        |
|o3 : GradedModule                                       |
+--------------------------------------------------------+

See also
========

  * SVDComplexes -- support for computing homology,
    ranks and SVD complexes, for a chain complex over the real numbers

Ways to use randomSimplicialComplex:
====================================

  * "randomSimplicialComplex(ZZ,ZZ)"

For the programmer
==================

The object randomSimplicialComplex, is a
method function (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:332:0.

testTimeForLLLonSyzygies -- test timing for LLL on syzygies
***********************************************************

  * Usage:
        (m,t1,t2)=testTimeForLLLonSyzygies(r,n,Height=>100)
  * Inputs:
      * r, an integer (Macaulay2Doc),
      * n, an integer (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Height => an integer (Macaulay2Doc), default value 11, the
        sizes of the random integers used
  * Outputs:
      * m, a list (Macaulay2Doc), of maximal absolute values of the
        entries of A, B and the LLL basis of B
      * t1, a real number (Macaulay2Doc), the time in seconds to
        compute B = ker A
      * t2, a real number (Macaulay2Doc), the time to compute the LLL
        basis of B

Description
===========

We randomly choose an $r \times\ n$ matrix A over ZZ with entries up to the
given Height, and take the time to compute B=ker A and an LLL basis of B.

+-----------------------------------------------------------------------------+
|i1 : setRandomSeed "nice example 2";                                         |
| -- setting random seed to 12638458417381289481402307077                     |
+-----------------------------------------------------------------------------+
|i2 : r=10,n=20                                                               |
|                                                                             |
|o2 = (10, 20)                                                                |
|                                                                             |
|o2 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i3 : (m,t1,t2)=testTimeForLLLonSyzygies(r,n,Height=>11)                      |
|                                                                             |
|o3 = ({5, 2.91596e52, 9}, .00216583, .00107802)                              |
|                                                                             |
|o3 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i4 : (m,t1,t2)=testTimeForLLLonSyzygies(15,30,Height=>100)                   |
|                                                                             |
|o4 = ({50, 2.30853e454, 98}, .00605937, .0513555)                            |
|                                                                             |
|o4 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i5 : L=apply(10,c->(testTimeForLLLonSyzygies(15,30))_{1,2})                  |
|                                                                             |
|o5 = {{.0067549, .0163353}, {.00612565, .0054433}, {.006536, .00928255},     |
|     ------------------------------------------------------------------------|
|     {.00687021, .0139588}, {.00688534, .0189551}, {.0699444, .0174614},     |
|     ------------------------------------------------------------------------|
|     {.00588217, .00978539}, {.00596261, .00894694}, {.0051028, .00644302},  |
|     ------------------------------------------------------------------------|
|     {.00688253, .0110051}}                                                  |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : 1/10*sum(L,t->t_0)                                                      |
|                                                                             |
|o6 = .01269466270000006                                                      |
|                                                                             |
|o6 : RR (of precision 53)                                                    |
+-----------------------------------------------------------------------------+
|i7 : 1/10*sum(L,t->t_1)                                                      |
|                                                                             |
|o7 = .01176169510000005                                                      |
|                                                                             |
|o7 : RR (of precision 53)                                                    |
+-----------------------------------------------------------------------------+

Ways to use testTimeForLLLonSyzygies:
=====================================

  * "testTimeForLLLonSyzygies(ZZ,ZZ)"

For the programmer
==================

The object testTimeForLLLonSyzygies, is a
method function with options (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:492:0.

WithLLL -- Option for randomComplex
***********************************

Description
===========

If WithLLL=>true then syzygy matrices of the randomly chosen matrices are
improved for their Height by applying the LLL algorithm.

Functions with optional argument named WithLLL:
===============================================

  * "randomChainComplex(...,WithLLL=>...)" -- see randomChainComplex,
    -- random chain complex over the integers with
    prescribed ranks of the homology group and ranks of the matrices

For the programmer
==================

The object WithLLL, is a symbol (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:513:0.

ZeroMean -- Option for randomComplex
************************************

Description
===========

If ZeroMean=>true then the integer of given Height values are randomly chosen
with a zero mean

Functions with optional argument named ZeroMean:
================================================

  * "randomChainComplex(...,ZeroMean=>...)" -- see randomChainComplex,
    -- random chain complex over the integers with
    prescribed ranks of the homology group and ranks of the matrices

For the programmer
==================

The object ZeroMean, is a symbol (Macaulay2Doc).

-------------------------------------------------------------------------------

The source of this document is in RandomComplexes.m2:502:0.