This is RandomCurves.info, produced by Macaulay2, version 1.26.06

RandomCurves -- constructing random curves in various ways
**********************************************************

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

A RandomObject in this sense is a hashTable consisting of two functions, one
that can construct a random point and the other that can certify that the thing
constructed has the desired property, say being a smooth space curve of the
desired genus and degree. This is employed through a call such as random
spaceCurve, which returns the constructor function; thus to get a random curve
of degree d and genus g one must do something like

(random spaceCurve)(d,g,R)

where R is the homogeneous coordinate ring of P^3.

For a different approach, see the package SpaceCurves; there  special curves in
P^3 of every  genus and degree that is allowed by Castelnuovo's theorem are
constructed on surfaces of degree <=4, following the Theorem of Gruson and
Peskine.

This package provides the construction of random curves $C \subset \mathbb{P}^{
3}$ for various values for its degree $d$ and genus $g$. A space curve $C
\subset \mathbb{P}^{ 3}$ is constructed via its Hartshorne-Rao module $M=
H^1_*(\mathcal{I}_C(n))$. In particular, there are constructions for random
points in $M_g$ for $g=11,12,13$.

For a algorithms and theoretical background see Needles in a Haystack (see
https://macaulay2.com/Book/ )

This package also generates random nodal plane curves and provides related
methods.

Also In this package the unirationality construction of the moduli space
$M_{14}$ of curves of genus 14 due to Verra is implemented. The main references
are

\ \ \ \ \ [Mu] S. Mukai, Curves, $K3$ surfaces and Fano $3$-folds of genus
$\leq 10$. Algebraic geometry and commutative algebra, Vol. I, 357-377,
Kinokuniya, Tokyo, 1988.

\ \ \ \ \ [Ve] A. Verra, The unirationality of the moduli spaces of curves of
genus 14 or lower. Compos. Math. 141 (2005), no. 6, 1425-1444.

Also This package bundles the constructions for random points in the moduli
spaces of curves $M_g$ for $g \leq 14$ based on the proofs of unirationality of
$M_g$ by Severi, Sernesi, Chang-Ran and Verra.

Further, it provides for random canonical curves made from nodal plane curves.

For random smooth curves defined over very small fields, see the package
RandomCurvesOverVerySmallFiniteFields

Authors
=======

  * Hans-Christian Graf v. Bothmer (see
    https://www.math.uni-hamburg.de/personen/bothmer/ ) <hcvbothmer@gmail.com>
  * Florian Geiss (see https://www.math.uni-sb.de/ag/schreyer/ )
    <fg@math.uni-sb.de>
  * Frank-Olaf Schreyer (see https://www.math.uni-sb.de/ag/schreyer/ )
    <schreyer@math.uni-sb.de>

Version
=======

This documentation describes version 1.0 of RandomCurves, released March 1,
2011, updated and combined on June 8, 2026 by D Eisenbud.

Citation
========

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

+-----------------------------------------------------------------------------+
|@misc{RandomCurvesSource,                                                    |
|  title = {{RandomCurves: random smooth curves up to genus 14. Version~1.0}},|
|  author = {Hans-Christian Graf v. Bothmer and Florian Geiss and Frank-Olaf S|
|  howpublished = {A \emph{Macaulay2} package available at                    |
|    \url{https://github.com/Macaulay2/M2/tree/stable/M2/Macaulay2/packages}} |
|}                                                                            |
|-----------------------------------------------------------------------------|
|chreyer},                                                                    |
+-----------------------------------------------------------------------------+

Exports
=======

  * Functions and commands
      * completeLinearSystemOnNodalPlaneCurve
        -- Compute the complete linear
        system of a divisor on a nodal plane curve
      * expectedBetti -- compute the expected betti table
        from the Hilbert numerator
      * hilbertNumerator -- calculate Hilbert
        numerator from Hilbert function
      * imageUnderRationalMap -- Compute the
        image of the scheme under a rational map
      * knownUnirationalComponentOfSpaceCurves
        -- check whether there is a
        unirational construction for a component of the Hilbert scheme of space
        curves
      * randomCanonicalCurveGenus8with8Points
        -- Compute a random canonical
        curve of genus 8 with 8 marked point
      * randomCurveGenus8Degree14inP6, --
        Compute a random normal curve of genus g=8 and degree 14 in \PP^6
      * randomCurveGenus14Degree18inP6,
        -- Compute a random curve of genus 14 of Degree 18 in \PP^6
  * Methods
      * certifyHartshorneRaoModule(Module,ZZ,List,PolynomialRing) (missing
        documentation)
      * certifyRandomSpaceCurve(Ideal,ZZ,ZZ,PolynomialRing) (missing
        documentation)
      * "completeLinearSystemOnNodalPlaneCurve(Ideal,List)" -- see
        completeLinearSystemOnNodalPlaneCurve,
        -- Compute the complete linear
        system of a divisor on a nodal plane curve
      * constructHartshorneRaoModule(ZZ,List,PolynomialRing) (missing
        documentation)
      * "expectedBetti(RingElement)" -- see expectedBetti,
        -- compute the expected betti table from the Hilbert numerator
      * expectedBetti(List,ZZ) -- compute
        the expected betti table from the Hilbert numerator
      * expectedBetti(ZZ,ZZ,ZZ), --
        compute the expected betti table from the Hilbert numerator
      * "hilbertNumerator(List,ZZ,RingElement)" -- see hilbertNumerator,
        -- calculate Hilbert numerator from Hilbert function
      * "imageUnderRationalMap(Ideal,Matrix)" -- see
        imageUnderRationalMap, -- Compute the image of
        the scheme under a rational map
      * "knownUnirationalComponentOfSpaceCurves(ZZ,ZZ)" -- see
        knownUnirationalComponentOfSpaceCurves,
        -- check whether there is a
        unirational construction for a component of the Hilbert scheme of space
        curves
      * "randomCanonicalCurveGenus8with8Points(PolynomialRing)" -- see
        randomCanonicalCurveGenus8with8Points,
        -- Compute a random canonical
        curve of genus 8 with 8 marked point
      * "randomCurveGenus8Degree14inP6(PolynomialRing)" -- see
        randomCurveGenus8Degree14inP6, --
        Compute a random normal curve of genus g=8 and degree 14 in \PP^6
      * "randomCurveGenus14Degree18inP6(PolynomialRing)" -- see
        randomCurveGenus14Degree18inP6, --
        Compute a random curve of genus 14 of Degree 18 in \PP^6
      * randomSpaceCurve(ZZ,ZZ,PolynomialRing) (missing documentation)
  * Other things
      * canonicalCurve -- Compute a random canonical
        curve of genus less or equal to 14
      * canonicalCurveGenus14 -- compute a random
        curve of genus 14 in its canonical embedding
      * curveGenus14Degree18inP6 -- compute a
        random curve of genus 14 and degree 18 in $\mathbb{P}^6$
      * distinctPlanePoints -- Generates the ideal
        of k random points in the coordinate ring $R$ of $\\P^{ 2}$
      * hartshorneRaoModule -- Compute a random
        Hartshorne-Rao module
      * nodalPlaneCurve -- get a random nodal plane
        curve
      * spaceCurve -- constructs a RandomObject that can be
        used to construct a space curve.

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

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

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

The source of this document is in RandomCurves.m2:891:0.

canonicalCurve -- Compute a random canonical curve of genus less or equal to 14
*******************************************************************************

  * Usage:
        I=(random canonicalCurve)(g,S)
  * Inputs:
      * g, an integer (Macaulay2Doc), the genus
      * R, a polynomial ring (Macaulay2Doc), homogeneous
        coordinate ring of $\PP^{ g-1}$
  * Outputs:
      * I, an ideal (Macaulay2Doc), of a canonical curve $C$ of
        genus $g$

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

Compute a random canonical curve of genus $g \le{} 14$, based on the proofs of
unirationality of $M_g$ by Severi, Sernesi, Chang-Ran and Verra.

+---------------------------------------------------+
|i1 : setRandomSeed "alpha";                        |
| -- setting random seed to 10206284518             |
+---------------------------------------------------+
|i2 : g=14;                                         |
+---------------------------------------------------+
|i3 : FF=ZZ/10007;                                  |
+---------------------------------------------------+
|i4 : R=FF[x_0..x_(g-1)];                           |
+---------------------------------------------------+
|i5 : time betti(I=(random canonicalCurve)(g,R))    |
| -- used 10.6304s (cpu); 7.96672s (thread); 0s (gc)|
|                                                   |
|            0  1                                   |
|o5 = total: 1 66                                   |
|         0: 1  .                                   |
|         1: . 66                                   |
|                                                   |
|o5 : BettiTally                                    |
+---------------------------------------------------+
|i6 : genus I == g and degree I ==2*g-2             |
|                                                   |
|o6 = true                                          |
+---------------------------------------------------+

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

The object canonicalCurve, is an instance of the type
RandomObject (RandomObjects).

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

The source of this document is in RandomCurves.m2:1500:0.

canonicalCurveGenus14 -- compute a random curve of genus 14 in its canonical embedding
**************************************************************************************

  * Usage:
        (random canonicalCurveGenus14)(R)
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), coordinate
        ring of $\mathbb{P}^13$
  * Outputs:
      * an ideal (Macaulay2Doc), in R, ideal of the canonical
        curve

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

+-----------------------------------------+
|i1 : setRandomSeed("alpha");             |
| -- setting random seed to 10206284518   |
+-----------------------------------------+
|i2 : R=ZZ/101[x_0..x_13];                |
+-----------------------------------------+
|i3 : C=(random canonicalCurveGenus14)(R);|
|                                         |
|o3 : Ideal of R                          |
+-----------------------------------------+
|i4 : (dim C, degree C, genus C)          |
|                                         |
|o4 = (2, 26, 14)                         |
|                                         |
|o4 : Sequence                            |
+-----------------------------------------+

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

The object canonicalCurveGenus14, is an instance
of the type RandomObject (RandomObjects).

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

The source of this document is in RandomCurves.m2:1349:0.

completeLinearSystemOnNodalPlaneCurve -- Compute the complete linear system of a divisor on a nodal plane curve
***************************************************************************************************************

  * Usage:
        (L,h)=completeLinearSystemOnNodalPlaneCurve(I,D)
  * Inputs:
      * I, an ideal (Macaulay2Doc), of a nodal plane curve C,
      * D, a list (Macaulay2Doc), \{D_0,D_1\}\ of ideals
        representing effective divisors on C
  * Outputs:
      * L, a matrix (Macaulay2Doc), of homogeneous forms with 1
        row and with number of columns equal to $h^0(D_0-D_1)$
      * h, a ring element (Macaulay2Doc), such that
        L_{(0,i)}/h represents a basis of $H^0 O(D_0-D_1)$

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

Compute the complete linear series of D_0-D_1 on the normalization of C via
adjoint curves and double linkage.

+-----------------------------------------------------------------------------+
|i1 : setRandomSeed("alpha");                                                 |
| -- setting random seed to 10206284518                                       |
+-----------------------------------------------------------------------------+
|i2 : R=ZZ/32003[x_0..x_2];                                                   |
+-----------------------------------------------------------------------------+
|i3 : J=(random nodalPlaneCurve)(6,3,R);                                      |
|                                                                             |
|o3 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i4 : D={J+ideal random(R^1,R^{1:-3}),J+ideal 1_R};                           |
+-----------------------------------------------------------------------------+
|i5 : l=completeLinearSystemOnNodalPlaneCurve(J,D)                            |
|                                                                             |
|                                                                             |
|o5 = (| x_1^2x_2^3-15905x_0x_2^4-3127x_1x_2^4-14505x_2^5                     |
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     x_1^3x_2^2-15905x_0x_1x_2^3-2273x_0x_2^4+284x_1x_2^4-8884x_2^5          |
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     x_0x_1^2x_2^2-15905x_0^2x_2^3-3127x_0x_1x_2^3-14505x_0x_2^4             |
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     x_1^4x_2+14690x_0^2x_2^3-4546x_0x_1x_2^3+12199x_0x_2^4+15103x_1x_2^4-   |
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     8967x_2^5 x_0x_1^3x_2-15905x_0^2x_1x_2^2-2273x_0^2x_2^3+284x_0x_1x_2^3- |
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     8884x_0x_2^4 x_0^2x_1^2x_2-15905x_0^3x_2^2-3127x_0^2x_1x_2^2-14505x_0^2x|
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     _2^3 x_1^5+14690x_0^2x_1x_2^2-9353x_0^2x_2^3+6189x_0x_1x_2^3-14853x_0x_2|
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     ^4+13689x_1x_2^4+8480x_2^5                                              |
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     x_0x_1^4+14690x_0^3x_2^2-4546x_0^2x_1x_2^2+12199x_0^2x_2^3+15103x_0x_1x_|
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     2^3-8967x_0x_2^4 x_0^2x_1^3-15905x_0^3x_1x_2-2273x_0^3x_2^2+284x_0^2x_1x|
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     _2^2-8884x_0^2x_2^3 x_0^3x_1^2-15905x_0^4x_2-3127x_0^3x_1x_2-14505x_0^3x|
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     _2^2 x_0^4x_1-11073x_0^4x_2-14059x_0^3x_1x_2-14725x_0^3x_2^2+15715x_0^2x|
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     _1x_2^2+5589x_0^2x_2^3-5681x_0x_1x_2^3+9449x_0x_2^4-752x_1x_2^4-4257x_2^|
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                             |
|     5 x_0^5-11952x_0^4x_2+4264x_0^3x_1x_2-13256x_0^3x_2^2-8472x_0^2x_1x_2^2-|
|                                                                             |
|     ------------------------------------------------------------------------|
|                                                                          3 2|
|     1481x_0^2x_2^3+1434x_0x_1x_2^3-x_0x_2^4-13158x_1x_2^4-15984x_2^5 |, x x |
|                                                                          0 1|
|     ------------------------------------------------------------------------|
|            2 3           4         5         4          3            2 2    |
|     + 7632x x  - 14167x x  + 15007x  - 15905x x  - 2708x x x  + 2874x x x  +|
|            0 1         0 1         1         0 2        0 1 2        0 1 2  |
|     ------------------------------------------------------------------------|
|             3          4          3 2     2   2           2 2         3 2   |
|     10670x x x  + 8250x x  + 7181x x  - 3x x x  + 15061x x x  - 15223x x  - |
|           0 1 2        1 2        0 2     0 1 2         0 1 2         1 2   |
|     ------------------------------------------------------------------------|
|           2 3            3        2 3          4           4        5       |
|     10388x x  + 6271x x x  - 2509x x  + 7640x x  - 14385x x  - 1297x )      |
|           0 2        0 1 2        1 2        0 2         1 2        2       |
|                                                                             |
|o5 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i6 : C=imageUnderRationalMap(J,l_0);                                         |
|                                                                             |
|                ZZ                                                           |
|o6 : Ideal of -----[x ..x  ]                                                 |
|              32003  0   11                                                  |
+-----------------------------------------------------------------------------+
|i7 : (dim C, degree C, genus C)                                              |
|                                                                             |
|o7 = (2, 18, 7)                                                              |
|                                                                             |
|o7 : Sequence                                                                |
+-----------------------------------------------------------------------------+

See also
========

  * nodalPlaneCurve -- get a random nodal plane curve
  * imageUnderRationalMap -- Compute the image of
    the scheme under a rational map

Ways to use completeLinearSystemOnNodalPlaneCurve:
==================================================

  * "completeLinearSystemOnNodalPlaneCurve(Ideal,List)"

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

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

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

The source of this document is in RandomCurves.m2:1297:0.

curveGenus14Degree18inP6 -- compute a random curve of genus 14 and degree 18 in $\mathbb{P}^6$
**********************************************************************************************

  * Usage:
        (random curveGenus14Degree18inP6)(R)
  * Inputs:
      * R, a polynomial ring (Macaulay2Doc), coordinate
        ring of $\PP^6$
  * Outputs:
      * an ideal (Macaulay2Doc), in R, ideal of the curve

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

+--------------------------------------------+
|i1 : setRandomSeed("alpha");                |
| -- setting random seed to 10206284518      |
+--------------------------------------------+
|i2 : R=ZZ/101[x_0..x_6];                    |
+--------------------------------------------+
|i3 : C=(random curveGenus14Degree18inP6)(R);|
|                                            |
|o3 : Ideal of R                             |
+--------------------------------------------+
|i4 : (dim C, degree C, genus C)             |
|                                            |
|o4 = (2, 18, 14)                            |
|                                            |
|o4 : Sequence                               |
+--------------------------------------------+

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

The object curveGenus14Degree18inP6, is an
instance of the type RandomObject (RandomObjects).

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

The source of this document is in RandomCurves.m2:1371:0.

distinctPlanePoints -- Generates the ideal of k random points in the coordinate ring $R$ of $\\P^{ 2}$
******************************************************************************************************

  * Usage:
        (random distinctPlanePoints)(k,R)
  * Inputs:
      * k, an integer (Macaulay2Doc), the number of points
      * R, a polynomial ring (Macaulay2Doc), the
        homogeneous coordinate ring of $\mathbb{P}^2$
  * Outputs:
      * an ideal (Macaulay2Doc), the vanishing ideal of the points

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

Creates the ideal of the points via a random choice of their Hilbert-Burch
matrix, which is taken to be of generic shape.

+---------------------------------------------+
|i1 : setRandomSeed("alpha");                 |
| -- setting random seed to 10206284518       |
+---------------------------------------------+
|i2 : R=ZZ/32003[x_0..x_2];                   |
+---------------------------------------------+
|i3 : Ipts=(random distinctPlanePoints)(10,R);|
|                                             |
|o3 : Ideal of R                              |
+---------------------------------------------+
|i4 : betti res Ipts                          |
|                                             |
|            0 1 2                            |
|o4 = total: 1 5 4                            |
|         0: 1 . .                            |
|         1: . . .                            |
|         2: . . .                            |
|         3: . 5 4                            |
|                                             |
|o4 : BettiTally                              |
+---------------------------------------------+

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

The object distinctPlanePoints, is an instance of
the type RandomObject (RandomObjects).

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

The source of this document is in RandomCurves.m2:1205:0.

expectedBetti -- compute the expected betti table from the Hilbert numerator
****************************************************************************

  * Usage:
        B=expectedBetti q
  * Inputs:
      * q, a ring element (Macaulay2Doc), a polynomial in
        ZZ[t]
  * Outputs:
      * B, a Betti tally (Macaulay2Doc), a Betti table that
        has Hilbert numerator q, assuming that each sign change in the
        coefficients of q corresponds to a step

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

calculates the expected betti table  from a given Hilbert Numerator.

+-------------------------+
|i1 : T=ZZ[t]             |
|                         |
|o1 = T                   |
|                         |
|o1 : PolynomialRing      |
+-------------------------+
|i2 : q=1-3*t^2+2*t^3     |
|                         |
|       3     2           |
|o2 = 2t  - 3t  + 1       |
|                         |
|o2 : T                   |
+-------------------------+
|i3 : expectedBetti q     |
|                         |
|            0 1 2        |
|o3 = total: 1 3 2        |
|         0: 1 . .        |
|         1: . 3 2        |
|                         |
|o3 : BettiTally          |
+-------------------------+
|i4 : q=1-5*t^2+5*t^3-t^5 |
|                         |
|        5     3     2    |
|o4 = - t  + 5t  - 5t  + 1|
|                         |
|o4 : T                   |
+-------------------------+
|i5 : expectedBetti q     |
|                         |
|            0 1 2 3      |
|o5 = total: 1 5 5 1      |
|         0: 1 . . .      |
|         1: . 5 5 .      |
|         2: . . . 1      |
|                         |
|o5 : BettiTally          |
+-------------------------+

Ways to use expectedBetti:
==========================

  * "expectedBetti(RingElement)"
  * expectedBetti(List,ZZ) -- compute the
    expected betti table from the Hilbert numerator
  * expectedBetti(ZZ,ZZ,ZZ) -- compute
    the expected betti table from the Hilbert numerator

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

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

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

The source of this document is in RandomCurves.m2:1100:0.

expectedBetti(List,ZZ) -- compute the expected betti table from the Hilbert numerator
*************************************************************************************

  * Function: expectedBetti,
  * Usage:
        B=expectedBetti(h,r)
  * Inputs:
      * h, a list (Macaulay2Doc), values of the Hilbert function
      * r, an integer (Macaulay2Doc), dimension of ambient protective
        space
  * Outputs:
      * B, a Betti tally (Macaulay2Doc), expected Betti table
        of module with Hilbert function h

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

+-----------------------------------------------+
|i1 : betti expectedBetti({0,0,4,6,3,0,0,0,0},3)|
|                                               |
|            0  1  2 3 4                        |
|o1 = total: 4 10 11 8 3                        |
|         2: 4 10  3 . .                        |
|         3: .  .  8 2 .                        |
|         4: .  .  . 6 3                        |
|                                               |
|o1 : BettiTally                                |
+-----------------------------------------------+

Caveat
======

The Hilbert function has to be given at positions 0 to d+r+1 where d is the
regularity of the considered variety

Ways to use this method:
========================

  * expectedBetti(List,ZZ) -- compute the
    expected betti table from the Hilbert numerator
-------------------------------------------------------------------------------

The source of this document is in RandomCurves.m2:1142:0.

expectedBetti(ZZ,ZZ,ZZ) -- compute the expected betti table from the Hilbert numerator
**************************************************************************************

  * Function: expectedBetti,
  * Usage:
        B=expectedBetti(g,r,d)
  * Inputs:
      * g, an integer (Macaulay2Doc), the genus
      * r, an integer (Macaulay2Doc), dimension of $\PP^{ r}$
      * d, an integer (Macaulay2Doc), the degree
  * Outputs:
      * B, a Betti tally (Macaulay2Doc), a Betti table that
        has Hilbert numerator the same as for a nondegenerate maximal-rank
        curve of genus g and degree d in $\PP^{ r}$, with O_C(2) non-special.

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

+---------------------------------+
|i1 : betti expectedBetti(0,4,4)  |
|                                 |
|            0 1 2 3              |
|o1 = total: 1 6 8 3              |
|         0: 1 . . .              |
|         1: . 6 8 3              |
|                                 |
|o1 : BettiTally                  |
+---------------------------------+
|i2 : betti expectedBetti(16,3,15)|
|                                 |
|            0 1  2 3             |
|o2 = total: 1 9 12 4             |
|         0: 1 .  . .             |
|         1: . .  . .             |
|         2: . .  . .             |
|         3: . .  . .             |
|         4: . .  . .             |
|         5: . 9  6 .             |
|         6: . .  6 4             |
|                                 |
|o2 : BettiTally                  |
+---------------------------------+

Ways to use this method:
========================

  * expectedBetti(ZZ,ZZ,ZZ) -- compute
    the expected betti table from the Hilbert numerator
-------------------------------------------------------------------------------

The source of this document is in RandomCurves.m2:1122:0.

hartshorneRaoModule -- Compute a random Hartshorne-Rao module
*************************************************************

  * Usage:
        (random hartshorneRaoModule)(e,HRao,R)
  * Inputs:
      * e, an integer (Macaulay2Doc), smallest degree of the
        Hartshorne-Rao module
      * HRao, a list (Macaulay2Doc), desired dimensions of
        $H^1(\PP^3,I_C(n))$
      * R, a polynomial ring (Macaulay2Doc), coordinate
        ring of $\PP^{ 3}$
  * Outputs:
      * a module (Macaulay2Doc),

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

Returns the Hartshorne-Rao Module over R with Hilbert function HRao and
expected betti table. The constructions works only for many modules with
diameter {\le} 3.

+--------------------------------------------------------+
|i1 : setRandomSeed("alpha");                            |
| -- setting random seed to 10206284518                  |
+--------------------------------------------------------+
|i2 : R = ZZ/101[x_0..x_3];                              |
+--------------------------------------------------------+
|i3 : betti res (random hartshorneRaoModule)(0,{1},R)    |
|                                                        |
|            0 1 2 3 4                                   |
|o3 = total: 1 4 6 4 1                                   |
|         0: 1 4 6 4 1                                   |
|                                                        |
|o3 : BettiTally                                         |
+--------------------------------------------------------+
|i4 : betti res (random hartshorneRaoModule)(0,{1,4},R)  |
|                                                        |
|            0  1  2  3 4                                |
|o4 = total: 1 10 20 15 4                                |
|         0: 1  .  .  . .                                |
|         1: . 10 20 15 4                                |
|                                                        |
|o4 : BettiTally                                         |
+--------------------------------------------------------+
|i5 : betti res (random hartshorneRaoModule)(0,{1,4,1},R)|
|                                                        |
|            0 1  2 3 4                                  |
|o5 = total: 1 9 16 9 1                                  |
|         0: 1 .  . . .                                  |
|         1: . 9 16 9 .                                  |
|         2: . .  . . 1                                  |
|                                                        |
|o5 : BettiTally                                         |
+--------------------------------------------------------+
|i6 : betti res (random hartshorneRaoModule)(0,{1,4,2},R)|
|                                                        |
|            0 1  2 3 4                                  |
|o6 = total: 1 8 12 7 2                                  |
|         0: 1 .  . . .                                  |
|         1: . 8 12 3 .                                  |
|         2: . .  . 4 2                                  |
|                                                        |
|o6 : BettiTally                                         |
+--------------------------------------------------------+

There are the following options:

* Attempts => ...  a nonnegative integer or infinity (default) that limits the
maximal number of attempts for the construction of the module

* Certify => ...  true or false (default) checks whether the constructed module
has the expected betti Table

+-----------------------------------------------------------------------------+
|i7 : setRandomSeed("alpha");                                                 |
| -- setting random seed to 10206284518                                       |
+-----------------------------------------------------------------------------+
|i8 : betti res (random hartshorneRaoModule)(0,{1,3,2},R)                     |
|                                                                             |
|            0 1 2 3 4                                                        |
|o8 = total: 1 5 9 7 2                                                        |
|         0: 1 1 . . .                                                        |
|         1: . 4 6 2 .                                                        |
|         2: . . 3 5 2                                                        |
|                                                                             |
|o8 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i9 : expectedBetti({1,3,2,0,0,0,0},3)                                        |
|                                                                             |
|            0 1 2 3 4                                                        |
|o9 = total: 1 5 7 5 2                                                        |
|         0: 1 1 . . .                                                        |
|         1: . 4 6 . .                                                        |
|         2: . . 1 5 2                                                        |
|                                                                             |
|o9 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i10 : null =!= (random hartshorneRaoModule)(0,{1,3,2},R)                     |
|                                                                             |
|o10 = true                                                                   |
+-----------------------------------------------------------------------------+
|i11 : null =!= (random hartshorneRaoModule)(0,{1,3,2},R,Certify=>true,       |
|                                                                             |
|o11 = false                                                                  |
|-----------------------------------------------------------------------------|
|Attempts=>1)                                                                 |
+-----------------------------------------------------------------------------+

if Certify => true and Attempts=>infinity (the default!) are given in this
example, the construction never stops.

Caveat
======

The list HRao needs only to contain the non-zero values of the Hilbert
function.

See also
========

  * spaceCurve -- constructs a RandomObject that can be used
    to construct a space curve.
  * knownUnirationalComponentOfSpaceCurves
    -- check whether there is a
    unirational construction for a component of the Hilbert scheme of space
    curves

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

The object hartshorneRaoModule, is an instance of
the type RandomObject (RandomObjects).

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

The source of this document is in RandomCurves.m2:1073:0.

hilbertNumerator -- calculate Hilbert numerator from Hilbert function
*********************************************************************

  * Usage:
        p=hilbertNumerator(L,r,t)
  * Inputs:
      * L, a list (Macaulay2Doc), values of the Hilbert function
      * r, an integer (Macaulay2Doc), dimension of ambient projective
        space
      * t, a ring element (Macaulay2Doc), variable in which
        the hilbertNumerator is given

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

+----------------------------------------------+
|i1 : T=QQ[t];                                 |
+----------------------------------------------+
|i2 : hilbertNumerator({0,0,4,6,3,0,0,0,0},3,t)|
|                                              |
|       8     7     6     5     4      3     2 |
|o2 = 3t  - 6t  - 2t  + 8t  + 3t  - 10t  + 4t  |
|                                              |
|o2 : T                                        |
+----------------------------------------------+

Caveat
======

The Hilbert function has to be given at positions 0 to d+r+1 where d is the
regularity of the considered variety

Ways to use hilbertNumerator:
=============================

  * "hilbertNumerator(List,ZZ,RingElement)"

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

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

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

The source of this document is in RandomCurves.m2:1167:0.

imageUnderRationalMap -- Compute the image of the scheme under a rational map
*****************************************************************************

  * Usage:
        I = imageUnderRationalMap(J,L)
  * Inputs:
      * J, an ideal (Macaulay2Doc), in a polynomial ring
      * L, a matrix (Macaulay2Doc), of homogeneous polynomials of
        equal degrees
  * Outputs:
      * I, an ideal (Macaulay2Doc), of the image of the scheme
        defined by J under the rational map defined by L

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

+-----------------------------------------------------------+
|i1 : setRandomSeed("alpha");                               |
| -- setting random seed to 10206284518                     |
+-----------------------------------------------------------+
|i2 : p=nextPrime 10000                                     |
|                                                           |
|o2 = 10007                                                 |
+-----------------------------------------------------------+
|i3 : kk=ZZ/p                                               |
|                                                           |
|o3 = kk                                                    |
|                                                           |
|o3 : QuotientRing                                          |
+-----------------------------------------------------------+
|i4 : R=kk[t_0,t_1]                                         |
|                                                           |
|o4 = R                                                     |
|                                                           |
|o4 : PolynomialRing                                        |
+-----------------------------------------------------------+
|i5 : I=ideal 0_R                                           |
|                                                           |
|o5 = ideal 0                                               |
|                                                           |
|o5 : Ideal of R                                            |
+-----------------------------------------------------------+
|i6 : L=matrix{{t_0^4,t_0^3*t_1,t_0*t_1^3,t_1^4}}           |
|                                                           |
|o6 = | t_0^4 t_0^3t_1 t_0t_1^3 t_1^4 |                     |
|                                                           |
|             1      4                                      |
|o6 : Matrix R  <-- R                                       |
+-----------------------------------------------------------+
|i7 : J=imageUnderRationalMap(I,L)                          |
|                                                           |
|                          3      2     2    2     3    2   |
|o7 = ideal (x x  - x x , x  - x x , x x  - x x , x  - x x )|
|             1 2    0 3   2    1 3   0 2    1 3   1    0 2 |
|                                                           |
|o7 : Ideal of kk[x ..x ]                                   |
|                  0   3                                    |
+-----------------------------------------------------------+
|i8 : betti J                                               |
|                                                           |
|            0 1                                            |
|o8 = total: 1 4                                            |
|         0: 1 .                                            |
|         1: . 1                                            |
|         2: . 3                                            |
|                                                           |
|o8 : BettiTally                                            |
+-----------------------------------------------------------+

Ways to use imageUnderRationalMap:
==================================

  * "imageUnderRationalMap(Ideal,Matrix)"

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

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

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

The source of this document is in RandomCurves.m2:1325:0.

knownUnirationalComponentOfSpaceCurves -- check whether there is a unirational construction for a component of the Hilbert scheme of space curves
*************************************************************************************************************************************************

  * Usage:
        knownUnirationalComponentOfSpaceCurves(d,g)
  * Inputs:
      * d, an integer (Macaulay2Doc),
      * g, an integer (Macaulay2Doc),
  * Outputs:
      * a Boolean value (Macaulay2Doc), whether there is a
        component of maximal rank curves of degree d and genus g in $\PP^{ 3}$
        with O_C(2) non-special and Hartshorne-Rao module of diameter $\le 3$
        that have a natural free resolution

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

* diameter = 1. All modules can be constructed

* diameter = 2. The modules can be constructed if the resolution of the generic
module is minimal. This is for instance not the case for (d,g)  being among
(2,1), (1,2), (1,1) .

* diameter = 3. The construction is possible unless the expected Betti table of
the Hartshorne-Rao module has shape

a b c_1 - -

- - c_2 - -

- - c_3 d e

with both 4b-10c_1 < a and 4d-10c_3 < e.

diameter {\ge} 4. he routine returns false, although we actually do know a
couple of constructions which work in a few further cases.

The following example prints an overview table for the constructable cases:

+------------------------------------------------------------------------+
|i1 : matrix apply(toList(2..18),d-> apply(toList(0..26),g->             |
|          if knownUnirationalComponentOfSpaceCurves(d,g) then 1 else 0))|
|                                                                        |
|o1 = | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 1 1 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 0 0 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 0 0 0 0 0 0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 0 0 0 0 0 0 0 0 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 |          |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 |          |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 |          |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 |          |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 |          |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 |          |
|     | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 |          |
|                                                                        |
|              17       27                                               |
|o1 : Matrix ZZ   <-- ZZ                                                 |
+------------------------------------------------------------------------+

See also
========

  * spaceCurve -- constructs a RandomObject that can be used
    to construct a space curve.
  * hartshorneRaoModule -- Compute a random
    Hartshorne-Rao module

Ways to use knownUnirationalComponentOfSpaceCurves:
===================================================

  * "knownUnirationalComponentOfSpaceCurves(ZZ,ZZ)"

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

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

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

The source of this document is in RandomCurves.m2:1019:0.

nodalPlaneCurve -- get a random nodal plane curve
*************************************************

  * Usage:
        (random nodalPlaneCurve)(d,delta,R)
  * Inputs:
      * d, an integer (Macaulay2Doc), the degree of the curve
      * delta, an integer (Macaulay2Doc), the number of nodes
      * R, a polynomial ring (Macaulay2Doc), homogeneous
        coordinate ring of $\mathbb{P}^2$.
  * Outputs:
      * an ideal (Macaulay2Doc), the vanishing ideal of the curve

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

The procedure starts by choosing

\ \ \  1) an ideal I of delta random points in $\PP^2$, and then returns

\ \ \  2) the principal ideal generated by an random element in the saturated
square J=saturate(I^2) of degree d.

If the procedure fails, for example if J_d=0, then the null is returned.

Under the option Certified=>true, the result is certified by establishing that

\ \ \  1) the points are distinct nodes, and that

\ \ \  2) the curve has ordinary nodes at these points

by using the Jacobian criterion applied to the singular locus of the curve.

Under the option Attempts=>n, the program makes n attempts in both steps to
achieve the desired goal. Here n can be infinity. The default value is n=1.

+---------------------------------------+
|i1 : setRandomSeed("alpha");           |
| -- setting random seed to 10206284518 |
+---------------------------------------+
|i2 : R=ZZ/32003[x_0..x_2];             |
+---------------------------------------+
|i3 : F=(random nodalPlaneCurve)(8,5,R);|
|                                       |
|o3 : Ideal of R                        |
+---------------------------------------+
|i4 : (dim F, degree F)                 |
|                                       |
|o4 = (2, 8)                            |
|                                       |
|o4 : Sequence                          |
+---------------------------------------+
|i5 : singF = F + ideal jacobian F;     |
|                                       |
|o5 : Ideal of R                        |
+---------------------------------------+
|i6 : (dim singF,degree singF)          |
|                                       |
|o6 = (1, 5)                            |
|                                       |
|o6 : Sequence                          |
+---------------------------------------+

Over very small fields the curves are often singular:

+-----------------------------------------------------------------------------+
|i7 : R=ZZ/3[x_0..x_2];                                                       |
+-----------------------------------------------------------------------------+
|i8 : tally apply(3^4,i-> null===((random                                     |
|                                                                             |
|o8 = Tally{false => 17}                                                      |
|           true => 64                                                        |
|                                                                             |
|o8 : Tally                                                                   |
|-----------------------------------------------------------------------------|
|nodalPlaneCurve)(8,5,R,Certify=>true, Attempts=>1)))                         |
+-----------------------------------------------------------------------------+

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

The object nodalPlaneCurve, is an instance of the type
RandomObject (RandomObjects).

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

The source of this document is in RandomCurves.m2:1262:0.

randomCanonicalCurveGenus8with8Points -- Compute a random canonical curve of genus 8 with 8 marked point
********************************************************************************************************

  * Usage:
        (I,idealsOfPts)=randomCanonicalCurveGenus8with8Points S
  * Inputs:
      * S, a polynomial ring (Macaulay2Doc), homogeneous
        coordinate ring of $\PP^7$
  * Outputs:
      * I, an ideal (Macaulay2Doc), a canonical curve C of genus 8
      * idealsOfPts, a list (Macaulay2Doc), 8 ideals of K-rational
        points on C

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

According to Mukai [Mu] any smooth curve of genus 8 and Clifford index 3 is the
transversal intersection $C=\PP^7 \cap\ G(2,6) \subset \ \PP^{15}$. In
particular this is true for the general curve of genus 8. Picking 8 points in
the Grassmannian $G(2,6)$ at random and \PP^7 as their span gives the result.

+-----------------------------------------------------------------------------+
|i1 : setRandomSeed("alpha");                                                 |
| -- setting random seed to 10206284518                                       |
+-----------------------------------------------------------------------------+
|i2 : FF=ZZ/10007;                                                            |
+-----------------------------------------------------------------------------+
|i3 : S=FF[x_0..x_7];                                                         |
+-----------------------------------------------------------------------------+
|i4 : (I,points)=randomCanonicalCurveGenus8with8Points S;                     |
+-----------------------------------------------------------------------------+
|i5 : betti res I                                                             |
|                                                                             |
|            0  1  2  3  4  5 6                                               |
|o5 = total: 1 15 35 42 35 15 1                                               |
|         0: 1  .  .  .  .  . .                                               |
|         1: . 15 35 21  .  . .                                               |
|         2: .  .  . 21 35 15 .                                               |
|         3: .  .  .  .  .  . 1                                               |
|                                                                             |
|o5 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i6 : points                                                                  |
|                                                                             |
|o6 = {ideal (x  - 1611x , x  + 2414x , x  - 1550x , x  - 4251x , x  + 4315x ,|
|              6        7   5        7   4        7   3        7   2        7 |
|     ------------------------------------------------------------------------|
|     x  + 2701x , x  - 4090x ), ideal (x  + 1668x , x  - 2841x , x  - 2811x ,|
|      1        7   0        7           6        7   5        7   4        7 |
|     ------------------------------------------------------------------------|
|     x  - 2503x , x  - 2868x , x  + 3683x , x  + 4539x ), ideal (x  - 1972x ,|
|      3        7   2        7   1        7   0        7           6        7 |
|     ------------------------------------------------------------------------|
|     x  - 3164x , x  + 2439x , x  - 3731x , x  - 3223x , x  - 4255x , x  -   |
|      5        7   4        7   3        7   2        7   1        7   0     |
|     ------------------------------------------------------------------------|
|     3245x ), ideal (x  - 3018x , x  - 4221x , x  + 3745x , x  - 3558x , x  +|
|          7           6        7   5        7   4        7   3        7   2  |
|     ------------------------------------------------------------------------|
|     3717x , x  - 879x , x  - 4286x ), ideal (x  - 3067x , x  - 941x , x  +  |
|          7   1       7   0        7           6        7   5       7   4    |
|     ------------------------------------------------------------------------|
|     4350x , x  - 49x , x  + 4179x , x  - 3962x , x  + 2213x ), ideal (x  +  |
|          7   3      7   2        7   1        7   0        7           6    |
|     ------------------------------------------------------------------------|
|     4309x , x  + 2155x , x  - 613x , x  - 155x , x  - 542x , x  + 1237x , x |
|          7   5        7   4       7   3       7   2       7   1        7   0|
|     ------------------------------------------------------------------------|
|     + 2446x ), ideal (x  - 4950x , x  - 597x , x  - 4613x , x  - 1907x , x  |
|            7           6        7   5       7   4        7   3        7   2 |
|     ------------------------------------------------------------------------|
|     + 4217x , x  - 886x , x  + 3338x ), ideal (x  + 2599x , x  + 3310x , x  |
|            7   1       7   0        7           6        7   5        7   4 |
|     ------------------------------------------------------------------------|
|     + 1584x , x  + 3379x , x  + 1721x , x  - 3470x , x  + 3687x )}          |
|            7   3        7   2        7   1        7   0        7            |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+

Ways to use randomCanonicalCurveGenus8with8Points:
==================================================

  * "randomCanonicalCurveGenus8with8Points(PolynomialRing)"

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

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

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

The source of this document is in RandomCurves.m2:1404:0.

randomCurveGenus8Degree14inP6 -- Compute a random normal curve of genus g=8 and degree 14 in \PP^6
**************************************************************************************************

  * Usage:
        I=randomCurveGenus8Degree14inP6 S
  * Inputs:
      * S, a polynomial ring (Macaulay2Doc), in 7
        variables
  * Outputs:
      * I, an ideal (Macaulay2Doc), of a curve of geometric genus
        8 and degree 14 in \PP^6

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

The construction is based on Mukai's unirational description of $M_{8,8}$ of
the moduli space of genus 8 with 8 marked points (see [Mu]).

+---------------------------------------+
|i1 : setRandomSeed("alpha");           |
| -- setting random seed to 10206284518 |
+---------------------------------------+
|i2 : FF=ZZ/10007;                      |
+---------------------------------------+
|i3 : S=FF[x_0..x_6];                   |
+---------------------------------------+
|i4 : I=randomCurveGenus8Degree14inP6 S;|
|                                       |
|o4 : Ideal of S                        |
+---------------------------------------+
|i5 : betti res I                       |
|                                       |
|            0 1  2  3  4 5             |
|o5 = total: 1 7 35 56 35 8             |
|         0: 1 .  .  .  . .             |
|         1: . 7  .  .  . .             |
|         2: . . 35 56 35 8             |
|                                       |
|o5 : BettiTally                        |
+---------------------------------------+

Ways to use randomCurveGenus8Degree14inP6:
==========================================

  * "randomCurveGenus8Degree14inP6(PolynomialRing)"

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

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

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

The source of this document is in RandomCurves.m2:1431:0.

randomCurveGenus14Degree18inP6 -- Compute a random curve of genus 14 of Degree 18 in \PP^6
******************************************************************************************

  * Usage:
        randomCurveGenus14Degree18inP6 S
  * Inputs:
      * S, a polynomial ring (Macaulay2Doc), homogeneous
        coordinate ring of \PP^6
  * Optional inputs (Macaulay2Doc),:
      * Certify (missing documentation) => ..., default value false,
  * Outputs:
      * an ideal (Macaulay2Doc), the ideal of a curve C of genus
        14 and degree 18 in \PP^6

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

According to Verra [Ve], a general genus 14 curve $C$ arizes as the residual
intersection of the 5 quadrics in the homogeneous ideal of a general normal
curve $E$ of genus 8 and degree 14 in \PP^6. These in turn can be constructed
using Mukai's Theorem on genus 8 curves: Every smooth genus 8 curve with
general Clifford index arizes as the intersection of the Grassmannian $G(2,6)
\subset \PP^{14}$ with a transversal $\PP^7$. Taking $\PP^7$ as the span of
general or random $8$ points $$p_1,\ldots, p_8 \in{} G(2,6)$$ gives  $E$
together with a general divisor $ H=K_E+D_1-D_2$ of degree 14 where
$D_1=p_1+\ldots+p_4$ and $D_2=p_5+\ldots+p_8$.

The fact that the example below works can be seen as computer aided proof of
the unirationality of $M_{14}$. It proves the unirationality of $M_{14}$ for
fields of the chosen finite characteristic 10007, for fields of characteristic
0 by semi-continuity, and, hence, for all but finitely many primes $p$.

+---------------------------------------------------+
|i1 : setRandomSeed("alpha");                       |
| -- setting random seed to 10206284518             |
+---------------------------------------------------+
|i2 : FF=ZZ/10007;                                  |
+---------------------------------------------------+
|i3 : S=FF[x_0..x_6];                               |
+---------------------------------------------------+
|i4 : time I=randomCurveGenus14Degree18inP6(S);     |
| -- used 2.44604s (cpu); 1.98539s (thread); 0s (gc)|
|                                                   |
|o4 : Ideal of S                                    |
+---------------------------------------------------+
|i5 : betti res I                                   |
|                                                   |
|            0  1  2  3  4 5                        |
|o5 = total: 1 13 45 56 25 2                        |
|         0: 1  .  .  .  . .                        |
|         1: .  5  .  .  . .                        |
|         2: .  8 45 56 25 .                        |
|         3: .  .  .  .  . 2                        |
|                                                   |
|o5 : BettiTally                                    |
+---------------------------------------------------+

Ways to use randomCurveGenus14Degree18inP6:
===========================================

  * "randomCurveGenus14Degree18inP6(PolynomialRing)"

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

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

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

The source of this document is in RandomCurves.m2:1471:0.

RandomSpaceCurves -- Construction of random space curves of various kinds.
**************************************************************************

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

The source of this document is in RandomCurves.m2:900:0.

spaceCurve -- constructs a RandomObject that can be used to construct a space curve.
************************************************************************************

  * Usage:
        (random spaceCurve)(d,g,R)
  * Inputs:
      * d, an integer (Macaulay2Doc), the desired degree
      * g, an integer (Macaulay2Doc), the desired genus,
      * R, a polynomial ring (Macaulay2Doc), homogeneous
        coordinate ring of $\PP^{ 3}$
  * Outputs:
      * an ideal (Macaulay2Doc), of R

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

Creates the ideal of a random curve of degree d and genus g via the
construction of its expected Hartshorne-Rao module, which should have diameter
$\le 3$. The construction is implemented for non-degenerate, linearly normal
curves C of maximal rank with O_C(2) non-special, where moreover both C and its
Hartshorne-Rao module have a "natural" free resolution.

There are the following options:

* Attempts => ...  a nonnegative integer or infinity (default) that limits the
maximal number of attempts for the construction of the curve

* Certify => ...  true or false (default) checks whether the output is of
correct dimension and the constructed curve is smooth and actually has the
desired degree d and genus g

There are 63 possible families satisfying the four conditions above. Our method
can provide random curves in 60 of these families, simultaneously proving the
unirationality of each of these 60 components of the Hilbert scheme.

If there is a construction can be checked with
knownUnirationalComponentOfSpaceCurves.

+---------------------------------------------+
|i1 : setRandomSeed("alpha");                 |
| -- setting random seed to 10206284518       |
+---------------------------------------------+
|i2 : R=ZZ/20011[x_0..x_3];                   |
+---------------------------------------------+
|i3 : d=10;g=7;                               |
+---------------------------------------------+
|i5 : betti res (J=(random spaceCurve)(d,g,R))|
|                                             |
|            0 1  2 3                         |
|o5 = total: 1 9 12 4                         |
|         0: 1 .  . .                         |
|         1: . .  . .                         |
|         2: . .  . .                         |
|         3: . 1  . .                         |
|         4: . 8 12 4                         |
|                                             |
|o5 : BettiTally                              |
+---------------------------------------------+
|i6 : degree J==d and genus J == g            |
|                                             |
|o6 = true                                    |
+---------------------------------------------+

We verify that the Hilbert scheme has (at least) 60 components consisting of
smooth non-degenerate curves with $h^1 O_C(2)=0$. The degree d, genus g and
Brill-Noether number $\rho$ of these families and the generic Betti tables are
given below.

+----------------------------------------------------------------------+
|i7 : setRandomSeed("alpha");                                          |
| -- setting random seed to 10206284518                                |
+----------------------------------------------------------------------+
|i8 : kk=ZZ/20011;                                                     |
+----------------------------------------------------------------------+
|i9 : R=kk[x_0..x_3];                                                  |
+----------------------------------------------------------------------+
|i10 : L=flatten apply(toList(0..40),g->apply(toList(3..30),d->(d,g)));|
+----------------------------------------------------------------------+
|i11 : halpenBound = d ->(d/2-1)^2;                                    |
+----------------------------------------------------------------------+
|i12 : L = select(L,(d,g) ->                                           |
|           g <= halpenBound d                                         |
|           and                                                        |
|           knownUnirationalComponentOfSpaceCurves(d,g));              |
+----------------------------------------------------------------------+
|i13 : #L                                                              |
|                                                                      |
|o13 = 60                                                              |
+----------------------------------------------------------------------+
|i14 : hashTable apply(L,(d,g) -> (                                    |
|                J = (random spaceCurve)(d,g,R);                       |
|                assert (degree J == d and genus J == g);              |
|                (d,g) => g-4*(g+3-d) => betti res J))                 |
|                                                                      |
|                               /       0 1 2\                         |
|o14 = HashTable{(3, 0) => 0 => |total: 1 3 2|        }                |
|                               |    0: 1 . .|                         |
|                               \    1: . 3 2/                         |
|                               /       0 1 2 3\                       |
|                (4, 0) => 4 => |total: 1 4 4 1|                       |
|                               |    0: 1 . . .|                       |
|                               |    1: . 1 . .|                       |
|                               \    2: . 3 4 1/                       |
|                               /       0 1 2\                         |
|                (4, 1) => 1 => |total: 1 2 1|                         |
|                               |    0: 1 . .|                         |
|                               |    1: . 2 .|                         |
|                               \    2: . . 1/                         |
|                               /       0 1 2 3\                       |
|                (5, 1) => 5 => |total: 1 5 5 1|                       |
|                               |    0: 1 . . .|                       |
|                               |    1: . . . .|                       |
|                               \    2: . 5 5 1/                       |
|                               /       0 1 2\                         |
|                (5, 2) => 2 => |total: 1 3 2|                         |
|                               |    0: 1 . .|                         |
|                               |    1: . 1 .|                         |
|                               \    2: . 2 2/                         |
|                                /       0 1 2 3\                      |
|                (6, 0) => 12 => |total: 1 7 9 3|                      |
|                                |    0: 1 . . .|                      |
|                                |    1: . . . .|                      |
|                                |    2: . 1 . .|                      |
|                                \    3: . 6 9 3/                      |
|                               /       0 1 2 3\                       |
|                (6, 1) => 9 => |total: 1 5 6 2|                       |
|                               |    0: 1 . . .|                       |
|                               |    1: . . . .|                       |
|                               |    2: . 2 . .|                       |
|                               \    3: . 3 6 2/                       |
|                               /       0 1 2\                         |
|                (6, 3) => 3 => |total: 1 4 3|                         |
|                               |    0: 1 . .|                         |
|                               |    1: . . .|                         |
|                               \    2: . 4 3/                         |
|                               /       0 1 2\                         |
|                (6, 4) => 0 => |total: 1 2 1|                         |
|                               |    0: 1 . .|                         |
|                               |    1: . 1 .|                         |
|                               |    2: . 1 .|                         |
|                               \    3: . . 1/                         |
|                                /       0 1 2 3\                      |
|                (7, 0) => 16 => |total: 1 6 7 2|                      |
|                                |    0: 1 . . .|                      |
|                                |    1: . . . .|                      |
|                                |    2: . . . .|                      |
|                                |    3: . 6 4 .|                      |
|                                \    4: . . 3 2/                      |
|                                /       0 1 2 3\                      |
|                (7, 1) => 13 => |total: 1 7 7 1|                      |
|                                |    0: 1 . . .|                      |
|                                |    1: . . . .|                      |
|                                |    2: . . . .|                      |
|                                |    3: . 7 7 .|                      |
|                                \    4: . . . 1/                      |
|                                /       0 1  2 3\                     |
|                (7, 2) => 10 => |total: 1 8 10 3|                     |
|                                |    0: 1 .  . .|                     |
|                                |    1: . .  . .|                     |
|                                |    2: . .  . .|                     |
|                                \    3: . 8 10 3/                     |
|                               /       0 1 2 3\                       |
|                (7, 4) => 4 => |total: 1 4 4 1|                       |
|                               |    0: 1 . . .|                       |
|                               |    1: . . . .|                       |
|                               |    2: . 2 . .|                       |
|                               \    3: . 2 4 1/                       |
|                               /       0 1 2\                         |
|                (7, 5) => 1 => |total: 1 3 2|                         |
|                               |    0: 1 . .|                         |
|                               |    1: . . .|                         |
|                               |    2: . 3 1|                         |
|                               \    3: . . 1/                         |
|                                /       0 1 2\                        |
|                (7, 6) => -2 => |total: 1 3 2|                        |
|                                |    0: 1 . .|                        |
|                                |    1: . 1 .|                        |
|                                |    2: . . .|                        |
|                                \    3: . 2 2/                        |
|                                /       0 1 2 3\                      |
|                (8, 2) => 14 => |total: 1 5 7 3|                      |
|                                |    0: 1 . . .|                      |
|                                |    1: . . . .|                      |
|                                |    2: . . . .|                      |
|                                |    3: . 4 . .|                      |
|                                \    4: . 1 7 3/                      |
|                                /       0 1 2 3\                      |
|                (8, 3) => 11 => |total: 1 5 6 2|                      |
|                                |    0: 1 . . .|                      |
|                                |    1: . . . .|                      |
|                                |    2: . . . .|                      |
|                                |    3: . 5 2 .|                      |
|                                \    4: . . 4 2/                      |
|                               /       0 1 2 3\                       |
|                (8, 4) => 8 => |total: 1 6 6 1|                       |
|                               |    0: 1 . . .|                       |
|                               |    1: . . . .|                       |
|                               |    2: . . . .|                       |
|                               |    3: . 6 5 .|                       |
|                               \    4: . . 1 1/                       |
|                               /       0 1 2 3\                       |
|                (8, 5) => 5 => |total: 1 7 8 2|                       |
|                               |    0: 1 . . .|                       |
|                               |    1: . . . .|                       |
|                               |    2: . . . .|                       |
|                               \    3: . 7 8 2/                       |
|                               /       0 1 2 3\                       |
|                (8, 6) => 2 => |total: 1 5 5 1|                       |
|                               |    0: 1 . . .|                       |
|                               |    1: . . . .|                       |
|                               |    2: . 1 . .|                       |
|                               \    3: . 4 5 1/                       |
|                                /       0 1 2\                        |
|                (8, 7) => -1 => |total: 1 3 2|                        |
|                                |    0: 1 . .|                        |
|                                |    1: . . .|                        |
|                                |    2: . 2 .|                        |
|                                \    3: . 1 2/                        |
|                                /       0  1  2 3\                    |
|                (9, 2) => 18 => |total: 1 12 17 6|                    |
|                                |    0: 1  .  . .|                    |
|                                |    1: .  .  . .|                    |
|                                |    2: .  .  . .|                    |
|                                |    3: .  .  . .|                    |
|                                \    4: . 12 17 6/                    |
|                                /       0  1  2 3\                    |
|                (9, 3) => 15 => |total: 1 10 14 5|                    |
|                                |    0: 1  .  . .|                    |
|                                |    1: .  .  . .|                    |
|                                |    2: .  .  . .|                    |
|                                |    3: .  1  . .|                    |
|                                \    4: .  9 14 5/                    |
|                                /       0 1  2 3\                     |
|                (9, 4) => 12 => |total: 1 8 11 4|                     |
|                                |    0: 1 .  . .|                     |
|                                |    1: . .  . .|                     |
|                                |    2: . .  . .|                     |
|                                |    3: . 2  . .|                     |
|                                \    4: . 6 11 4/                     |
|                               /       0 1 2 3\                       |
|                (9, 5) => 9 => |total: 1 6 8 3|                       |
|                               |    0: 1 . . .|                       |
|                               |    1: . . . .|                       |
|                               |    2: . . . .|                       |
|                               |    3: . 3 . .|                       |
|                               \    4: . 3 8 3/                       |
|                               /       0 1 2 3\                       |
|                (9, 6) => 6 => |total: 1 4 5 2|                       |
|                               |    0: 1 . . .|                       |
|                               |    1: . . . .|                       |
|                               |    2: . . . .|                       |
|                               |    3: . 4 . .|                       |
|                               \    4: . . 5 2/                       |
|                               /       0 1 2 3\                       |
|                (9, 8) => 0 => |total: 1 6 6 1|                       |
|                               |    0: 1 . . .|                       |
|                               |    1: . . . .|                       |
|                               |    2: . . . .|                       |
|                               \    3: . 6 6 1/                       |
|                                /       0 1 2\                        |
|                (9, 9) => -3 => |total: 1 4 3|                        |
|                                |    0: 1 . .|                        |
|                                |    1: . . .|                        |
|                                |    2: . 1 .|                        |
|                                \    3: . 3 3/                        |
|                                 /       0  1  2 3\                   |
|                (10, 6) => 10 => |total: 1 11 15 5|                   |
|                                 |    0: 1  .  . .|                   |
|                                 |    1: .  .  . .|                   |
|                                 |    2: .  .  . .|                   |
|                                 |    3: .  .  . .|                   |
|                                 \    4: . 11 15 5/                   |
|                                /       0 1  2 3\                     |
|                (10, 7) => 7 => |total: 1 9 12 4|                     |
|                                |    0: 1 .  . .|                     |
|                                |    1: . .  . .|                     |
|                                |    2: . .  . .|                     |
|                                |    3: . 1  . .|                     |
|                                \    4: . 8 12 4/                     |
|                                /       0 1 2 3\                      |
|                (10, 8) => 4 => |total: 1 7 9 3|                      |
|                                |    0: 1 . . .|                      |
|                                |    1: . . . .|                      |
|                                |    2: . . . .|                      |
|                                |    3: . 2 . .|                      |
|                                \    4: . 5 9 3/                      |
|                                /       0 1 2 3\                      |
|                (10, 9) => 1 => |total: 1 5 6 2|                      |
|                                |    0: 1 . . .|                      |
|                                |    1: . . . .|                      |
|                                |    2: . . . .|                      |
|                                |    3: . 3 . .|                      |
|                                \    4: . 2 6 2/                      |
|                                  /       0 1 2\                      |
|                (10, 11) => -5 => |total: 1 5 4|                      |
|                                  |    0: 1 . .|                      |
|                                  |    1: . . .|                      |
|                                  |    2: . . .|                      |
|                                  \    3: . 5 4/                      |
|                                /       0 1 2 3\                      |
|                (11, 8) => 8 => |total: 1 8 9 2|                      |
|                                |    0: 1 . . .|                      |
|                                |    1: . . . .|                      |
|                                |    2: . . . .|                      |
|                                |    3: . . . .|                      |
|                                |    4: . 8 7 .|                      |
|                                \    5: . . 2 2/                      |
|                                /       0 1  2 3\                     |
|                (11, 9) => 5 => |total: 1 9 10 2|                     |
|                                |    0: 1 .  . .|                     |
|                                |    1: . .  . .|                     |
|                                |    2: . .  . .|                     |
|                                |    3: . .  . .|                     |
|                                |    4: . 9 10 1|                     |
|                                \    5: . .  . 1/                     |
|                                 /       0  1  2 3\                   |
|                (11, 10) => 2 => |total: 1 10 13 4|                   |
|                                 |    0: 1  .  . .|                   |
|                                 |    1: .  .  . .|                   |
|                                 |    2: .  .  . .|                   |
|                                 |    3: .  .  . .|                   |
|                                 \    4: . 10 13 4/                   |
|                                  /       0 1  2 3\                   |
|                (11, 11) => -1 => |total: 1 8 10 3|                   |
|                                  |    0: 1 .  . .|                   |
|                                  |    1: . .  . .|                   |
|                                  |    2: . .  . .|                   |
|                                  |    3: . 1  . .|                   |
|                                  \    4: . 7 10 3/                   |
|                                  /       0 1 2 3\                    |
|                (11, 13) => -7 => |total: 1 4 4 1|                    |
|                                  |    0: 1 . . .|                    |
|                                  |    1: . . . .|                    |
|                                  |    2: . . . .|                    |
|                                  |    3: . 3 . .|                    |
|                                  \    4: . 1 4 1/                    |
|                                /       0 1  2 3\                     |
|                (12, 9) => 9 => |total: 1 8 12 5|                     |
|                                |    0: 1 .  . .|                     |
|                                |    1: . .  . .|                     |
|                                |    2: . .  . .|                     |
|                                |    3: . .  . .|                     |
|                                |    4: . 4  . .|                     |
|                                \    5: . 4 12 5/                     |
|                                 /       0 1 2 3\                     |
|                (12, 10) => 6 => |total: 1 6 9 4|                     |
|                                 |    0: 1 . . .|                     |
|                                 |    1: . . . .|                     |
|                                 |    2: . . . .|                     |
|                                 |    3: . . . .|                     |
|                                 |    4: . 5 . .|                     |
|                                 \    5: . 1 9 4/                     |
|                                 /       0 1 2 3\                     |
|                (12, 11) => 3 => |total: 1 6 8 3|                     |
|                                 |    0: 1 . . .|                     |
|                                 |    1: . . . .|                     |
|                                 |    2: . . . .|                     |
|                                 |    3: . . . .|                     |
|                                 |    4: . 6 2 .|                     |
|                                 \    5: . . 6 3/                     |
|                                 /       0 1 2 3\                     |
|                (12, 12) => 0 => |total: 1 7 8 2|                     |
|                                 |    0: 1 . . .|                     |
|                                 |    1: . . . .|                     |
|                                 |    2: . . . .|                     |
|                                 |    3: . . . .|                     |
|                                 |    4: . 7 5 .|                     |
|                                 \    5: . . 3 2/                     |
|                                  /       0 1 2 3\                    |
|                (12, 13) => -3 => |total: 1 8 8 1|                    |
|                                  |    0: 1 . . .|                    |
|                                  |    1: . . . .|                    |
|                                  |    2: . . . .|                    |
|                                  |    3: . . . .|                    |
|                                  |    4: . 8 8 .|                    |
|                                  \    5: . . . 1/                    |
|                                  /       0 1  2 3\                   |
|                (12, 14) => -6 => |total: 1 9 11 3|                   |
|                                  |    0: 1 .  . .|                   |
|                                  |    1: . .  . .|                   |
|                                  |    2: . .  . .|                   |
|                                  |    3: . .  . .|                   |
|                                  \    4: . 9 11 3/                   |
|                                  /       0 1 2 3\                    |
|                (12, 15) => -9 => |total: 1 7 8 2|                    |
|                                  |    0: 1 . . .|                    |
|                                  |    1: . . . .|                    |
|                                  |    2: . . . .|                    |
|                                  |    3: . 1 . .|                    |
|                                  \    4: . 6 8 2/                    |
|                                 /       0  1  2 3\                   |
|                (13, 12) => 4 => |total: 1 11 16 6|                   |
|                                 |    0: 1  .  . .|                   |
|                                 |    1: .  .  . .|                   |
|                                 |    2: .  .  . .|                   |
|                                 |    3: .  .  . .|                   |
|                                 |    4: .  2  . .|                   |
|                                 \    5: .  9 16 6/                   |
|                                 /       0 1  2 3\                    |
|                (13, 13) => 1 => |total: 1 9 13 5|                    |
|                                 |    0: 1 .  . .|                    |
|                                 |    1: . .  . .|                    |
|                                 |    2: . .  . .|                    |
|                                 |    3: . .  . .|                    |
|                                 |    4: . 3  . .|                    |
|                                 \    5: . 6 13 5/                    |
|                                  /       0 1  2 3\                   |
|                (13, 14) => -2 => |total: 1 7 10 4|                   |
|                                  |    0: 1 .  . .|                   |
|                                  |    1: . .  . .|                   |
|                                  |    2: . .  . .|                   |
|                                  |    3: . .  . .|                   |
|                                  |    4: . 4  . .|                   |
|                                  \    5: . 3 10 4/                   |
|                                  /       0 1 2 3\                    |
|                (13, 15) => -5 => |total: 1 5 7 3|                    |
|                                  |    0: 1 . . .|                    |
|                                  |    1: . . . .|                    |
|                                  |    2: . . . .|                    |
|                                  |    3: . . . .|                    |
|                                  |    4: . 5 . .|                    |
|                                  \    5: . . 7 3/                    |
|                                  /       0 1 2 3\                    |
|                (13, 16) => -8 => |total: 1 6 7 2|                    |
|                                  |    0: 1 . . .|                    |
|                                  |    1: . . . .|                    |
|                                  |    2: . . . .|                    |
|                                  |    3: . . . .|                    |
|                                  |    4: . 6 3 .|                    |
|                                  \    5: . . 4 2/                    |
|                                   /       0 1 2 3\                   |
|                (13, 17) => -11 => |total: 1 7 7 1|                   |
|                                   |    0: 1 . . .|                   |
|                                   |    1: . . . .|                   |
|                                   |    2: . . . .|                   |
|                                   |    3: . . . .|                   |
|                                   |    4: . 7 6 .|                   |
|                                   \    5: . . 1 1/                   |
|                                  /       0  1  2 3\                  |
|                (14, 15) => -1 => |total: 1 14 20 7|                  |
|                                  |    0: 1  .  . .|                  |
|                                  |    1: .  .  . .|                  |
|                                  |    2: .  .  . .|                  |
|                                  |    3: .  .  . .|                  |
|                                  |    4: .  .  . .|                  |
|                                  \    5: . 14 20 7/                  |
|                                  /       0  1  2 3\                  |
|                (14, 16) => -4 => |total: 1 12 17 6|                  |
|                                  |    0: 1  .  . .|                  |
|                                  |    1: .  .  . .|                  |
|                                  |    2: .  .  . .|                  |
|                                  |    3: .  .  . .|                  |
|                                  |    4: .  1  . .|                  |
|                                  \    5: . 11 17 6/                  |
|                                  /       0  1  2 3\                  |
|                (14, 17) => -7 => |total: 1 10 14 5|                  |
|                                  |    0: 1  .  . .|                  |
|                                  |    1: .  .  . .|                  |
|                                  |    2: .  .  . .|                  |
|                                  |    3: .  .  . .|                  |
|                                  |    4: .  2  . .|                  |
|                                  \    5: .  8 14 5/                  |
|                                   /       0 1  2 3\                  |
|                (14, 18) => -10 => |total: 1 8 11 4|                  |
|                                   |    0: 1 .  . .|                  |
|                                   |    1: . .  . .|                  |
|                                   |    2: . .  . .|                  |
|                                   |    3: . .  . .|                  |
|                                   |    4: . 3  . .|                  |
|                                   \    5: . 5 11 4/                  |
|                                   /       0 1 2 3\                   |
|                (14, 19) => -13 => |total: 1 6 8 3|                   |
|                                   |    0: 1 . . .|                   |
|                                   |    1: . . . .|                   |
|                                   |    2: . . . .|                   |
|                                   |    3: . . . .|                   |
|                                   |    4: . 4 . .|                   |
|                                   \    5: . 2 8 3/                   |
|                                   /       0  1  2 3\                 |
|                (15, 20) => -12 => |total: 1 13 18 6|                 |
|                                   |    0: 1  .  . .|                 |
|                                   |    1: .  .  . .|                 |
|                                   |    2: .  .  . .|                 |
|                                   |    3: .  .  . .|                 |
|                                   |    4: .  .  . .|                 |
|                                   \    5: . 13 18 6/                 |
|                                   /       0  1  2 3\                 |
|                (15, 21) => -15 => |total: 1 11 15 5|                 |
|                                   |    0: 1  .  . .|                 |
|                                   |    1: .  .  . .|                 |
|                                   |    2: .  .  . .|                 |
|                                   |    3: .  .  . .|                 |
|                                   |    4: .  1  . .|                 |
|                                   \    5: . 10 15 5/                 |
|                                   /       0  1  2 3\                 |
|                (16, 23) => -17 => |total: 1 10 11 2|                 |
|                                   |    0: 1  .  . .|                 |
|                                   |    1: .  .  . .|                 |
|                                   |    2: .  .  . .|                 |
|                                   |    3: .  .  . .|                 |
|                                   |    4: .  .  . .|                 |
|                                   |    5: . 10 10 .|                 |
|                                   \    6: .  .  1 2/                 |
|                                   /       0 1  2 3\                  |
|                (17, 25) => -19 => |total: 1 7 11 5|                  |
|                                   |    0: 1 .  . .|                  |
|                                   |    1: . .  . .|                  |
|                                   |    2: . .  . .|                  |
|                                   |    3: . .  . .|                  |
|                                   |    4: . .  . .|                  |
|                                   |    5: . 6  . .|                  |
|                                   \    6: . 1 11 5/                  |
|                                                                      |
|o14 : HashTable                                                       |
+----------------------------------------------------------------------+

See also
========

  * knownUnirationalComponentOfSpaceCurves
    -- check whether there is a
    unirational construction for a component of the Hilbert scheme of space
    curves
  * hartshorneRaoModule -- Compute a random
    Hartshorne-Rao module

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

The object spaceCurve, is an instance of the type
RandomObject (RandomObjects).

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

The source of this document is in RandomCurves.m2:972:0.