This is K3Carpets.info, produced by Macaulay2, version 1.25.05

K3Carpets -- The unique Gorenstein double structure on a surface scroll
***********************************************************************

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

This package accompanies our paper Equations and syzygies of K3 carpets and
union of scrolls (see http://arxiv.org ) for experimental exploration.   There
is a unique surjection from the ideal of a 2-dimensional rational normal scroll
(other than the cone over a rational normal curve) onto the canonical module of
the scroll and the kernel of the this map is the ideal of a scheme that looks
numerically like a K3 surface: a K3 carpet. (Theorem 1.3 of Degenerations of K3
surfaces in projective space, by Francisco Gallego and B.P. Purnaprajna, Trans.
Amer. Math. Soc. 349 (1997), no. 6, 2477–2492.)

The carpet lies on the intersection of the cones over two rational normal
curves Ca and Cb of degrees a>=b. We write the ideal of Ca as the minors of a
2xa matrix X with entries x_i, i= 0..a, and similarly for Cb, with  a 2 x b
matrix Y with entries y_j. We write Xi for the ith column of X, and similarly
for Y. In the general case, where a,b are both >=2, the additional generators
of the ideal of the Carpet are then given by the differences
det(Xi,Yj)-det(X(i+1),Y(j-1)), or equivalently, by the minors of
(Xi+Yj,X(i+1)+Y(j-1), (In the case a=1=b the ideal is the square of the
determinant of X|Y; if a>1, b=1 then for the mixed minors we replace the
1-column matrix Y by a symmetric 2x2 matrix with entries y_0^2,y_0y_1,y_1^2 )

The hyperplane section of a K3 carpet is a canonical ribbon indexed by genus
g=a+b+1 and clifford index b.

The K3 carpets generalize to a family of degenerate K3 surfaces which are
unions of two scrolls, whose hyperplane sections are reducible canonical curves
consisting of two rational normal curves of degree g-1 intersecting in g+1
points. The functions in this package explore the syzygies of these surfaces
for fields of arbitrary characteristic. In particular, the functions in the
package allow for g <= 15 a computational proof of the following conjecture.

Conjecture 0.1 (see http://arxiv.org ) A general canonical curve of genus g
over a field of characteristic p satisfies Green's conjecture, if p >= (g-1)/2.

Constructions
=============

  * carpet -- Ideal of the unique Gorenstein double structure on
    a 2-dimensional scroll
  * canonicalCarpet -- Carpet of given genus and
    Clifford index
  * gorensteinDouble -- attempts to produce a
    Gorenstein double structure J subset I

Analyzing
=========

  * carpetBettiTables -- compute the Betti tables of
    a carpet of given genus and Clifford index over all prime fields
  * carpetBettiTable -- compute the Betti tables of a
    carpet of given genus and Clifford index over a prime field of
    characteristic p
  * analyzeStrand -- analyze the (a+1)-st constant strand
    of F over ZZ
  * degenerateK3BettiTables -- compute the
    Betti tables of a degenerate K3 over all prime fields
  * schreyerName -- get the names of generators in the
    (nonminimal) Schreyer resolution according to Schreyer's convention
  * allGradings -- add Grading to a Complex
  * carpetDet -- compute the determinant of the crucial
    constant strand of a carpet X(a,b)
  * resonanceDet -- compute the resonance determinant of
    the crucial constant strand of a degenerate K3 X_e(a,a)

Correspondence Scrolls
======================

  * correspondenceScroll -- Union of planes
    joining points of rational normal curves according to a given
    correspondence
  * hankelMatrix -- matrix with constant anti-diagonal
    entries
  * productOfProjectiveSpaces -- Constructs
    the multi-graded ring of a product of copies of P^1 (pp is a synonym)
  * schemeInProduct -- multi-graded Ideal of the image
    of a map to a product of projective spaces
  * smallDiagonal -- Ideal of the small diagonal in
    (P^1)^n
  * irrelevantIdeal -- returns the irrelevant ideal of
    a multi-graded ring
  * degenerateK3 -- Ideal of a degenerate K3 surface
    X_e(a,b)

Relative resolutions of X_e(a,b) in case of k resonance
=======================================================

  * resonanceScroll -- compute the splitting type of
    the resonance scroll
  * coxMatrices -- compute the Cox matrices
  * relativeEquations -- compute the relative
    quadrics
  * relativeResolution -- compute the relative
    resolution
  * relativeResolutionTwists -- compute the
    twists in the relative resolution
  * computeBound -- compute the bound for the good types
    in case of k resonance

Homotopies
==========

  * homotopyRanks -- compute the ranks of the quadratic
    homotopies on a carpet
  * canonicalHomotopies -- Homotopies on the
    resolution of a K3 carpet

Authors
=======

  * David Eisenbud (see http://www.msri.org/~de ) <de@msri.org>
  * Frank-Olaf Schreyer (see http://www.math.uni-sb.de/ag/schreyer )
    <schreyer@math.uni-sb.de>

Version
=======

This documentation describes version 0.5 of K3Carpets.

Citation
========

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

+----------------------------------------------------------------------------+
|@misc{K3CarpetsSource,                                                      |
|  title = {{K3Carpets: K3 double structure on scrolls. Version~0.5}},       |
|  author = {David Eisenbud and Frank-Olaf Schreyer},                        |
|  howpublished = {A \emph{Macaulay2} package available at                   |
|    \url{https://github.com/Macaulay2/M2/tree/master/M2/Macaulay2/packages}}|
|}                                                                           |
|                                                                            |
+----------------------------------------------------------------------------+

Exports
=======

  * Functions and commands
      * allGradings -- add Grading to a Complex
      * analyzeStrand -- analyze the (a+1)-st constant
        strand of F over ZZ
      * canonicalCarpet -- Carpet of given genus and
        Clifford index
      * canonicalHomotopies -- Homotopies on the
        resolution of a K3 carpet
      * carpet -- Ideal of the unique Gorenstein double
        structure on a 2-dimensional scroll
      * carpetBettiTable -- compute the Betti tables
        of a carpet of given genus and Clifford index over a prime field of
        characteristic p
      * carpetBettiTables -- compute the Betti tables
        of a carpet of given genus and Clifford index over all prime fields
      * carpetDet -- compute the determinant of the crucial
        constant strand of a carpet X(a,b)
      * computeBound -- compute the bound for the good
        types in case of k resonance
      * correspondenceScroll -- Union of planes
        joining points of rational normal curves according to a given
        correspondence
      * coxMatrices -- compute the Cox matrices
      * degenerateK3 -- Ideal of a degenerate K3 surface
        X_e(a,b)
      * degenerateK3BettiTables -- compute the
        Betti tables of a degenerate K3 over all prime fields
      * gorensteinDouble -- attempts to produce a
        Gorenstein double structure J subset I
      * hankelMatrix -- matrix with constant anti-diagonal
        entries
      * homotopyRanks -- compute the ranks of the
        quadratic homotopies on a carpet
      * irrelevantIdeal -- returns the irrelevant ideal
        of a multi-graded ring
      * productOfProjectiveSpaces, --
        Constructs the multi-graded ring of a product of copies of P^1 (pp is a
        synonym)
      * relativeEquations -- compute the relative
        quadrics
      * relativeResolution -- compute the relative
        resolution
      * relativeResolutionTwists -- compute
        the twists in the relative resolution
      * resonanceDet -- compute the resonance determinant
        of the crucial constant strand of a degenerate K3 X_e(a,a)
      * resonanceScroll -- compute the splitting type
        of the resonance scroll
      * schemeInProduct -- multi-graded Ideal of the
        image of a map to a product of projective spaces
      * schreyerName -- get the names of generators in the
        (nonminimal) Schreyer resolution according to Schreyer's convention
      * smallDiagonal -- Ideal of the small diagonal in
        (P^1)^n
  * Methods
      * "allGradings(Complex,Ring)" -- see allGradings, --
        add Grading to a Complex
      * "analyzeStrand(Complex,ZZ)" -- see analyzeStrand,
        -- analyze the (a+1)-st constant strand of F over ZZ
      * "canonicalCarpet(ZZ,ZZ)" -- see canonicalCarpet,
        -- Carpet of given genus and Clifford index
      * "canonicalHomotopies(ZZ,ZZ)" -- see canonicalHomotopies,
        -- Homotopies on the resolution of a K3 carpet
      * "carpet(ZZ,ZZ)" -- see carpet, -- Ideal of the unique
        Gorenstein double structure on a 2-dimensional scroll
      * "carpet(ZZ,ZZ,Matrix)" -- see carpet, -- Ideal of the
        unique Gorenstein double structure on a 2-dimensional scroll
      * "carpetBettiTable(HashTable,ZZ)" -- see carpetBettiTable,
        -- compute the Betti tables of a carpet of given
        genus and Clifford index over a prime field of characteristic p
      * "carpetBettiTable(ZZ,ZZ,ZZ)" -- see carpetBettiTable,
        -- compute the Betti tables of a carpet of given
        genus and Clifford index over a prime field of characteristic p
      * "carpetBettiTables(ZZ,ZZ)" -- see carpetBettiTables,
        -- compute the Betti tables of a carpet of given
        genus and Clifford index over all prime fields
      * "carpetDet(ZZ,ZZ)" -- see carpetDet, -- compute the
        determinant of the crucial constant strand of a carpet X(a,b)
      * "computeBound(ZZ)" -- see computeBound, -- compute
        the bound for the good types in case of k resonance
      * "computeBound(ZZ,ZZ,ZZ)" -- see computeBound, --
        compute the bound for the good types in case of k resonance
      * "correspondenceScroll(Ideal,List)" -- see correspondenceScroll,
        -- Union of planes joining points of rational
        normal curves according to a given correspondence
      * "coxMatrices(ZZ,ZZ,ZZ)" -- see coxMatrices, --
        compute the Cox matrices
      * "degenerateK3(ZZ,ZZ,List)" -- see degenerateK3, --
        Ideal of a degenerate K3 surface X_e(a,b)
      * "degenerateK3(ZZ,ZZ,Sequence)" -- see degenerateK3,
        -- Ideal of a degenerate K3 surface X_e(a,b)
      * "degenerateK3BettiTables(ZZ,ZZ,Sequence)" -- see
        degenerateK3BettiTables, -- compute the Betti
        tables of a degenerate K3 over all prime fields
      * "gorensteinDouble(Ideal)" -- see gorensteinDouble,
        -- attempts to produce a Gorenstein double structure
        J subset I
      * "hankelMatrix(Matrix,ZZ,ZZ)" -- see hankelMatrix,
        -- matrix with constant anti-diagonal entries
      * "hankelMatrix(Ring,RingElement,ZZ,ZZ)" -- see hankelMatrix,
        -- matrix with constant anti-diagonal entries
      * "hankelMatrix(Ring,ZZ,ZZ)" -- see hankelMatrix, --
        matrix with constant anti-diagonal entries
      * "hankelMatrix(ZZ,ZZ)" -- see hankelMatrix, --
        matrix with constant anti-diagonal entries
      * "homotopyRanks(ZZ,ZZ)" -- see homotopyRanks, --
        compute the ranks of the quadratic homotopies on a carpet
      * "productOfProjectiveSpaces(List)" -- see
        productOfProjectiveSpaces, -- Constructs the
        multi-graded ring of a product of copies of P^1 (pp is a synonym)
      * "productOfProjectiveSpaces(List,Symbol)" -- see
        productOfProjectiveSpaces, -- Constructs the
        multi-graded ring of a product of copies of P^1 (pp is a synonym)
      * "productOfProjectiveSpaces(List,Symbol,Ring)" -- see
        productOfProjectiveSpaces, -- Constructs the
        multi-graded ring of a product of copies of P^1 (pp is a synonym)
      * "productOfProjectiveSpaces(ZZ)" -- see productOfProjectiveSpaces,
        -- Constructs the multi-graded ring of a
        product of copies of P^1 (pp is a synonym)
      * "productOfProjectiveSpaces(ZZ,Symbol)" -- see
        productOfProjectiveSpaces, -- Constructs the
        multi-graded ring of a product of copies of P^1 (pp is a synonym)
      * "relativeEquations(ZZ,ZZ,ZZ)" -- see relativeEquations,
        -- compute the relative quadrics
      * "relativeResolution(ZZ,ZZ,ZZ)" -- see relativeResolution,
        -- compute the relative resolution
      * "relativeResolutionTwists(ZZ,ZZ,Complex)" -- see
        relativeResolutionTwists, -- compute the
        twists in the relative resolution
      * "resonanceDet(ZZ)" -- see resonanceDet, -- compute
        the resonance determinant of the crucial constant strand of a
        degenerate K3 X_e(a,a)
      * "resonanceScroll(ZZ,ZZ,ZZ)" -- see resonanceScroll,
        -- compute the splitting type of the resonance scroll
      * "schemeInProduct(Ideal,List,Ring)" -- see schemeInProduct,
        -- multi-graded Ideal of the image of a map to a
        product of projective spaces
      * "schemeInProduct(Ideal,List,Symbol)" -- see schemeInProduct,
        -- multi-graded Ideal of the image of a map to a
        product of projective spaces
      * "schreyerName(Complex)" -- see schreyerName, -- get
        the names of generators in the (nonminimal) Schreyer resolution
        according to Schreyer's convention
      * "schreyerName(Complex,ZZ)" -- see schreyerName, --
        get the names of generators in the (nonminimal) Schreyer resolution
        according to Schreyer's convention
      * "schreyerName(Complex,ZZ,ZZ)" -- see schreyerName,
        -- get the names of generators in the (nonminimal) Schreyer resolution
        according to Schreyer's convention
      * "schreyerName(HashTable,ZZ,ZZ)" -- see schreyerName,
        -- get the names of generators in the (nonminimal)
        Schreyer resolution according to Schreyer's convention
      * "smallDiagonal(Ring)" -- see smallDiagonal, --
        Ideal of the small diagonal in (P^1)^n
      * "smallDiagonal(ZZ)" -- see smallDiagonal, -- Ideal
        of the small diagonal in (P^1)^n
  * Symbols
      * FineGrading -- Option for carpet, canonicalCarpet
      * Scrolls -- Option for carpet, canonicalCarpet

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

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

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

The source of this document is in K3Carpets.m2:1057:0.

allGradings -- add Grading to a Complex
***************************************

  * Usage:
        Fall = allGradings(F,S)
  * Inputs:
      * F, a complex (Complexes), the free resolution of an
        ideal
      * S, a ring (Macaulay2Doc), a ring with a finer garding
  * Outputs:
      * Fall, a complex (Complexes), a complex over S, the same
        as F but now with homogeneous with respect to all gradings of S

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

Given a resolution F of an ideal, with carries additional homogeneity with
respect to the finer graded ring S, we compute the grading.

+-----------------------------------------------------------------------------+
|i1 : a=3,b=3                                                                 |
|                                                                             |
|o1 = (3, 3)                                                                  |
|                                                                             |
|o1 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i2 : I=carpet(a,b);                                                          |
|                                                                             |
|                ZZ                                                           |
|o2 : Ideal of -----[x ..x , y ..y ]                                          |
|              32003  0   3   0   3                                           |
+-----------------------------------------------------------------------------+
|i3 : F = freeResolution(I,Strategy => Nonminimal,LengthLimit=>2);            |
+-----------------------------------------------------------------------------+
|i4 : betti F                                                                 |
|                                                                             |
|            0  1  2                                                          |
|o4 = total: 1 10 25                                                          |
|         0: 1  .  .                                                          |
|         1: . 10 16                                                          |
|         2: .  .  9                                                          |
|                                                                             |
|o4 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i5 : degs=apply(a+1,i->{1,0,i})|apply(b+1,j->{0,1,j})                        |
|                                                                             |
|o5 = {{1, 0, 0}, {1, 0, 1}, {1, 0, 2}, {1, 0, 3}, {0, 1, 0}, {0, 1, 1}, {0,  |
|     ------------------------------------------------------------------------|
|     1, 2}, {0, 1, 3}}                                                       |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : S=coefficientRing ring I[gens ring I,Degrees=>degs]                     |
|                                                                             |
|o6 = S                                                                       |
|                                                                             |
|o6 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i7 : Fall = allGradings(F,S)                                                 |
|                                                                             |
|      1      10      25                                                      |
|o7 = S  <-- S   <-- S                                                        |
|                                                                             |
|     0      1       2                                                        |
|                                                                             |
|o7 : Complex                                                                 |
+-----------------------------------------------------------------------------+
|i8 : netList apply(length Fall+1,i->tally degrees Fall_i)                    |
|                                                                             |
|     +---------------------+                                                 |
|o8 = |Tally{{0, 0, 0} => 1}|                                                 |
|     +---------------------+                                                 |
|     |Tally{{0, 2, 2} => 1}|                                                 |
|     |      {0, 2, 3} => 1 |                                                 |
|     |      {0, 2, 4} => 1 |                                                 |
|     |      {1, 1, 2} => 1 |                                                 |
|     |      {1, 1, 3} => 2 |                                                 |
|     |      {1, 1, 4} => 1 |                                                 |
|     |      {2, 0, 2} => 1 |                                                 |
|     |      {2, 0, 3} => 1 |                                                 |
|     |      {2, 0, 4} => 1 |                                                 |
|     +---------------------+                                                 |
|     |Tally{{0, 3, 4} => 1}|                                                 |
|     |      {0, 3, 5} => 1 |                                                 |
|     |      {1, 2, 3} => 1 |                                                 |
|     |      {1, 2, 4} => 2 |                                                 |
|     |      {1, 2, 5} => 2 |                                                 |
|     |      {1, 2, 6} => 1 |                                                 |
|     |      {1, 3, 6} => 1 |                                                 |
|     |      {1, 3, 7} => 1 |                                                 |
|     |      {2, 1, 3} => 1 |                                                 |
|     |      {2, 1, 4} => 2 |                                                 |
|     |      {2, 1, 5} => 2 |                                                 |
|     |      {2, 1, 6} => 1 |                                                 |
|     |      {2, 2, 4} => 1 |                                                 |
|     |      {2, 2, 5} => 1 |                                                 |
|     |      {2, 2, 6} => 1 |                                                 |
|     |      {2, 2, 7} => 1 |                                                 |
|     |      {2, 2, 8} => 1 |                                                 |
|     |      {3, 0, 4} => 1 |                                                 |
|     |      {3, 0, 5} => 1 |                                                 |
|     |      {3, 1, 5} => 1 |                                                 |
|     |      {3, 1, 6} => 1 |                                                 |
|     +---------------------+                                                 |
+-----------------------------------------------------------------------------+

Ways to use allGradings:
========================

  * "allGradings(Complex,Ring)"

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

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

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

The source of this document is in K3Carpets.m2:1306:0.

analyzeStrand -- analyze the (a+1)-st constant strand of F over ZZ
******************************************************************

  * Usage:
        L = analyzeStrand(F,a)
  * Inputs:
      * F, a complex (Complexes), the nonminimal resolution of a
        carpet over large prime
      * a, an integer (Macaulay2Doc), a+1 is the degree of the strand
  * Outputs:
      * L, a list (Macaulay2Doc), the diagonal entries of the Smith
        normal form of a the crucial matrix

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

Starting from a nonminimal resolution F of the carpet over a larger finite
prime field, we lift the complex to the integers, and compute the diagonal
entries of the Smith normal form. The critical constrand strand for a carpet of
type (a,b) with a>=b is the a+1-st strand. Green's conjecture for carpet says
that the map has maximal rank over QQ.

+-----------------------------------------------------------------------------+
|i1 : a=5,b=5                                                                 |
|                                                                             |
|o1 = (5, 5)                                                                  |
|                                                                             |
|o1 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i2 : I = carpet(a,b);                                                        |
|                                                                             |
|                ZZ                                                           |
|o2 : Ideal of -----[x ..x , y ..y ]                                          |
|              32003  0   5   0   5                                           |
+-----------------------------------------------------------------------------+
|i3 : F = freeResolution(I, Strategy => Nonminimal)                           |
|                                                                             |
|        ZZ                  1        ZZ                  36                  |
|o3 = (-----[x ..x , y ..y ])  <-- (-----[x ..x , y ..y ])   <--              |
|      32003  0   5   0   5         32003  0   5   0   5                      |
|                                                                             |
|     0                            1                                          |
|                                                                             |
|o3 : Complex                                                                 |
|-----------------------------------------------------------------------------|
|   ZZ                  187        ZZ                  491        ZZ          |
|(-----[x ..x , y ..y ])    <-- (-----[x ..x , y ..y ])    <-- (-----[x ..x , |
| 32003  0   5   0   5           32003  0   5   0   5           32003  0   5  |
|                                                                             |
|2                              3                              4              |
|-----------------------------------------------------------------------------|
|        793        ZZ                  833        ZZ                  573    |
|y ..y ])    <-- (-----[x ..x , y ..y ])    <-- (-----[x ..x , y ..y ])    <--|
| 0   5           32003  0   5   0   5           32003  0   5   0   5         |
|                                                                             |
|                5                              6                             |
|-----------------------------------------------------------------------------|
|   ZZ                  250        ZZ                  63        ZZ           |
|(-----[x ..x , y ..y ])    <-- (-----[x ..x , y ..y ])   <-- (-----[x ..x ,  |
| 32003  0   5   0   5           32003  0   5   0   5          32003  0   5   |
|                                                                             |
|7                              8                             9               |
|-----------------------------------------------------------------------------|
|        7                                                                    |
|y ..y ])                                                                     |
| 0   5                                                                       |
+-----------------------------------------------------------------------------+
|i4 : L = analyzeStrand(F,a); #L                                              |
| -- .070198s elapsed                                                         |
|                                                                             |
|o5 = 350                                                                     |
+-----------------------------------------------------------------------------+
|i6 : betti F_a, betti F                                                      |
|                                                                             |
|               0         0  1   2   3   4   5   6   7  8 9                   |
|o6 = (total: 833, total: 1 36 187 491 793 833 573 250 63 7)                  |
|          6: 350      0: 1  .   .   .   .   .   .   .  . .                   |
|          7: 468      1: . 36 160 342 436 350 174  49  6 .                   |
|          8:  15      2: .  .  27 148 351 468 379 186 51 6                   |
|                      3: .  .   .   1   6  15  20  15  6 1                   |
|                                                                             |
|o6 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i7 : factor product L                                                        |
|                                                                             |
|      266 15                                                                 |
|o7 = 2   3                                                                   |
|                                                                             |
|o7 : Expression of class Product                                             |
+-----------------------------------------------------------------------------+
|i8 : L3 = select(L,c->c%3==0); #L3                                           |
|                                                                             |
|o9 = 14                                                                      |
+-----------------------------------------------------------------------------+
|i10 : carpetBettiTable(a,b,3)                                                |
| -- .00305395s elapsed                                                       |
| -- .00891401s elapsed                                                       |
| -- .0333633s elapsed                                                        |
| -- .0142799s elapsed                                                        |
| -- .00482671s elapsed                                                       |
|                                                                             |
|             0  1   2   3   4   5   6   7  8 9                               |
|o10 = total: 1 36 160 315 302 302 315 160 36 1                               |
|          0: 1  .   .   .   .   .   .   .  . .                               |
|          1: . 36 160 315 288  14   .   .  . .                               |
|          2: .  .   .   .  14 288 315 160 36 .                               |
|          3: .  .   .   .   .   .   .   .  . 1                               |
|                                                                             |
|o10 : BettiTally                                                             |
+-----------------------------------------------------------------------------+

See also
========

  * carpetBettiTable -- compute the Betti tables of a
    carpet of given genus and Clifford index over a prime field of
    characteristic p

Ways to use analyzeStrand:
==========================

  * "analyzeStrand(Complex,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1275:0.

canonicalCarpet -- Carpet of given genus and Clifford index
***********************************************************

  * Usage:
        I = canonicalCarpet(g,cliff)
        (I,xmat,ymat) = canonicalCarpet(g,cliff,Scrolls=>true)
  * Inputs:
      * g, an integer (Macaulay2Doc), desired genus
      * cliff, an integer (Macaulay2Doc), desired clifford index
  * Optional inputs (Macaulay2Doc),:
      * Characteristic => an integer (Macaulay2Doc), default value
        32003, the characteristic of the ground field
      * Scrolls => a Boolean value (Macaulay2Doc), default value
        false, if true return in addition the matrices defining the sections
      * FineGrading => a Boolean value (Macaulay2Doc), default
        value false, if true then I is defined over the ring with
        $\ZZ^4$-grading
  * Outputs:
      * I, an ideal (Macaulay2Doc), ideal of the K3 Carpet of
        (sectional) genus g, Clifford index cliff

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

This is just a re-indexing of the carpet script: canonicalCarpet(g,cliff) =
carpet(g-cliff-1, cliff). Here the natural choices for cliff are $1 \leq{}
cliff \leq{} (g-1)//2$.

See also
========

  * carpet -- Ideal of the unique Gorenstein double structure on
    a 2-dimensional scroll

Ways to use canonicalCarpet:
============================

  * "canonicalCarpet(ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1235:0.

canonicalHomotopies -- Homotopies on the resolution of a K3 carpet
******************************************************************

  * Usage:
        (F,h) = canonicalHomotopies(g, cliff)
  * Inputs:
      * g, an integer (Macaulay2Doc),
      * cliff, an integer (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Characteristic => an integer (Macaulay2Doc), default value
        32003, the characteristic of the ground field
      * FineGrading => a Boolean value (Macaulay2Doc), default
        value false, if true then F is defined over the ring with
        $\ZZ^4$-grading
  * Outputs:
      * F, a complex (Complexes), free resolution of the
        canonical carpet of genus g, clifford index cliff
      * h, a function (Macaulay2Doc), h(i,j) is the homotopy
        with source F_j for the i-th quadric.

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

By default the option FineGrading is set to false. With FineGrading=>true the
script returns the $\ZZ^4$-graded resolution, and the function h returns the
homotopies one graded component at a time as a HashTable.

Note that the homotopies are 0 except in the middle part of the resolution,
where there is a generator degree common to two consecutive free modules.

+-----------------------------------------------------------------------------+
|i1 : (F,h0) = canonicalHomotopies(7,3)                                       |
|                                                                             |
|         ZZ                  1        ZZ                  10                 |
|o1 = ((-----[x ..x , y ..y ])  <-- (-----[x ..x , y ..y ])   <--             |
|       32003  0   3   0   3         32003  0   3   0   3                     |
|                                                                             |
|      0                            1                                         |
|     ------------------------------------------------------------------------|
|        ZZ                  16        ZZ                  16                 |
|     (-----[x ..x , y ..y ])   <-- (-----[x ..x , y ..y ])   <--             |
|      32003  0   3   0   3          32003  0   3   0   3                     |
|                                                                             |
|     2                             3                                         |
|     ------------------------------------------------------------------------|
|        ZZ                  10        ZZ                  1                  |
|     (-----[x ..x , y ..y ])   <-- (-----[x ..x , y ..y ]) , h0)             |
|      32003  0   3   0   3          32003  0   3   0   3                     |
|                                                                             |
|     4                             5                                         |
|                                                                             |
|o1 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i2 : betti F                                                                 |
|                                                                             |
|            0  1  2  3  4 5                                                  |
|o2 = total: 1 10 16 16 10 1                                                  |
|         0: 1  .  .  .  . .                                                  |
|         1: . 10 16  .  . .                                                  |
|         2: .  .  . 16 10 .                                                  |
|         3: .  .  .  .  . 1                                                  |
|                                                                             |
|o2 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i3 : netList apply(length F, j-> sum(rank F_1, i->h0(i,j)))                  |
|                                                                             |
|     +-------------------------------------------------------+               |
|o3 = |{2} | 1 |                                              |               |
|     |{2} | 1 |                                              |               |
|     |{2} | 1 |                                              |               |
|     |{2} | 1 |                                              |               |
|     |{2} | 1 |                                              |               |
|     |{2} | 1 |                                              |               |
|     |{2} | 1 |                                              |               |
|     |{2} | 1 |                                              |               |
|     |{2} | 1 |                                              |               |
|     |{2} | 1 |                                              |               |
|     +-------------------------------------------------------+               |
|     |0                                                      |               |
|     +-------------------------------------------------------+               |
|     |{5} | -1 -1 1  -1 -1 0  0  0  0  0  0  0  0  0  0  0  ||               |
|     |{5} | -1 -1 0  0  0  1  -1 -1 0  0  0  0  0  0  0  0  ||               |
|     |{5} | -1 0  -2 0  0  2  0  0  -2 -2 -1 0  0  0  0  0  ||               |
|     |{5} | 0  1  -2 0  0  2  0  0  0  -2 0  -1 0  0  0  0  ||               |
|     |{5} | -1 0  0  -1 0  0  1  0  -1 0  0  0  -1 0  0  0  ||               |
|     |{5} | 0  1  0  -1 0  0  1  0  0  -1 0  0  0  -1 0  0  ||               |
|     |{5} | 0  0  2  -1 0  0  0  0  2  -2 0  0  0  0  -1 0  ||               |
|     |{5} | 1  0  0  0  -2 0  0  2  0  -2 -1 0  2  0  0  0  ||               |
|     |{5} | 0  1  0  0  2  0  0  -2 0  0  0  1  0  -2 0  0  ||               |
|     |{5} | 0  0  1  0  1  0  0  0  0  -2 -1 1  0  0  -1 0  ||               |
|     |{5} | 0  0  0  1  2  0  0  0  0  0  0  0  -2 2  -1 0  ||               |
|     |{5} | 0  0  0  0  0  -2 1  0  -2 2  0  0  0  0  0  -1 ||               |
|     |{5} | 0  0  0  0  0  -1 0  -1 0  2  1  -1 0  0  0  -1 ||               |
|     |{5} | 0  0  0  0  0  0  -1 -2 0  0  0  0  2  -2 0  -1 ||               |
|     |{5} | 0  0  0  0  0  0  0  0  -1 -2 -1 0  1  0  -1 -1 ||               |
|     |{5} | 0  0  0  0  0  0  0  0  0  -1 0  -1 0  1  -1 -1 ||               |
|     +-------------------------------------------------------+               |
|     |0                                                      |               |
|     +-------------------------------------------------------+               |
|     |{8} | -1 -1 1 -1 1 1 1 -1 1 1 |                        |               |
|     +-------------------------------------------------------+               |
+-----------------------------------------------------------------------------+
|i4 : H = makeHomotopies1(F.dd_1, F);                                         |
+-----------------------------------------------------------------------------+
|i5 : (F,h0) = canonicalHomotopies(7,3, FineGrading=>true);                   |
+-----------------------------------------------------------------------------+
|i6 : h0(0,2)                                                                 |
|                                                                             |
|o6 = HashTable{{1, 4, 7, 8} => 0                     }                       |
|               {1, 4, 8, 7} => 0                                             |
|               {2, 3, 6, 9} => {2, 3, 6, 9} | -1 |                           |
|               {2, 3, 7, 8} => {2, 3, 7, 8} | 0  |                           |
|                               {2, 3, 7, 8} | -1 |                           |
|               {2, 3, 8, 7} => 0                                             |
|               {2, 3, 9, 6} => 0                                             |
|               {3, 2, 5, 10} => 0                                            |
|               {3, 2, 6, 9} => {3, 2, 6, 9} | -2 -1 |                        |
|               {3, 2, 7, 8} => {3, 2, 7, 8} | -1 0  |                        |
|                               {3, 2, 7, 8} | 0  -1 |                        |
|               {3, 2, 8, 7} => {3, 2, 8, 7} | -1 |                           |
|                               {3, 2, 8, 7} | 0  |                           |
|               {3, 2, 9, 6} => 0                                             |
|               {4, 1, 5, 10} => 0                                            |
|               {4, 1, 6, 9} => 0                                             |
|               {4, 1, 7, 8} => {4, 1, 7, 8} | -1 0 |                         |
|               {4, 1, 8, 7} => {4, 1, 8, 7} | -1 |                           |
|               {5, 0, 6, 9} => 0                                             |
|               {5, 0, 7, 8} => 0                                             |
|                                                                             |
|o6 : HashTable                                                               |
+-----------------------------------------------------------------------------+
|i7 : homotopyRanks(7,3)                                                      |
|       0  1  2  3  4 5                                                       |
|total: 1 10 16 16 10 1                                                       |
|    0: 1  .  .  .  . .                                                       |
|    1: . 10 16  .  . .                                                       |
|    2: .  .  . 16 10 .                                                       |
|    3: .  .  .  .  . 1                                                       |
|                                                                             |
|     +-------------------------+---------------+                             |
|o7 = || x_1^2-x_0x_2 |         |{1, 0, 8, 0, 1}|                             |
|     +-------------------------+---------------+                             |
|     || x_1x_2-x_0x_3 |        |{1, 0, 8, 0, 1}|                             |
|     +-------------------------+---------------+                             |
|     || x_2^2-x_1x_3 |         |{1, 0, 8, 0, 1}|                             |
|     +-------------------------+---------------+                             |
|     || x_2y_0-2x_1y_1+x_0y_2 ||{1, 0, 8, 0, 1}|                             |
|     +-------------------------+---------------+                             |
|     || x_3y_0-2x_2y_1+x_1y_2 ||{1, 0, 8, 0, 1}|                             |
|     +-------------------------+---------------+                             |
|     || x_2y_1-2x_1y_2+x_0y_3 ||{1, 0, 8, 0, 1}|                             |
|     +-------------------------+---------------+                             |
|     || x_3y_1-2x_2y_2+x_1y_3 ||{1, 0, 8, 0, 1}|                             |
|     +-------------------------+---------------+                             |
|     || y_1^2-y_0y_2 |         |{1, 0, 8, 0, 1}|                             |
|     +-------------------------+---------------+                             |
|     || y_1y_2-y_0y_3 |        |{1, 0, 8, 0, 1}|                             |
|     +-------------------------+---------------+                             |
|     || y_2^2-y_1y_3 |         |{1, 0, 8, 0, 1}|                             |
|     +-------------------------+---------------+                             |
+-----------------------------------------------------------------------------+

See also
========

  * canonicalCarpet -- Carpet of given genus and
    Clifford index

Ways to use canonicalHomotopies:
================================

  * "canonicalHomotopies(ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1596:0.

carpet -- Ideal of the unique Gorenstein double structure on a 2-dimensional scroll
***********************************************************************************

  * Usage:
        I = carpet(a1,a2)
        I = carpet(a1,a2,m)
        (I,xmat,ymat) = carpet(a1,a2,Scrolls=>true)
  * Inputs:
      * a1, an integer (Macaulay2Doc),
      * a2, an integer (Macaulay2Doc), a1 and a2 should be positive
      * m, a matrix (Macaulay2Doc), a 2xn matrix for some $n
        \ge{} a1+a2$
  * Optional inputs (Macaulay2Doc),:
      * Characteristic => an integer (Macaulay2Doc), default value
        32003, the characteristic of the ground field
      * Scrolls => a Boolean value (Macaulay2Doc), default value
        false, if true return in addition the matrices defining the sections
      * FineGrading => a Boolean value (Macaulay2Doc), default
        value false, if true then I is defined over the ring with
        $\ZZ^4$-grading
  * Outputs:
      * I, an ideal (Macaulay2Doc),
      * xmat, a matrix (Macaulay2Doc),
      * ymat, a matrix (Macaulay2Doc), the matrices of the
        sections of the scroll
  * Consequences:
      * If no matrix m is present then the script creates a type a1,a2
        K3-carpet over a new ring. If m is given, then an ideal made from
        certain minors and sums of minors of m is produced. The characteristic
        is given by the option, defaulting to 32003. If the option FineGrading
        is set to true, then the ideal is returned with the natural $\ZZ^4$
        grading (the default is FineGrading => false). This last may not work
        unless the matrix is of scroll type (or not given!) If Scrolls=>true,
        then a sequence of three items is returned, the second and third being
        the smaller and larger scroll matrices.

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

The routine carpet(a1,a2,m) sets a = min(a1,a2), b = max(a1,a2), and forms two
matrices from m: X:the 2 x a matrix that is the first a cols of m; Y:the 2 x b
matrix that is the nex b cols of m–that is, cols a1..a1+a2-1 of m; Let Ix, Iy
be the ideals of 2 x 2 minors of X and Y. If $a,b\geq 2$,the routine returns
Ix+Iy+Imixed, where Imixed consists of the quadrics "outside minor - inside
minor", that is, $det(X_{\{i\}},Y_{\{j+1\}})-det(X_{\{i+1\}}|Y_{\{j\}})$, for
each pair of (i,i+1), (j,j+1) in the ranges a1 and a2.

If m is usual ideal of the scroll of type (a,b), then carpet(a,b,m) produces
the same ideal (over a different ring) as carpet(a,b). This is the ideal of the
2-dimensional rational normal scroll Scroll(a1,a2) is the ideal of 2 x 2 minors
of X|Y. The ideal I to be constructed is the ideal of the unique (numerically)
K3 scheme that is a double structure on the scroll S(a1,a2).

When a,b > 1, the carpet ideal I is the sum $Ix+Iy$ plus the ideal Imixed

When a = b = 1, I is the square of the determinant of X|Y.

When a = 1, b>1 (or symmetrically), I is defined as in the case a,b>1, after
replacing $$ X = \begin{pmatrix} x_0 \\ x_1 \end{pmatrix} $$

by the 2 x 2 matrix $$ \begin{pmatrix} x_0^2    &  x_0*x_1 \\ x_0*x_1  &  x_1^2
\end{pmatrix} $$ and changing $a$ to 2.

+-----------------------------------------------------------------------------+
|i1 : betti freeResolution carpet(2,5)                                        |
|                                                                             |
|            0  1  2  3  4  5 6                                               |
|o1 = total: 1 15 49 70 49 15 1                                               |
|         0: 1  .  .  .  .  . .                                               |
|         1: . 15 35 35 14  . .                                               |
|         2: .  . 14 35 35 15 .                                               |
|         3: .  .  .  .  .  . 1                                               |
|                                                                             |
|o1 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i2 : S = ZZ/101[a..j]                                                        |
|                                                                             |
|o2 = S                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : m = genericMatrix(S,a,2,5)                                              |
|                                                                             |
|o3 = | a c e g i |                                                           |
|     | b d f h j |                                                           |
|                                                                             |
|             2      5                                                        |
|o3 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i4 : I = carpet(2,3,m)                                                       |
|                                                                             |
|o4 = ideal (b*c - a*d, b*e - a*f, d*e - c*f, d*g - c*h - b*i + a*j, f*g - e*h|
|     ------------------------------------------------------------------------|
|     - d*i + c*j, h*i - g*j)                                                 |
|                                                                             |
|o4 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i5 : L = primaryDecomposition I;                                             |
+-----------------------------------------------------------------------------+
|i6 : betti freeResolution L_0                                                |
|                                                                             |
|            0  1  2  3 4                                                     |
|o6 = total: 1 10 20 15 4                                                     |
|         0: 1  .  .  . .                                                     |
|         1: . 10 20 15 4                                                     |
|                                                                             |
|o6 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i7 : betti freeResolution L_1                                                |
|                                                                             |
|            0  1  2  3  4 5                                                  |
|o7 = total: 1 15 40 45 24 5                                                  |
|         0: 1  .  .  .  . .                                                  |
|         1: . 15 40 45 24 5                                                  |
|                                                                             |
|o7 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

Caveat
======

We require $a1,a2 \ge 1$. If $a1>a2$ then the blocks are reversed, so that the
smaller block always comes first. The script generalizeScroll is a more general
tool that can do the same things.

See also
========

  * canonicalCarpet -- Carpet of given genus and
    Clifford index
  * gorensteinDouble -- attempts to produce a
    Gorenstein double structure J subset I
  * correspondenceScroll -- Union of planes
    joining points of rational normal curves according to a given
    correspondence

Ways to use carpet:
===================

  * "carpet(ZZ,ZZ)"
  * "carpet(ZZ,ZZ,Matrix)"

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

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

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

The source of this document is in K3Carpets.m2:1199:0.

carpetBettiTable -- compute the Betti tables of a carpet of given genus and Clifford index over a prime field of characteristic p
*********************************************************************************************************************************

  * Usage:
        h = carpetBettiTable(a,b,p)
        carpetBettiTable(h,p)
  * Inputs:
      * a, an integer (Macaulay2Doc), the larger value, i.e a>=b
      * b, an integer (Macaulay2Doc), the desired clifford index
      * h, a hash table (Macaulay2Doc), of carpet Betti tables
        for various characteristics of the ground field
      * p, an integer (Macaulay2Doc), the characteristic of the
        ground field
  * Outputs:
      * a Betti tally (Macaulay2Doc), the betti Table of a
        carpet of the given ground field

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

We compute the equation and nonminimal resolution F of the carpet of type (a,b)
where $a \ge b$ over a larger finite prime field, lift the complex to the
integers, which is possible since the coefficients are small. Finally we study
the nonminimal strands over ZZ by computing the Smith normal form. The
resulting data allow us to compute the Betti tables for arbitrary primes.

+----------------------------------------------------------+
|i1 : a=5,b=5                                              |
|                                                          |
|o1 = (5, 5)                                               |
|                                                          |
|o1 : Sequence                                             |
+----------------------------------------------------------+
|i2 : elapsedTime T=carpetBettiTable(a,b,3)                |
| -- .00616598s elapsed                                    |
| -- .0248723s elapsed                                     |
| -- .0339893s elapsed                                     |
| -- .0151263s elapsed                                     |
| -- .0159701s elapsed                                     |
| -- .672173s elapsed                                      |
|                                                          |
|            0  1   2   3   4   5   6   7  8 9             |
|o2 = total: 1 36 160 315 302 302 315 160 36 1             |
|         0: 1  .   .   .   .   .   .   .  . .             |
|         1: . 36 160 315 288  14   .   .  . .             |
|         2: .  .   .   .  14 288 315 160 36 .             |
|         3: .  .   .   .   .   .   .   .  . 1             |
|                                                          |
|o2 : BettiTally                                           |
+----------------------------------------------------------+
|i3 : J=canonicalCarpet(a+b+1,b,Characteristic=>3);        |
|                                                          |
|              ZZ                                          |
|o3 : Ideal of --[x ..x , y ..y ]                          |
|               3  0   5   0   5                           |
+----------------------------------------------------------+
|i4 : elapsedTime T'=minimalBetti J                        |
| -- .602584s elapsed                                      |
|                                                          |
|            0  1   2   3   4   5   6   7  8 9             |
|o4 = total: 1 36 160 315 302 302 315 160 36 1             |
|         0: 1  .   .   .   .   .   .   .  . .             |
|         1: . 36 160 315 288  14   .   .  . .             |
|         2: .  .   .   .  14 288 315 160 36 .             |
|         3: .  .   .   .   .   .   .   .  . 1             |
|                                                          |
|o4 : BettiTally                                           |
+----------------------------------------------------------+
|i5 : T-T'                                                 |
|                                                          |
|            0 1 2 3 4 5 6 7 8 9                           |
|o5 = total: . . . . . . . . . .                           |
|         1: . . . . . . . . . .                           |
|         2: . . . . . . . . . .                           |
|         3: . . . . . . . . . .                           |
|                                                          |
|o5 : BettiTally                                           |
+----------------------------------------------------------+
|i6 : elapsedTime h=carpetBettiTables(6,6);                |
| -- .00578034s elapsed                                    |
| -- .0246391s elapsed                                     |
| -- .356512s elapsed                                      |
| -- 2.3736s elapsed                                       |
| -- .707693s elapsed                                      |
| -- .0716876s elapsed                                     |
| -- .0107126s elapsed                                     |
| -- 10.4121s elapsed                                      |
+----------------------------------------------------------+
|i7 : carpetBettiTable(h,7)                                |
|                                                          |
|            0  1   2   3    4    5    6    7   8   9 10 11|
|o7 = total: 1 55 320 891 1408 1155 1155 1408 891 320 55  1|
|         0: 1  .   .   .    .    .    .    .   .   .  .  .|
|         1: . 55 320 891 1408 1155    .    .   .   .  .  .|
|         2: .  .   .   .    .    . 1155 1408 891 320 55  .|
|         3: .  .   .   .    .    .    .    .   .   .  .  1|
|                                                          |
|o7 : BettiTally                                           |
+----------------------------------------------------------+
|i8 : carpetBettiTable(h,5)                                |
|                                                          |
|            0  1   2   3    4    5    6    7   8   9 10 11|
|o8 = total: 1 55 320 891 1408 1275 1275 1408 891 320 55  1|
|         0: 1  .   .   .    .    .    .    .   .   .  .  .|
|         1: . 55 320 891 1408 1155  120    .   .   .  .  .|
|         2: .  .   .   .    .  120 1155 1408 891 320 55  .|
|         3: .  .   .   .    .    .    .    .   .   .  .  1|
|                                                          |
|o8 : BettiTally                                           |
+----------------------------------------------------------+

See also
========

  * carpetBettiTables -- compute the Betti tables of
    a carpet of given genus and Clifford index over all prime fields

Ways to use carpetBettiTable:
=============================

  * "carpetBettiTable(HashTable,ZZ)"
  * "carpetBettiTable(ZZ,ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1498:0.

carpetBettiTables -- compute the Betti tables of a carpet of given genus and Clifford index over all prime fields
*****************************************************************************************************************

  * Usage:
        h = carpetBettiTables(a,b)
  * Inputs:
      * a, an integer (Macaulay2Doc), the larger value, i.e a>=b
      * b, an integer (Macaulay2Doc), the desired clifford index
  * Outputs:
      * h, a hash table (Macaulay2Doc), of carpet Betti tables
        for various characteristics of the ground field

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

We compute the equation and nonminimal resolution F of the carpet of type (a,b)
where $a \ge b$ over a larger finite prime field, lift the complex to the
integers, which is possible since the coefficients are small. Finally we study
the nonminimal strands over ZZ by computing the Smith normal form. The
resulting data allow us to compute the Betti tables for arbitrary primes.

+-------------------------------------------------------------+
|i1 : a=5,b=5                                                 |
|                                                             |
|o1 = (5, 5)                                                  |
|                                                             |
|o1 : Sequence                                                |
+-------------------------------------------------------------+
|i2 : h=carpetBettiTables(a,b)                                |
| -- .00306988s elapsed                                       |
| -- .0146628s elapsed                                        |
| -- .0670512s elapsed                                        |
| -- .0308611s elapsed                                        |
| -- .00751968s elapsed                                       |
|                                                             |
|                           0  1   2   3   4   5   6   7  8 9 |
|o2 = HashTable{0 => total: 1 36 160 315 288 288 315 160 36 1}|
|                        0: 1  .   .   .   .   .   .   .  . . |
|                        1: . 36 160 315 288   .   .   .  . . |
|                        2: .  .   .   .   . 288 315 160 36 . |
|                        3: .  .   .   .   .   .   .   .  . 1 |
|                           0  1   2   3   4   5   6   7  8 9 |
|               2 => total: 1 36 167 370 476 476 370 167 36 1 |
|                        0: 1  .   .   .   .   .   .   .  . . |
|                        1: . 36 160 322 336 140  48   7  . . |
|                        2: .  .   7  48 140 336 322 160 36 . |
|                        3: .  .   .   .   .   .   .   .  . 1 |
|                           0  1   2   3   4   5   6   7  8 9 |
|               3 => total: 1 36 160 315 302 302 315 160 36 1 |
|                        0: 1  .   .   .   .   .   .   .  . . |
|                        1: . 36 160 315 288  14   .   .  . . |
|                        2: .  .   .   .  14 288 315 160 36 . |
|                        3: .  .   .   .   .   .   .   .  . 1 |
|                                                             |
|o2 : HashTable                                               |
+-------------------------------------------------------------+
|i3 : T= carpetBettiTable(h,3)                                |
|                                                             |
|            0  1   2   3   4   5   6   7  8 9                |
|o3 = total: 1 36 160 315 302 302 315 160 36 1                |
|         0: 1  .   .   .   .   .   .   .  . .                |
|         1: . 36 160 315 288  14   .   .  . .                |
|         2: .  .   .   .  14 288 315 160 36 .                |
|         3: .  .   .   .   .   .   .   .  . 1                |
|                                                             |
|o3 : BettiTally                                              |
+-------------------------------------------------------------+
|i4 : J=canonicalCarpet(a+b+1,b,Characteristic=>3);           |
|                                                             |
|              ZZ                                             |
|o4 : Ideal of --[x ..x , y ..y ]                             |
|               3  0   5   0   5                              |
+-------------------------------------------------------------+
|i5 : elapsedTime T'=minimalBetti J                           |
| -- .627052s elapsed                                         |
|                                                             |
|            0  1   2   3   4   5   6   7  8 9                |
|o5 = total: 1 36 160 315 302 302 315 160 36 1                |
|         0: 1  .   .   .   .   .   .   .  . .                |
|         1: . 36 160 315 288  14   .   .  . .                |
|         2: .  .   .   .  14 288 315 160 36 .                |
|         3: .  .   .   .   .   .   .   .  . 1                |
|                                                             |
|o5 : BettiTally                                              |
+-------------------------------------------------------------+
|i6 : T-T'                                                    |
|                                                             |
|            0 1 2 3 4 5 6 7 8 9                              |
|o6 = total: . . . . . . . . . .                              |
|         1: . . . . . . . . . .                              |
|         2: . . . . . . . . . .                              |
|         3: . . . . . . . . . .                              |
|                                                             |
|o6 : BettiTally                                              |
+-------------------------------------------------------------+
|i7 : elapsedTime h=carpetBettiTables(6,6);                   |
| -- .00599061s elapsed                                       |
| -- .049054s elapsed                                         |
| -- .322746s elapsed                                         |
| -- 2.3106s elapsed                                          |
| -- .801938s elapsed                                         |
| -- .0542677s elapsed                                        |
| -- .018467s elapsed                                         |
| -- 10.7873s elapsed                                         |
+-------------------------------------------------------------+
|i8 : keys h                                                  |
|                                                             |
|o8 = {0, 2, 3, 5}                                            |
|                                                             |
|o8 : List                                                    |
+-------------------------------------------------------------+
|i9 : carpetBettiTable(h,7)                                   |
|                                                             |
|            0  1   2   3    4    5    6    7   8   9 10 11   |
|o9 = total: 1 55 320 891 1408 1155 1155 1408 891 320 55  1   |
|         0: 1  .   .   .    .    .    .    .   .   .  .  .   |
|         1: . 55 320 891 1408 1155    .    .   .   .  .  .   |
|         2: .  .   .   .    .    . 1155 1408 891 320 55  .   |
|         3: .  .   .   .    .    .    .    .   .   .  .  1   |
|                                                             |
|o9 : BettiTally                                              |
+-------------------------------------------------------------+
|i10 : carpetBettiTable(h,5)                                  |
|                                                             |
|             0  1   2   3    4    5    6    7   8   9 10 11  |
|o10 = total: 1 55 320 891 1408 1275 1275 1408 891 320 55  1  |
|          0: 1  .   .   .    .    .    .    .   .   .  .  .  |
|          1: . 55 320 891 1408 1155  120    .   .   .  .  .  |
|          2: .  .   .   .    .  120 1155 1408 891 320 55  .  |
|          3: .  .   .   .    .    .    .    .   .   .  .  1  |
|                                                             |
|o10 : BettiTally                                             |
+-------------------------------------------------------------+

See also
========

  * carpetBettiTable -- compute the Betti tables of a
    carpet of given genus and Clifford index over a prime field of
    characteristic p

Ways to use carpetBettiTables:
==============================

  * "carpetBettiTables(ZZ,ZZ)"

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

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

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

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

carpetDet -- compute the determinant of the crucial constant strand of a carpet X(a,b)
**************************************************************************************

  * Usage:
        d = carpetDet(a,b)
  * Inputs:
      * a, an integer (Macaulay2Doc), the larger value, i.e a>=b
      * b, an integer (Macaulay2Doc), the desired clifford index
  * Outputs:
      * d, an integer (Macaulay2Doc), the crucial determinant

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

We compute  nonminimal resolution F of the carpet of type (a,b) over a finite
prime field, Lift this to a resolution over ZZ, introduce the fine grading,
grep the various blocks of the crucial map in the a-th strand, compute their
determinants and return their product.

+--------------------------------+
|i1 : a=4,b=4                    |
|                                |
|o1 = (4, 4)                     |
|                                |
|o1 : Sequence                   |
+--------------------------------+
|i2 : d=carpetDet(a,b)           |
| -- .0119443s elapsed           |
| -- .0356991s elapsed           |
| -- .000274165s elapsed         |
| -- .000221005s elapsed         |
| -- .000189255s elapsed         |
| -- .000178275s elapsed         |
| -- .000186109s elapsed         |
| -- .000189827s elapsed         |
| -- .000194957s elapsed         |
| -- .000212729s elapsed         |
| -- .000181261s elapsed         |
| -- .00019207s elapsed          |
| -- .000276289s elapsed         |
| -- .000246492s elapsed         |
| -- .000239339s elapsed         |
| -- .00023936s elapsed          |
| -- .00025592s elapsed          |
| -- .000187843s elapsed         |
| -- .000184697s elapsed         |
| -- .000177743s elapsed         |
| -- .000192882s elapsed         |
| -- .000195336s elapsed         |
| -- .0001971s elapsed           |
| -- .000197721s elapsed         |
| -- .000178866s elapsed         |
| -- .000181771s elapsed         |
| -- .000180499s elapsed         |
| -- .00143132s elapsed          |
|(number Of blocks, 26)          |
|1                               |
|1                               |
|1                               |
|1                               |
|2                               |
| 2                              |
|2                               |
| 2                              |
|2                               |
| 2                              |
|2 3                             |
| 2                              |
|2 3                             |
| 2                              |
|2 3                             |
| 2                              |
|2                               |
| 2                              |
|2                               |
|2                               |
|2                               |
| 2                              |
|2                               |
| 2                              |
|2                               |
| 2                              |
|2 3                             |
| 2                              |
|2 3                             |
| 2                              |
|2 3                             |
| 2                              |
|2                               |
| 2                              |
|2                               |
|2                               |
|1                               |
|1                               |
|1                               |
|1                               |
|                                |
|o2 = 3131031158784              |
+--------------------------------+
|i3 : factor d                   |
|                                |
|      32 6                      |
|o3 = 2  3                       |
|                                |
|o3 : Expression of class Product|
+--------------------------------+

See also
========

  * analyzeStrand -- analyze the (a+1)-st constant strand
    of F over ZZ

Ways to use carpetDet:
======================

  * "carpetDet(ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1335:0.

computeBound -- compute the bound for the good types in case of k resonance
***************************************************************************

  * Usage:
        (a,b) = computeBound(a1,b1,k)
        c = computeBound k
  * Inputs:
      * a1, an integer (Macaulay2Doc),
      * b1, an integer (Macaulay2Doc), type of the degenerate K3
      * k, an integer (Macaulay2Doc), the resonance
  * Outputs:
      * a, an integer (Macaulay2Doc),
      * b, an integer (Macaulay2Doc), minimal good type
      * c, an integer (Macaulay2Doc), lower bound for good a,b

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

The iterated mapping over the relative resolution of X_e(a,b) in the resonance
scroll has betti numbers in a range of a general 2k-gonal canonical curve of
genus a+b+1, if a,b are large enough, see ES2018. We compute the minimal type
$(a,b) \equiv (a1,b1) \mod  k$ where this becomes true.

In the second version c is the minimal value of a,b's for all congruence
classes mod k. We conjecture that c=k^2-k.

+------------------------------+
|i1 : (a,b)=computeBound(6,4,3)|
|                              |
|o1 = (9, 7)                   |
|                              |
|o1 : Sequence                 |
+------------------------------+
|i2 : computeBound 3           |
| -- .400456s elapsed          |
| -- .359619s elapsed          |
| -- .573136s elapsed          |
| -- .473573s elapsed          |
| -- .613806s elapsed          |
| -- .570937s elapsed          |
|                              |
|o2 = 6                        |
+------------------------------+

See also
========

  * relativeEquations -- compute the relative
    quadrics

Ways to use computeBound:
=========================

  * "computeBound(ZZ)"
  * "computeBound(ZZ,ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:2152:0.

correspondenceScroll -- Union of planes joining points of rational normal curves according to a given correspondence
********************************************************************************************************************

  * Usage:
        G = correspondenceScroll(I,scroll)
  * Inputs:
      * scroll, a list (Macaulay2Doc), list of positive integers,
        the degrees of disjoint rational normal curves
      * I, an ideal (Macaulay2Doc), ideal of a correspondence; an
        arbitrary subscheme of (P^1)^(#scroll)
  * Outputs:
      * G, an ideal (Macaulay2Doc), ideal of the generalized
        scroll

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

Let L = {a_0,..a_{(m-1)}}, and let P = P^{(#L-1+ sum L)}. Just as the ordinary
scroll S(L) is  the union of planes joining rational normal curves C_i of
degree a_i according to some chosen isomorphism among them (a (1,1,..,1)
correspondence), the generalized Scroll is the union of planes joining the
points that correspond under an arbitrary correspondence, specified by I.

Thus if I is the ideal of the small diagonal of (P^1)^m, then generalized
Scroll(I,L) is equal to S(L). If #L = 2, and I is the square of the ideal of
the diagonal, we get a K3 carpet:

+-----------------------------------------------------------------------------+
|i1 : L = {3,4}                                                               |
|                                                                             |
|o1 = {3, 4}                                                                  |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : x = symbol x;                                                           |
+-----------------------------------------------------------------------------+
|i3 : S = productOfProjectiveSpaces(#L,x) --creates the multi-graded ring of  |
|                                                                             |
|o3 = S                                                                       |
|                                                                             |
|o3 : PolynomialRing                                                          |
|-----------------------------------------------------------------------------|
|(P^1)^(#L)                                                                   |
+-----------------------------------------------------------------------------+
|i4 : Delta = smallDiagonal S -- the ideal of the small diagonal of (P^1)^(#L)|
|                                                                             |
|o4 = ideal(- x   x    + x   x   )                                            |
|              1,0 0,1    0,0 1,1                                             |
|                                                                             |
|o4 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i5 : G = correspondenceScroll(Delta, L)                                      |
|                                                                             |
|             2                                                               |
|o5 = ideal (y    - y   y   , y   y    - y   y   , y   y    - y   y   ,       |
|             1,3    1,2 1,4   1,2 1,3    1,1 1,4   1,1 1,3    1,0 1,4        |
|     ------------------------------------------------------------------------|
|                                                                     2       |
|     y   y    - y   y   , y   y    - y   y   , y   y    - y   y   , y    -   |
|      0,3 1,3    0,2 1,4   0,2 1,3    0,1 1,4   0,1 1,3    0,0 1,4   1,2     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     y   y   , y   y    - y   y   , y   y    - y   y   , y   y    - y   y   ,|
|      1,0 1,4   1,1 1,2    1,0 1,3   0,3 1,2    0,1 1,4   0,2 1,2    0,0 1,4 |
|     ------------------------------------------------------------------------|
|                           2                                                 |
|     y   y    - y   y   , y    - y   y   , y   y    - y   y   , y   y    -   |
|      0,1 1,2    0,0 1,3   1,1    1,0 1,2   0,3 1,1    0,0 1,4   0,2 1,1     |
|     ------------------------------------------------------------------------|
|                                                                             |
|     y   y   , y   y    - y   y   , y   y    - y   y   , y   y    - y   y   ,|
|      0,0 1,3   0,1 1,1    0,0 1,2   0,3 1,0    0,0 1,3   0,2 1,0    0,0 1,2 |
|     ------------------------------------------------------------------------|
|                           2                                     2           |
|     y   y    - y   y   , y    - y   y   , y   y    - y   y   , y    -       |
|      0,1 1,0    0,0 1,1   0,2    0,1 0,3   0,1 0,2    0,0 0,3   0,1         |
|     ------------------------------------------------------------------------|
|     y   y   )                                                               |
|      0,0 0,2                                                                |
|                                                                             |
|                ZZ                                                           |
|o5 : Ideal of -----[y   ..y   , y   ..y   ]                                  |
|              32003  0,0   0,3   1,0   1,4                                   |
+-----------------------------------------------------------------------------+
|i6 : minimalBetti G                                                          |
|                                                                             |
|            0  1  2   3  4  5 6                                              |
|o6 = total: 1 21 70 105 84 35 6                                              |
|         0: 1  .  .   .  .  . .                                              |
|         1: . 21 70 105 84 35 6                                              |
|                                                                             |
|o6 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i7 : G = correspondenceScroll(Delta^2, L)                                    |
|                                                                             |
|             2                                                          2    |
|o7 = ideal (y    - y   y   , y   y    - y   y   , y   y    - y   y   , y    -|
|             1,3    1,2 1,4   1,2 1,3    1,1 1,4   1,1 1,3    1,0 1,4   1,2  |
|     ------------------------------------------------------------------------|
|                                                                             |
|     y   y   , y   y    - y   y   , y   y    - 2y   y    + y   y   , y   y   |
|      1,0 1,4   1,1 1,2    1,0 1,3   0,3 1,2     0,2 1,3    0,1 1,4   0,2 1,2|
|     ------------------------------------------------------------------------|
|                              2                                              |
|     - 2y   y    + y   y   , y    - y   y   , y   y    - 3y   y    +         |
|         0,1 1,3    0,0 1,4   1,1    1,0 1,2   0,3 1,1     0,1 1,3           |
|     ------------------------------------------------------------------------|
|                                                                             |
|     2y   y   , y   y    - 2y   y    + y   y   , y   y    - 3y   y    +      |
|       0,0 1,4   0,2 1,1     0,1 1,2    0,0 1,3   0,3 1,0     0,1 1,2        |
|     ------------------------------------------------------------------------|
|                                                  2                          |
|     2y   y   , y   y    - 2y   y    + y   y   , y    - y   y   , y   y    - |
|       0,0 1,3   0,2 1,0     0,1 1,1    0,0 1,2   0,2    0,1 0,3   0,1 0,2   |
|     ------------------------------------------------------------------------|
|                2                                                            |
|     y   y   , y    - y   y   )                                              |
|      0,0 0,3   0,1    0,0 0,2                                               |
|                                                                             |
|                ZZ                                                           |
|o7 : Ideal of -----[y   ..y   , y   ..y   ]                                  |
|              32003  0,0   0,3   1,0   1,4                                   |
+-----------------------------------------------------------------------------+
|i8 : minimalBetti G                                                          |
|                                                                             |
|            0  1  2  3  4  5 6                                               |
|o8 = total: 1 15 35 42 35 15 1                                               |
|         0: 1  .  .  .  .  . .                                               |
|         1: . 15 35 21  .  . .                                               |
|         2: .  .  . 21 35 15 .                                               |
|         3: .  .  .  .  .  . 1                                               |
|                                                                             |
|o8 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

Here is how to make the generalized scroll corresponding to a general elliptic
curve in (P^1)^3. First, the general elliptic curve, as a plane cubic through
three given points:

+-----------------------------------------------------------------------------+
|i9 : T = ZZ/32003[y_0,y_1,y_2]                                               |
|                                                                             |
|o9 = T                                                                       |
|                                                                             |
|o9 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i10 : threepoints = gens intersect(ideal(y_0,y_1),ideal(y_0,y_2),ideal(y_1,y_|
|                                                                             |
|o10 = | y_1y_2 y_0y_2 y_0y_1 |                                               |
|                                                                             |
|              1      3                                                       |
|o10 : Matrix T  <-- T                                                        |
|-----------------------------------------------------------------------------|
|2))                                                                          |
+-----------------------------------------------------------------------------+
|i11 : f = threepoints*random(source threepoints, T^{-3}); -- general cubic   |
|                                                                             |
|              1      1                                                       |
|o11 : Matrix T  <-- T                                                        |
|-----------------------------------------------------------------------------|
|through the three points                                                     |
+-----------------------------------------------------------------------------+
|i12 : L = {2,2,2}                                                            |
|                                                                             |
|o12 = {2, 2, 2}                                                              |
|                                                                             |
|o12 : List                                                                   |
+-----------------------------------------------------------------------------+
|i13 : x = symbol x;                                                          |
+-----------------------------------------------------------------------------+
|i14 : S = productOfProjectiveSpaces(#L,x) --creates the multi-graded ring of |
|                                                                             |
|o14 = S                                                                      |
|                                                                             |
|o14 : PolynomialRing                                                         |
|-----------------------------------------------------------------------------|
|(P^1)^(#L)                                                                   |
+-----------------------------------------------------------------------------+
|i15 : ST = (flattenRing(T**S))_0                                             |
|                                                                             |
|o15 = ST                                                                     |
|                                                                             |
|o15 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i16 : irrel = irrelevantIdeal ST;                                            |
|                                                                             |
|o16 : Ideal of ST                                                            |
+-----------------------------------------------------------------------------+

Here the irrelevant ideal is the intersection of the 4 ideals of coordinates
(P^2 and the three copies of P^1). Next, define the pairs of sections on the
curve giving the three projections:

+-----------------------------------------------------------------------------+
|i17 : ff = entries sub(transpose matrix {{y_0,y_1},{y_0,y_2},{y_1,y_2}}, ST) |
|                                                                             |
|o17 = {{y , y , y }, {y , y , y }}                                           |
|         0   0   1     1   2   2                                             |
|                                                                             |
|o17 : List                                                                   |
|-----------------------------------------------------------------------------|
|-- projections from the three points                                         |
+-----------------------------------------------------------------------------+

And create the equations of the incidence variety

+-----------------------------------------------------------------------------+
|i18 : D1 = det matrix{{x_(0,0),ff_1_0},{x_(1,0),ff_0_0}}                     |
|                                                                             |
|o18 = y x    - y x                                                           |
|       0 0,0    1 1,0                                                        |
|                                                                             |
|o18 : ST                                                                     |
+-----------------------------------------------------------------------------+
|i19 : D2 = det matrix{{x_(0,1),ff_1_1},{x_(1,1),ff_0_1}}                     |
|                                                                             |
|o19 = y x    - y x                                                           |
|       0 0,1    2 1,1                                                        |
|                                                                             |
|o19 : ST                                                                     |
+-----------------------------------------------------------------------------+
|i20 : D3 = det matrix{{x_(0,2),ff_1_2},{x_(1,2),ff_0_2}}                     |
|                                                                             |
|o20 = y x    - y x                                                           |
|       1 0,2    2 1,2                                                        |
|                                                                             |
|o20 : ST                                                                     |
+-----------------------------------------------------------------------------+
|i21 : J = sub(ideal f, ST)+ideal(D1,D2,D3)                                   |
|                                                                             |
|                  2             2        2                        2          |
|o21 = ideal (8570y y  - 15344y y  + 3187y y  + 12334y y y  + 4376y y  -      |
|                  0 1         0 1        0 2         0 1 2        1 2        |
|      -----------------------------------------------------------------------|
|             2          2                                                    |
|      5307y y  - 5570y y , y x    - y x   , y x    - y x   , y x    - y x   )|
|           0 2        1 2   0 0,0    1 1,0   0 0,1    2 1,1   1 0,2    2 1,2 |
|                                                                             |
|o21 : Ideal of ST                                                            |
+-----------------------------------------------------------------------------+

This must be saturated with respect to the irrelevant ideal, and then the y
variables are eliminated, to get the curve in (P^1)^3.

+---------------------------------------+
|i22 : Js = saturate(J, irrel);         |
|                                       |
|o22 : Ideal of ST                      |
+---------------------------------------+
|i23 : I = eliminate({y_0,y_1,y_2}, Js);|
|                                       |
|o23 : Ideal of ST                      |
+---------------------------------------+
|i24 : IS = (map(S,ST))I;               |
|                                       |
|o24 : Ideal of S                       |
+---------------------------------------+
|i25 : codim I                          |
|                                       |
|o25 = 2                                |
+---------------------------------------+

Finally, we compute the ideal of the generalized Scroll:

+--------------------------------------+
|i26 : g = correspondenceScroll(IS, L);|
|                                      |
|                 ZZ                   |
|o26 : Ideal of -----[y   ..y   ]      |
|               32003  0,0   2,2       |
+--------------------------------------+
|i27 : minimalBetti g                  |
|                                      |
|             0  1   2   3   4  5  6   |
|o27 = total: 1 30 120 196 160 66 11   |
|          0: 1  .   .   .   .  .  .   |
|          1: .  3   .   .   .  .  .   |
|          2: .  9  27  24   7  .  .   |
|          3: . 18  93 172 153 66 11   |
|                                      |
|o27 : BettiTally                      |
+--------------------------------------+

Caveat
======

The script currently uses an elimination method, but could be speeded up by
replacing that with the easy direct description of the equations that come from
the correspondence I.

See also
========

  * irrelevantIdeal -- returns the irrelevant ideal of
    a multi-graded ring
  * productOfProjectiveSpaces -- Constructs
    the multi-graded ring of a product of copies of P^1 (pp is a synonym)
  * smallDiagonal -- Ideal of the small diagonal in
    (P^1)^n

Ways to use correspondenceScroll:
=================================

  * "correspondenceScroll(Ideal,List)"

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

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

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

The source of this document is in K3Carpets.m2:1830:0.

coxMatrices -- compute the Cox matrices
***************************************

  * Usage:
        (A,B,A1,B1) = coxMatrices(a,b,k)
  * Inputs:
      * a, an integer (Macaulay2Doc),
      * b, an integer (Macaulay2Doc),
      * k, an integer (Macaulay2Doc),
  * Outputs:
      * A, a matrix (Macaulay2Doc),
      * B, a matrix (Macaulay2Doc),
      * A1, a matrix (Macaulay2Doc),
      * B1, a matrix (Macaulay2Doc), over the Cox ring

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

We compute the Hankel matrices over the Cox ring, which give rize to the
relative quadrics of a degenerate K3 X_e(a,b) in case of k resonance within the
resonance scroll, see ES2018

+------------------------------------------------+
|i1 : (A,B,A1,B1)=coxMatrices(6,5,4);            |
+------------------------------------------------+
|i2 : A,A1                                       |
|                                                |
|o2 = (| u_0 u_1 su_2 u_3  |, | u_0 su_1 su_2 |) |
|      | u_1 u_2 u_3  tu_0 |  | u_1 su_2 u_3  |  |
|                             | u_2 u_3  tu_0 |  |
|                                                |
|o2 : Sequence                                   |
+------------------------------------------------+
|i3 : B,B1                                       |
|                                                |
|o3 = (| v_0 sv_1 v_2 v_3  |, | sv_0 sv_1 v_2  |)|
|      | v_1 v_2  v_3 tv_0 |  | sv_1 v_2  v_3  | |
|                             | v_2  v_3  tv_0 | |
|                                                |
|o3 : Sequence                                   |
+------------------------------------------------+
|i4 : (A,B,A1,B1)=coxMatrices(7,4,4);            |
+------------------------------------------------+
|i5 : A,A1                                       |
|                                                |
|o5 = (| u_0 u_1 u_2 su_3 |, | u_0 u_1 su_2 |)   |
|      | u_1 u_2 u_3 tu_0 |  | u_1 u_2 su_3 |    |
|                            | u_2 u_3 tu_0 |    |
|                                                |
|o5 : Sequence                                   |
+------------------------------------------------+
|i6 : B,B1                                       |
|                                                |
|o6 = (| sv_0 v_1 v_2 v_3  |, | sv_0 v_1 v_2  |) |
|      | v_1  v_2 v_3 tv_0 |  | v_1  v_2 v_3  |  |
|                             | v_2  v_3 tv_0 |  |
|                                                |
|o6 : Sequence                                   |
+------------------------------------------------+

See also
========

  * relativeEquations -- compute the relative
    quadrics

Ways to use coxMatrices:
========================

  * "coxMatrices(ZZ,ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:2054:0.

degenerateK3 -- Ideal of a degenerate K3 surface X_e(a,b)
*********************************************************

  * Usage:
        I = degenerateK3(a,b,e)
        I = degenerateK3(a,b,t)
  * Inputs:
      * a, an integer (Macaulay2Doc),
      * b, an integer (Macaulay2Doc), a and b should be positive
      * e, a sequence (Macaulay2Doc), of two integers (e_1,e_2)
      * t, a list (Macaulay2Doc), of two integers {t_1,t_2}
  * Optional inputs (Macaulay2Doc),:
      * Characteristic => an integer (Macaulay2Doc), default value
        32003, the characteristic of the ground field
  * Outputs:
      * I, an ideal (Macaulay2Doc),

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

The routine computes the homogeneous ideal of the degenerate K3 surface in
$\mathbb P^{a+b+1}$ associated as in HREF{y}{x} to a polynomial
$$p(z)=z^2-e_1z+e_2=(z-t_1)(z-t_2)$$ In case $p(z)=(z-1)^2$ it coincides with
carpet(a,b).

+-------------------------------------------------+
|i1 : I=degenerateK3(5,5,{1,1});                  |
|                                                 |
|                ZZ                               |
|o1 : Ideal of -----[y   ..y   ]                  |
|              32003  0,0   1,5                   |
+-------------------------------------------------+
|i2 : minimalBetti I                              |
|                                                 |
|            0  1   2   3   4   5   6   7  8 9    |
|o2 = total: 1 36 160 315 288 288 315 160 36 1    |
|         0: 1  .   .   .   .   .   .   .  . .    |
|         1: . 36 160 315 288   .   .   .  . .    |
|         2: .  .   .   .   . 288 315 160 36 .    |
|         3: .  .   .   .   .   .   .   .  . 1    |
|                                                 |
|o2 : BettiTally                                  |
+-------------------------------------------------+
|i3 : I_10                                        |
|                                                 |
|o3 = y   y    - 2y   y    + y   y                |
|      0,2 1,3     0,1 1,4    0,0 1,5             |
|                                                 |
|       ZZ                                        |
|o3 : -----[y   ..y   ]                           |
|     32003  0,0   1,5                            |
+-------------------------------------------------+
|i4 : I=degenerateK3(5,5,(-1,1));                 |
|                                                 |
|                ZZ                               |
|o4 : Ideal of -----[y   ..y   ]                  |
|              32003  0,0   1,5                   |
+-------------------------------------------------+
|i5 : I_10                                        |
|                                                 |
|o5 = y   y    + y   y    + y   y                 |
|      0,2 1,3    0,1 1,4    0,0 1,5              |
|                                                 |
|       ZZ                                        |
|o5 : -----[y   ..y   ]                           |
|     32003  0,0   1,5                            |
+-------------------------------------------------+
|i6 : minimalBetti I                              |
|                                                 |
|            0  1   2   3   4   5   6   7  8 9    |
|o6 = total: 1 36 160 315 293 293 315 160 36 1    |
|         0: 1  .   .   .   .   .   .   .  . .    |
|         1: . 36 160 315 288   5   .   .  . .    |
|         2: .  .   .   .   5 288 315 160 36 .    |
|         3: .  .   .   .   .   .   .   .  . 1    |
|                                                 |
|o6 : BettiTally                                  |
+-------------------------------------------------+
|i7 : I=degenerateK3(5,5,{1,1},Characteristic=>3);|
|                                                 |
|              ZZ                                 |
|o7 : Ideal of --[y   ..y   ]                     |
|               3  0,0   1,5                      |
+-------------------------------------------------+
|i8 : minimalBetti I                              |
|                                                 |
|            0  1   2   3   4   5   6   7  8 9    |
|o8 = total: 1 36 160 315 302 302 315 160 36 1    |
|         0: 1  .   .   .   .   .   .   .  . .    |
|         1: . 36 160 315 288  14   .   .  . .    |
|         2: .  .   .   .  14 288 315 160 36 .    |
|         3: .  .   .   .   .   .   .   .  . 1    |
|                                                 |
|o8 : BettiTally                                  |
+-------------------------------------------------+

Caveat
======

See also
========

  * carpet -- Ideal of the unique Gorenstein double structure on
    a 2-dimensional scroll
  * correspondenceScroll -- Union of planes
    joining points of rational normal curves according to a given
    correspondence

Ways to use degenerateK3:
=========================

  * "degenerateK3(ZZ,ZZ,List)"
  * "degenerateK3(ZZ,ZZ,Sequence)"

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

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

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

The source of this document is in K3Carpets.m2:1102:0.

degenerateK3BettiTables -- compute the Betti tables of a degenerate K3 over all prime fields
********************************************************************************************

  * Usage:
        h = carpetBettiTables(a,b,e)
  * Inputs:
      * a, an integer (Macaulay2Doc), the larger value, i.e a>=b
      * b, an integer (Macaulay2Doc), the desired clifford index
      * e, a sequence (Macaulay2Doc), of two small integers
        e=(e_1,e_2)
  * Outputs:
      * h, a hash table (Macaulay2Doc), Betti tables of the
        degenerate K3 for various characteristics of the ground field

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

We compute the equation and nonminimal resolution F of the degenerate K3 of
type (a,b,e) where $a \ge b$ over a large finite prime field, lift the complex
to the integers, which is possible if the coefficients are small. Finally we
study the nonminimal strands over ZZ by computing the Smith normal form. The
resulting data allow us to compute the Betti tables for arbitrary primes.

+----------------------------------------------------------------------+
|i1 : a=5,b=5                                                          |
|                                                                      |
|o1 = (5, 5)                                                           |
|                                                                      |
|o1 : Sequence                                                         |
+----------------------------------------------------------------------+
|i2 : e=(-1,5)                                                         |
|                                                                      |
|o2 = (-1, 5)                                                          |
|                                                                      |
|o2 : Sequence                                                         |
+----------------------------------------------------------------------+
|i3 : h=degenerateK3BettiTables(a,b,e)                                 |
| -- .00448412s elapsed                                                |
| -- .00830868s elapsed                                                |
| -- .0467858s elapsed                                                 |
| -- .0130765s elapsed                                                 |
| -- .00492602s elapsed                                                |
|                                                                      |
|                           0  1   2   3   4   5   6   7  8 9          |
|o3 = HashTable{0 => total: 1 36 160 315 288 288 315 160 36 1}         |
|                        0: 1  .   .   .   .   .   .   .  . .          |
|                        1: . 36 160 315 288   .   .   .  . .          |
|                        2: .  .   .   .   . 288 315 160 36 .          |
|                        3: .  .   .   .   .   .   .   .  . 1          |
|                           0  1   2   3   4   5   6   7  8 9          |
|               2 => total: 1 36 160 315 318 318 315 160 36 1          |
|                        0: 1  .   .   .   .   .   .   .  . .          |
|                        1: . 36 160 315 288  30   .   .  . .          |
|                        2: .  .   .   .  30 288 315 160 36 .          |
|                        3: .  .   .   .   .   .   .   .  . 1          |
|                           0  1   2   3   4   5   6   7  8 9          |
|               3 => total: 1 36 160 315 298 298 315 160 36 1          |
|                        0: 1  .   .   .   .   .   .   .  . .          |
|                        1: . 36 160 315 288  10   .   .  . .          |
|                        2: .  .   .   .  10 288 315 160 36 .          |
|                        3: .  .   .   .   .   .   .   .  . 1          |
|                           0  1   2   3   4   5   6   7  8 9          |
|               5 => total: 1 36 167 370 476 476 370 167 36 1          |
|                        0: 1  .   .   .   .   .   .   .  . .          |
|                        1: . 36 160 322 336 140  48   7  . .          |
|                        2: .  .   7  48 140 336 322 160 36 .          |
|                        3: .  .   .   .   .   .   .   .  . 1          |
|                                                                      |
|o3 : HashTable                                                        |
+----------------------------------------------------------------------+
|i4 : keys h                                                           |
|                                                                      |
|o4 = {0, 2, 3, 5}                                                     |
|                                                                      |
|o4 : List                                                             |
+----------------------------------------------------------------------+
|i5 : elapsedTime T= minimalBetti degenerateK3(a,b,e,Characteristic=>5)|
| -- .651154s elapsed                                                  |
|                                                                      |
|            0  1   2   3   4   5   6   7  8 9                         |
|o5 = total: 1 36 167 370 476 476 370 167 36 1                         |
|         0: 1  .   .   .   .   .   .   .  . .                         |
|         1: . 36 160 322 336 140  48   7  . .                         |
|         2: .  .   7  48 140 336 322 160 36 .                         |
|         3: .  .   .   .   .   .   .   .  . 1                         |
|                                                                      |
|o5 : BettiTally                                                       |
+----------------------------------------------------------------------+
|i6 : T-h#5                                                            |
|                                                                      |
|            0 1 2 3 4 5 6 7 8 9                                       |
|o6 = total: . . . . . . . . . .                                       |
|         1: . . . . . . . . . .                                       |
|         2: . . . . . . . . . .                                       |
|         3: . . . . . . . . . .                                       |
|                                                                      |
|o6 : BettiTally                                                       |
+----------------------------------------------------------------------+

Already for fairly small values of (e_1,e_2) the result might be incorrect,
because the lift to characteristic zero fails due to high powers of e_1 and e_2
in the non-minimal resolution. It would be easy to alter the program to catch
these mistakes.

+------------------------------------------------------------------+
|i7 : e=(-1,5^2)                                                   |
|                                                                  |
|o7 = (-1, 25)                                                     |
|                                                                  |
|o7 : Sequence                                                     |
+------------------------------------------------------------------+
|i8 : h=degenerateK3BettiTables(a,b,e)                             |
| -- .00332439s elapsed                                            |
| -- .00864572s elapsed                                            |
| -- .0649756s elapsed                                             |
| -- .0133912s elapsed                                             |
| -- .00848565s elapsed                                            |
|                                                                  |
|                           0  1   2   3   4   5   6   7  8 9      |
|o8 = HashTable{0 => total: 1 36 160 315 288 288 315 160 36 1     }|
|                        0: 1  .   .   .   .   .   .   .  . .      |
|                        1: . 36 160 315 288   .   .   .  . .      |
|                        2: .  .   .   .   . 288 315 160 36 .      |
|                        3: .  .   .   .   .   .   .   .  . 1      |
|                           0  1   2   3   4   5   6   7  8 9      |
|               2 => total: 1 36 160 315 314 314 315 160 36 1      |
|                        0: 1  .   .   .   .   .   .   .  . .      |
|                        1: . 36 160 315 288  26   .   .  . .      |
|                        2: .  .   .   .  26 288 315 160 36 .      |
|                        3: .  .   .   .   .   .   .   .  . 1      |
|                           0  1   2   3   4   5   6   7  8 9      |
|               3 => total: 1 36 160 315 300 300 315 160 36 1      |
|                        0: 1  .   .   .   .   .   .   .  . .      |
|                        1: . 36 160 315 288  12   .   .  . .      |
|                        2: .  .   .   .  12 288 315 160 36 .      |
|                        3: .  .   .   .   .   .   .   .  . 1      |
|                           0  1   2   3   4   5   6   7  8 9      |
|               5 => total: 1 36 166 365 466 466 365 166 36 1      |
|                        0: 1  .   .   .   .   .   .   .  . .      |
|                        1: . 36 160 321 332 134  44   6  . .      |
|                        2: .  .   6  44 134 332 321 160 36 .      |
|                        3: .  .   .   .   .   .   .   .  . 1      |
|                             0  1   2   3   4   5   6   7  8 9    |
|               251 => total: 1 36 160 315 289 289 315 160 36 1    |
|                          0: 1  .   .   .   .   .   .   .  . .    |
|                          1: . 36 160 315 288   1   .   .  . .    |
|                          2: .  .   .   .   1 288 315 160 36 .    |
|                          3: .  .   .   .   .   .   .   .  . 1    |
|                             0  1   2   3   4   5   6   7  8 9    |
|               373 => total: 1 36 160 315 289 289 315 160 36 1    |
|                          0: 1  .   .   .   .   .   .   .  . .    |
|                          1: . 36 160 315 288   1   .   .  . .    |
|                          2: .  .   .   .   1 288 315 160 36 .    |
|                          3: .  .   .   .   .   .   .   .  . 1    |
|                              0  1   2   3   4   5   6   7  8 9   |
|               2797 => total: 1 36 160 315 289 289 315 160 36 1   |
|                           0: 1  .   .   .   .   .   .   .  . .   |
|                           1: . 36 160 315 288   1   .   .  . .   |
|                           2: .  .   .   .   1 288 315 160 36 .   |
|                           3: .  .   .   .   .   .   .   .  . 1   |
|                               0  1   2   3   4   5   6   7  8 9  |
|               30497 => total: 1 36 160 315 289 289 315 160 36 1  |
|                            0: 1  .   .   .   .   .   .   .  . .  |
|                            1: . 36 160 315 288   1   .   .  . .  |
|                            2: .  .   .   .   1 288 315 160 36 .  |
|                            3: .  .   .   .   .   .   .   .  . 1  |
|                               0  1   2   3   4   5   6   7  8 9  |
|               31627 => total: 1 36 160 315 289 289 315 160 36 1  |
|                            0: 1  .   .   .   .   .   .   .  . .  |
|                            1: . 36 160 315 288   1   .   .  . .  |
|                            2: .  .   .   .   1 288 315 160 36 .  |
|                            3: .  .   .   .   .   .   .   .  . 1  |
|                               0  1   2   3   4   5   6   7  8 9  |
|               35753 => total: 1 36 160 315 289 289 315 160 36 1  |
|                            0: 1  .   .   .   .   .   .   .  . .  |
|                            1: . 36 160 315 288   1   .   .  . .  |
|                            2: .  .   .   .   1 288 315 160 36 .  |
|                            3: .  .   .   .   .   .   .   .  . 1  |
|                                0  1   2   3   4   5   6   7  8 9 |
|               283741 => total: 1 36 160 315 289 289 315 160 36 1 |
|                             0: 1  .   .   .   .   .   .   .  . . |
|                             1: . 36 160 315 288   1   .   .  . . |
|                             2: .  .   .   .   1 288 315 160 36 . |
|                             3: .  .   .   .   .   .   .   .  . 1 |
|                                                                  |
|o8 : HashTable                                                    |
+------------------------------------------------------------------+
|i9 : keys h                                                       |
|                                                                  |
|o9 = {0, 30497, 2, 3, 5, 373, 35753, 31627, 251, 283741, 2797}    |
|                                                                  |
|o9 : List                                                         |
+------------------------------------------------------------------+

Caveat
======

Already for (e_1,e_2) fairly small, the algorithm might give wrong answers
since the lift to characteristic zero  might be incorrect. A correction is easy
to implement as soon freeResolution(.,Strategy => Nonminimal) allows QQ (or ZZ)
as coefficient ring. Another possibility would be to use the Chinese remainder
for lifting to ZZ.

See also
========

  * carpetBettiTable -- compute the Betti tables of a
    carpet of given genus and Clifford index over a prime field of
    characteristic p

Ways to use degenerateK3BettiTables:
====================================

  * "degenerateK3BettiTables(ZZ,ZZ,Sequence)"

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

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

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

The source of this document is in K3Carpets.m2:1453:0.

FineGrading -- Option for carpet, canonicalCarpet
*************************************************

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

The default is FineGrading => false. If the option FineGrading=>true is given,
then the ideal returned has the natural $\ZZ^4$ grading, where x_i has degree
\{1,0,i,a-i\}\ and y_i has degree \{0,1,i,b-i\}. (Note that after the call
carpet(a1,a2) we have a = min(a1,a2), b = max(a1,a2).)

Functions with optional argument named FineGrading:
===================================================

  * "canonicalCarpet(...,FineGrading=>...)" -- see canonicalCarpet,
    -- Carpet of given genus and Clifford index
  * "canonicalHomotopies(...,FineGrading=>...)" -- see
    canonicalHomotopies, -- Homotopies on the resolution
    of a K3 carpet
  * "carpet(...,FineGrading=>...)" -- see carpet, -- Ideal of the
    unique Gorenstein double structure on a 2-dimensional scroll

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

The object FineGrading, is a symbol (Macaulay2Doc).

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

The source of this document is in K3Carpets.m2:1640:0.

gorensteinDouble -- attempts to produce a Gorenstein double structure J subset I
********************************************************************************

  * Usage:
        gorensteinDouble I
  * Inputs:
      * I, an ideal (Macaulay2Doc),
  * Outputs:
      * J, an ideal (Macaulay2Doc),

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

Let S = ring I, and that I is an ideal of codimension c. Let F be the S-free
resolution of S/I. Assuming that S is a polynomial ring and S/I is
Cohen-Macaulay, the canonical module of S/I is omega = coker transpose F.dd_c.
The script returns the ideal J that is the kernel of the first element of
Hom(I, omega). In case I is the ideal of a scroll there is a unique element of
minimal degree, and it represents a surjection, so S/J is Gorenstein.

Ways to use gorensteinDouble:
=============================

  * "gorensteinDouble(Ideal)"

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

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

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

The source of this document is in K3Carpets.m2:1674:0.

hankelMatrix -- matrix with constant anti-diagonal entries
**********************************************************

  * Usage:
        m = hankelMatrix(r,p,q)
        m = hankelMatrix(R,x,p,q)
        m = hankelMatrix(R,p,q)
        m = hankelMatrix(p,q)
  * Inputs:
      * r, a matrix (Macaulay2Doc), matrix whose first row will
        be the entries of m
      * R, a ring (Macaulay2Doc), in this case, hankelMatrix will
        use the variables of R
      * x, a ring element (Macaulay2Doc), if present,
        hankelMatrix will use the variables of R starting with x
      * p, an integer (Macaulay2Doc), number of rows
      * q, an integer (Macaulay2Doc), number of columns

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

A Hankel matrix (or catalecticant matrix) is a matrix with a repeated element
on each anti-diagonal, that is m_(i,j) depends only on i+j. If the matrix r is
given, then we set m_(i,j) = r_(0,i+j) if i+j<numcols r, and 0 otherwise. The
degrees of the rows of m are set to 0, and the degrees of the columns are set
to the degree of r_(0,0); thus the Hankel matrix is homogeneous iff all the
entries of the first row of r have the same degree.

If no ring or matrix is given, hankelMatrix defines a new ring S with p+q-1
variables X_i, and then calls hankelMatrix(vars S, p,q).

+-------------------------------------------------+
|i1 : p = 2;q=3;                                  |
+-------------------------------------------------+
|i3 : S = ZZ/101[x_0..x_(p+q-2)]                  |
|                                                 |
|o3 = S                                           |
|                                                 |
|o3 : PolynomialRing                              |
+-------------------------------------------------+
|i4 : hankelMatrix(vars S, p,q)                   |
|                                                 |
|o4 = | x_0 x_1 x_2 |                             |
|     | x_1 x_2 x_3 |                             |
|                                                 |
|             2      3                            |
|o4 : Matrix S  <-- S                             |
+-------------------------------------------------+
|i5 : r = vars S ** transpose vars S              |
|                                                 |
|o5 = {-1} | x_0^2  x_0x_1 x_0x_2 x_0x_3 |        |
|     {-1} | x_0x_1 x_1^2  x_1x_2 x_1x_3 |        |
|     {-1} | x_0x_2 x_1x_2 x_2^2  x_2x_3 |        |
|     {-1} | x_0x_3 x_1x_3 x_2x_3 x_3^2  |        |
|                                                 |
|             4      4                            |
|o5 : Matrix S  <-- S                             |
+-------------------------------------------------+
|i6 : hankelMatrix(r, p,q)                        |
|                                                 |
|o6 = | x_0^2  x_0x_1 x_0x_2 |                    |
|     | x_0x_1 x_0x_2 x_0x_3 |                    |
|                                                 |
|             2      3                            |
|o6 : Matrix S  <-- S                             |
+-------------------------------------------------+
|i7 : hankelMatrix(S,p,q)                         |
|                                                 |
|o7 = | x_0 x_1 x_2 |                             |
|     | x_1 x_2 x_3 |                             |
|                                                 |
|             2      3                            |
|o7 : Matrix S  <-- S                             |
+-------------------------------------------------+
|i8 : hankelMatrix(r, p,q+2)                      |
|                                                 |
|o8 = | x_0^2  x_0x_1 x_0x_2 x_0x_3 0 |           |
|     | x_0x_1 x_0x_2 x_0x_3 0      0 |           |
|                                                 |
|             2      5                            |
|o8 : Matrix S  <-- S                             |
+-------------------------------------------------+
|i9 : hankelMatrix(p,q+2)                         |
|                                                 |
|o9 = | X_0 X_1 X_2 X_3 X_4 |                     |
|     | X_1 X_2 X_3 X_4 X_5 |                     |
|                                                 |
|               ZZ          2        ZZ          5|
|o9 : Matrix (-----[X ..X ])  <-- (-----[X ..X ]) |
|             32003  0   5         32003  0   5   |
+-------------------------------------------------+

Ways to use hankelMatrix:
=========================

  * "hankelMatrix(Matrix,ZZ,ZZ)"
  * "hankelMatrix(Ring,RingElement,ZZ,ZZ)"
  * "hankelMatrix(Ring,ZZ,ZZ)"
  * "hankelMatrix(ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1929:0.

homotopyRanks -- compute the ranks of the quadratic homotopies on a carpet
**************************************************************************

  * Usage:
        L = homotopyRanks(g,cliff)
  * Inputs:
      * g, an integer (Macaulay2Doc), genus of the carpet
      * cliff, an integer (Macaulay2Doc), Clifford index of the
        carpet
  * Optional inputs (Macaulay2Doc),:
      * Characteristic => an integer (Macaulay2Doc), default value
        32003, the characteristic of the ground field
  * Outputs:
      * L, a net (Macaulay2Doc), netList showing the ranks

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

Prints the Betti table of the canonical carpet and a list of pairs, with first
element a quadric and second element the sequence of ranks of the homotopies
for that quadric on F_i, for i = 1..g-2.

+------------------------------------------------+
|i1 : homotopyRanks(7,3)                         |
|       0  1  2  3  4 5                          |
|total: 1 10 16 16 10 1                          |
|    0: 1  .  .  .  . .                          |
|    1: . 10 16  .  . .                          |
|    2: .  .  . 16 10 .                          |
|    3: .  .  .  .  . 1                          |
|                                                |
|     +-------------------------+---------------+|
|o1 = || x_1^2-x_0x_2 |         |{1, 0, 8, 0, 1}||
|     +-------------------------+---------------+|
|     || x_1x_2-x_0x_3 |        |{1, 0, 8, 0, 1}||
|     +-------------------------+---------------+|
|     || x_2^2-x_1x_3 |         |{1, 0, 8, 0, 1}||
|     +-------------------------+---------------+|
|     || x_2y_0-2x_1y_1+x_0y_2 ||{1, 0, 8, 0, 1}||
|     +-------------------------+---------------+|
|     || x_3y_0-2x_2y_1+x_1y_2 ||{1, 0, 8, 0, 1}||
|     +-------------------------+---------------+|
|     || x_2y_1-2x_1y_2+x_0y_3 ||{1, 0, 8, 0, 1}||
|     +-------------------------+---------------+|
|     || x_3y_1-2x_2y_2+x_1y_3 ||{1, 0, 8, 0, 1}||
|     +-------------------------+---------------+|
|     || y_1^2-y_0y_2 |         |{1, 0, 8, 0, 1}||
|     +-------------------------+---------------+|
|     || y_1y_2-y_0y_3 |        |{1, 0, 8, 0, 1}||
|     +-------------------------+---------------+|
|     || y_2^2-y_1y_3 |         |{1, 0, 8, 0, 1}||
|     +-------------------------+---------------+|
+------------------------------------------------+
|i2 : homotopyRanks(7,3, Characteristic => 2)    |
|       0  1  2  3  4 5                          |
|total: 1 10 19 19 10 1                          |
|    0: 1  .  .  .  . .                          |
|    1: . 10 16  3  . .                          |
|    2: .  .  3 16 10 .                          |
|    3: .  .  .  .  . 1                          |
|                                                |
|     +-----------------+---------------+        |
|o2 = || x_1^2+x_0x_2 | |{1, 0, 0, 2, 1}|        |
|     +-----------------+---------------+        |
|     || x_1x_2+x_0x_3 ||{1, 0, 0, 0, 1}|        |
|     +-----------------+---------------+        |
|     || x_2^2+x_1x_3 | |{1, 0, 0, 2, 1}|        |
|     +-----------------+---------------+        |
|     || x_2y_0+x_0y_2 ||{1, 0, 0, 0, 1}|        |
|     +-----------------+---------------+        |
|     || x_3y_0+x_1y_2 ||{1, 0, 0, 0, 1}|        |
|     +-----------------+---------------+        |
|     || x_2y_1+x_0y_3 ||{1, 0, 0, 0, 1}|        |
|     +-----------------+---------------+        |
|     || x_3y_1+x_1y_3 ||{1, 0, 0, 0, 1}|        |
|     +-----------------+---------------+        |
|     || y_1^2+y_0y_2 | |{1, 0, 0, 2, 1}|        |
|     +-----------------+---------------+        |
|     || y_1y_2+y_0y_3 ||{1, 0, 0, 0, 1}|        |
|     +-----------------+---------------+        |
|     || y_2^2+y_1y_3 | |{1, 0, 0, 2, 1}|        |
|     +-----------------+---------------+        |
+------------------------------------------------+

Ways to use homotopyRanks:
==========================

  * "homotopyRanks(ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1626:0.

irrelevantIdeal -- returns the irrelevant ideal of a multi-graded ring
**********************************************************************

  * Usage:
        mm = irrelevantIdeal R
  * Inputs:
      * R, a ring (Macaulay2Doc), (multi)-graded ring
  * Outputs:
      * mm, an ideal (Macaulay2Doc), irrelevant ideal of R

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

Returns the intersection of the ideals of variables in each single
multi-degree.

+-----------------------------------------------------------------------------+
|i1 : R = productOfProjectiveSpaces 3                                         |
|                                                                             |
|o1 = R                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : vars R                                                                  |
|                                                                             |
|o2 = | x_(0,0) x_(1,0) x_(0,1) x_(1,1) x_(0,2) x_(1,2) |                     |
|                                                                             |
|             1      6                                                        |
|o2 : Matrix R  <-- R                                                         |
+-----------------------------------------------------------------------------+
|i3 : (gens R)/degree                                                         |
|                                                                             |
|o3 = {{1, 0, 0}, {1, 0, 0}, {0, 1, 0}, {0, 1, 0}, {0, 0, 1}, {0, 0, 1}}      |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : irrelevantIdeal R                                                       |
|                                                                             |
|o4 = ideal (x   x   x   , x   x   x   , x   x   x   , x   x   x   ,          |
|             1,0 1,1 1,2   0,0 1,1 1,2   1,0 0,1 1,2   0,0 0,1 1,2           |
|     ------------------------------------------------------------------------|
|     x   x   x   , x   x   x   , x   x   x   , x   x   x   )                 |
|      1,0 1,1 0,2   0,0 1,1 0,2   1,0 0,1 0,2   0,0 0,1 0,2                  |
|                                                                             |
|o4 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * productOfProjectiveSpaces -- Constructs
    the multi-graded ring of a product of copies of P^1 (pp is a synonym)

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

The object irrelevantIdeal, is a function closure (Macaulay2Doc).

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

The source of this document is in K3Carpets.m2:1882:0.

productOfProjectiveSpaces -- Constructs the multi-graded ring of a product of copies of P^1 (pp is a synonym)
*************************************************************************************************************

  * Usage:
        R = productOfProjectiveSpaces(L,y,kkk)
        R = productOfProjectiveSpaces(L,y)
        R = productOfProjectiveSpaces L
        R = productOfProjectiveSpaces (n, y)
        R = productOfProjectiveSpaces n
  * Inputs:
      * L, a list (Macaulay2Doc), of positive integers, the
        dimensions of the projective spaces
      * n, an integer (Macaulay2Doc), positive integer, number of P^1
        factors
      * y, a symbol (Macaulay2Doc),
      * kkk, a ring (Macaulay2Doc), ground field to use in the
        construction variable name for R (defaults to "x" if none given)
  * Optional inputs (Macaulay2Doc),:
      * Characteristic => an integer (Macaulay2Doc), default value
        32003, the characteristic of the ground field
  * Outputs:
      * R, a ring (Macaulay2Doc), ZZ^n - graded

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

The variables are in 1+L_i -tuples, x_(0,i).. x_(L_i,i) with degree
{0..0,1,0..0}, the 1 being in the i-th place.

+-----------------------------------------------------+
|i1 : R = productOfProjectiveSpaces{1,3}              |
|                                                     |
|o1 = R                                               |
|                                                     |
|o1 : PolynomialRing                                  |
+-----------------------------------------------------+
|i2 : v = gens R                                      |
|                                                     |
|o2 = {x   , x   , x   , x   , x   , x   }            |
|       0,0   1,0   0,1   1,1   2,1   3,1             |
|                                                     |
|o2 : List                                            |
+-----------------------------------------------------+
|i3 : v/degree                                        |
|                                                     |
|o3 = {{1, 0}, {1, 0}, {0, 1}, {0, 1}, {0, 1}, {0, 1}}|
|                                                     |
|o3 : List                                            |
+-----------------------------------------------------+
|i4 : gens productOfProjectiveSpaces({1,1},symbol y)  |
|                                                     |
|o4 = {y   , y   , y   , y   }                        |
|       0,0   1,0   0,1   1,1                         |
|                                                     |
|o4 : List                                            |
+-----------------------------------------------------+
|i5 : gens productOfProjectiveSpaces 2                |
|                                                     |
|o5 = {x   , x   , x   , x   }                        |
|       0,0   1,0   0,1   1,1                         |
|                                                     |
|o5 : List                                            |
+-----------------------------------------------------+

Ways to use productOfProjectiveSpaces:
======================================

  * "productOfProjectiveSpaces(List)"
  * "productOfProjectiveSpaces(List,Symbol)"
  * "productOfProjectiveSpaces(List,Symbol,Ring)"
  * "productOfProjectiveSpaces(ZZ)"
  * "productOfProjectiveSpaces(ZZ,Symbol)"

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

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

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

The source of this document is in K3Carpets.m2:1717:0.

relativeEquations -- compute the relative quadrics
**************************************************

  * Usage:
        I = relativeEquations(a,b,k)
  * Inputs:
      * a, an integer (Macaulay2Doc),
      * b, an integer (Macaulay2Doc),
      * k, an integer (Macaulay2Doc),
  * Outputs:
      * I, an ideal (Macaulay2Doc), multi-graded ideal in the Cox
        ring

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

We compute the relative equations of a resonance degenerate K3 in case of k
resonance. The first step consists in chooses a prime field which has a k-th
root of unity. We then follow section 4 of the paper equations and syzygies of
K3 carpets and unions of scrolls.

+-----------------------------------------------------------------------------+
|i1 : I = relativeEquations(4,4,3)                                            |
|                                                                             |
|               2            2                                                |
|o1 = ideal (s*v  - v v , t*v  - v v , u v  - 14s*u v  + 13u v , t*u v  -     |
|               1    0 2     0    1 2   2 0        1 1      0 2     0 0       |
|     ------------------------------------------------------------------------|
|                         2            2                     2                |
|     14u v  + 13u v , s*u  - u u , t*u  - u u , s*t*v v  - v , s*t*u v  -    |
|        2 1      1 2     1    0 2     0    1 2       0 1    2       1 0      |
|     ------------------------------------------------------------------------|
|                                      2                                      |
|     14s*t*u v  + 13u v , s*t*u u  - u )                                     |
|            0 1      2 2       0 1    2                                      |
|                                                                             |
|              ZZ                                                             |
|o1 : Ideal of --[s, t, u ..u , v ..v ]                                       |
|              61        0   2   0   2                                        |
+-----------------------------------------------------------------------------+
|i2 : betti I                                                                 |
|                                                                             |
|            0 1                                                              |
|o2 = total: 1 9                                                              |
|         0: 1 .                                                              |
|         1: . .                                                              |
|         2: . 6                                                              |
|         3: . 3                                                              |
|                                                                             |
|o2 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * coxMatrices -- compute the Cox matrices
  * resonanceScroll -- compute the splitting type of
    the resonance scroll
  * relativeResolution -- compute the relative
    resolution

Ways to use relativeEquations:
==============================

  * "relativeEquations(ZZ,ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1991:0.

relativeResolution -- compute the relative resolution
*****************************************************

  * Usage:
        F = relativeResolution(a,b,k)
  * Inputs:
      * a, an integer (Macaulay2Doc),
      * b, an integer (Macaulay2Doc),
      * k, an integer (Macaulay2Doc),
  * Outputs:
      * F, a complex (Complexes), multi-graded chainComplex in
        the Cox ring

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

We compute the relative resolution of a resonance degenerate K3 in case of k
resonance. The first step consists in chooses a prime field which has a k-th
root of unity. We then follow section 4 of the paper equations and syzygies of
K3 carpets and unions of scrolls.

+-----------------------------------------------------------------------------+
|i1 : F = relativeResolution(5,4,3)                                           |
|                                                                             |
|      ZZ                       1      ZZ                       9      ZZ     |
|o1 = (--[s, t, u ..u , v ..v ])  <-- (--[s, t, u ..u , v ..v ])  <-- (--[s,  |
|      61        0   2   0   2         61        0   2   0   2         61     |
|                                                                             |
|     0                               1                               2       |
|                                                                             |
|o1 : Complex                                                                 |
|-----------------------------------------------------------------------------|
|                   16      ZZ                       9      ZZ                |
|t, u ..u , v ..v ])   <-- (--[s, t, u ..u , v ..v ])  <-- (--[s, t, u ..u ,  |
|    0   2   0   2          61        0   2   0   2         61        0   2   |
|                                                                             |
|                          3                               4                  |
|-----------------------------------------------------------------------------|
|        1                                                                    |
|v ..v ])                                                                     |
| 0   2                                                                       |
+-----------------------------------------------------------------------------+
|i2 : betti F                                                                 |
|                                                                             |
|            0 1  2 3 4                                                       |
|o2 = total: 1 9 16 9 1                                                       |
|         0: 1 .  . . .                                                       |
|         1: . 1  . . .                                                       |
|         2: . 7  8 1 .                                                       |
|         3: . 1  8 7 .                                                       |
|         4: . .  . 1 .                                                       |
|         5: . .  . . 1                                                       |
|                                                                             |
|o2 : BettiTally                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * relativeResolutionTwists -- compute the
    twists in the relative resolution
  * relativeEquations -- compute the relative
    quadrics
  * coxMatrices -- compute the Cox matrices

Ways to use relativeResolution:
===============================

  * "relativeResolution(ZZ,ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:2020:0.

relativeResolutionTwists -- compute the twists in the relative resolution
*************************************************************************

  * Usage:
        L = relativeResolutionTwists(am,bm,F)
  * Inputs:
      * am, an integer (Macaulay2Doc),
      * bm, an integer (Macaulay2Doc),
      * F, a complex (Complexes),
  * Outputs:
      * L, a list (Macaulay2Doc), of Lists of multidegrees

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

We compute the twists of the relative resolution in the resonance scroll of a
degenerate K3 X_e(a,b) in case of k resonance after re-embedding the resonance
scroll with |H+jR| for j=am-a_0=bm-b_0 where $\{a_i\}|\{b_j\}$ is the splitting
type of the resonance scroll.

+---------------------------------------------------+
|i1 : F = relativeResolution(5,4,3);                |
+---------------------------------------------------+
|i2 : (as,bs)=resonanceScroll(5,4,3)                |
|                                                   |
|o2 = ({1, 1, 1}, {1, 1, 0})                        |
|                                                   |
|o2 : Sequence                                      |
+---------------------------------------------------+
|i3 : betti F                                       |
|                                                   |
|            0 1  2 3 4                             |
|o3 = total: 1 9 16 9 1                             |
|         0: 1 .  . . .                             |
|         1: . 1  . . .                             |
|         2: . 7  8 1 .                             |
|         3: . 1  8 7 .                             |
|         4: . .  . 1 .                             |
|         5: . .  . . 1                             |
|                                                   |
|o3 : BettiTally                                    |
+---------------------------------------------------+
|i4 : L = relativeResolutionTwists(as_0,bs_0,F);    |
+---------------------------------------------------+
|i5 : netList apply(L,c-> tally c)                  |
|                                                   |
|     +-------------------+                         |
|o5 = |Tally{{0, 0} => 1} |                         |
|     +-------------------+                         |
|     |Tally{{2, -1} => 7}|                         |
|     |      {2, -2} => 1 |                         |
|     |      {2, 0} => 1  |                         |
|     +-------------------+                         |
|     |Tally{{3, -1} => 8}|                         |
|     |      {3, -2} => 8 |                         |
|     +-------------------+                         |
|     |Tally{{4, -1} => 1}|                         |
|     |      {4, -2} => 7 |                         |
|     |      {4, -3} => 1 |                         |
|     +-------------------+                         |
|     |Tally{{6, -3} => 1}|                         |
|     +-------------------+                         |
+---------------------------------------------------+
|i6 : L = relativeResolutionTwists(as_0+2,bs_0+1,F);|
+---------------------------------------------------+
|i7 : netList apply(L,c-> tally c)                  |
|                                                   |
|     +--------------------+                        |
|o7 = |Tally{{0, 0} => 1}  |                        |
|     +--------------------+                        |
|     |Tally{{2, -2} => 1} |                        |
|     |      {2, -3} => 2  |                        |
|     |      {2, -4} => 3  |                        |
|     |      {2, -5} => 2  |                        |
|     |      {2, -6} => 1  |                        |
|     +--------------------+                        |
|     |Tally{{3, -4} => 2} |                        |
|     |      {3, -5} => 4  |                        |
|     |      {3, -6} => 4  |                        |
|     |      {3, -7} => 4  |                        |
|     |      {3, -8} => 2  |                        |
|     +--------------------+                        |
|     |Tally{{4, -6} => 1 }|                        |
|     |      {4, -7} => 2  |                        |
|     |      {4, -8} => 3  |                        |
|     |      {4, -9} => 2  |                        |
|     |      {4, -10} => 1 |                        |
|     +--------------------+                        |
|     |Tally{{6, -12} => 1}|                        |
|     +--------------------+                        |
+---------------------------------------------------+

See also
========

  * relativeResolution -- compute the relative
    resolution
  * resonanceScroll -- compute the splitting type of
    the resonance scroll

Ways to use relativeResolutionTwists:
=====================================

  * "relativeResolutionTwists(ZZ,ZZ,Complex)"

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

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

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

The source of this document is in K3Carpets.m2:2087:0.

resonanceDet -- compute the resonance determinant of the crucial constant strand of a degenerate K3 X_e(a,a)
************************************************************************************************************

  * Usage:
        (d1,d2) = resonanceDet(a)
  * Inputs:
      * a, an integer (Macaulay2Doc),
  * Outputs:
      * d1, a product expression (Macaulay2Doc), the integer
        factor
      * d2, a product expression (Macaulay2Doc), the resonance
        factor in ZZ[e_1,e_2]

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

We compute the minimal resolution F of degenerate K3 X_e(a,a) over ZZ[e_1,e_2]
where deg e_i =i and the variables x_0,..x_a,y_0..y_b have degrees deg x_i=i+1
and deg y_i=1. The equations of X_e(a,b) are homogeneous with respect to this
grading. Viewed as a resolution over QQ(e_1,e_2), this resolution is
non-minimal and carries further gradings. We decompose the crucial map of the
a-th strand into blocks, compute their determinants, and factor the product.

+-------------------------------------+
|i1 : a=4                             |
|                                     |
|o1 = 4                               |
+-------------------------------------+
|i2 : (d1,d2)=resonanceDet(a)         |
| -- .0464829s elapsed                |
| -- .000041117s elapsed              |
| -- .00013346s elapsed               |
| -- .000089097s elapsed              |
| -- .000091862s elapsed              |
| -- .000121508s elapsed              |
| -- .000116489s elapsed              |
| -- .000029034s elapsed              |
| -- .000084479s elapsed              |
| -- .000098345s elapsed              |
| -- .000115908s elapsed              |
| -- .000132098s elapsed              |
| -- .0001008s elapsed                |
| -- .000087484s elapsed              |
| -- .000107692s elapsed              |
| -- .000141716s elapsed              |
| -- .00003707s elapsed               |
| -- .000086262s elapsed              |
| -- .000028954s elapsed              |
|(number of blocks= , 18)             |
|(size of the matrices, Tally{1 => 4})|
|                             2 => 6  |
|                             3 => 2  |
|                             4 => 6  |
|       0 1                           |
|total: 1 1                           |
|    7: 1 1                           |
|(e )(-1)                             |
|  1                                  |
|       0 1                           |
|total: 2 2                           |
|    7: 2 .                           |
|    8: . 2                           |
|    2                                |
|(e ) (e )(-1)                        |
|  1    2                             |
|       0 1                           |
|total: 2 2                           |
|    7: 2 .                           |
|    8: . .                           |
|    9: . 2                           |
|    2    2                           |
|(e ) (e )                            |
|  1    2                             |
|       0 1                           |
|total: 3 3                           |
|    7: 2 .                           |
|    8: 1 .                           |
|    9: . 1                           |
|   10: . 2                           |
|    2    4                           |
|(e ) (e ) (-3)                       |
|  1    2                             |
|       0 1                           |
|total: 4 4                           |
|    7: 1 .                           |
|    8: 1 .                           |
|    9: 2 2                           |
|   10: . 1                           |
|   11: . 1                           |
|    2    4                           |
|(e ) (e ) (3)                        |
|  1    2                             |
|       0 1                           |
|total: 4 4                           |
|    8: 1 .                           |
|    9: 2 1                           |
|   10: 1 2                           |
|   11: . 1                           |
|    2    3                           |
|(e ) (e ) (3)                        |
|  1    2                             |
|       0 1                           |
|total: 1 1                           |
|    9: 1 1                           |
|(e )(-1)                             |
|  1                                  |
|       0 1                           |
|total: 2 2                           |
|    9: 1 1                           |
|   10: 1 1                           |
|    2                                |
|(e )                                 |
|  1                                  |
|       0 1                           |
|total: 4 4                           |
|    9: 2 1                           |
|   10: 1 1                           |
|   11: 1 2                           |
|    2    2                           |
|(e ) (e ) (-1)                       |
|  1    2                             |
|       0 1                           |
|total: 4 4                           |
|    9: 1 .                           |
|   10: 2 1                           |
|   11: 1 2                           |
|   12: . 1                           |
|    2    3                           |
|(e ) (e ) (3)                        |
|  1    2                             |
|       0 1                           |
|total: 4 4                           |
|    9: 1 .                           |
|   10: 1 .                           |
|   11: 2 2                           |
|   12: . 1                           |
|   13: . 1                           |
|    2    4                           |
|(e ) (e ) (3)                        |
|  1    2                             |
|       0 1                           |
|total: 4 4                           |
|    9: 2 1                           |
|   10: 1 1                           |
|   11: 1 2                           |
|    2    2                           |
|(e ) (e ) (-1)                       |
|  1    2                             |
|       0 1                           |
|total: 3 3                           |
|   10: 2 .                           |
|   11: 1 .                           |
|   12: . 1                           |
|   13: . 2                           |
|    2    4                           |
|(e ) (e ) (3)                        |
|  1    2                             |
|       0 1                           |
|total: 2 2                           |
|   10: 1 1                           |
|   11: 1 1                           |
|    2                                |
|(e )                                 |
|  1                                  |
|       0 1                           |
|total: 2 2                           |
|   11: 2 .                           |
|   12: . .                           |
|   13: . 2                           |
|    2    2                           |
|(e ) (e )                            |
|  1    2                             |
|       0 1                           |
|total: 1 1                           |
|   11: 1 1                           |
|(e )                                 |
|  1                                  |
|       0 1                           |
|total: 2 2                           |
|   12: 2 .                           |
|   13: . 2                           |
|    2                                |
|(e ) (e )(-1)                        |
|  1    2                             |
|       0 1                           |
|total: 1 1                           |
|   13: 1 1                           |
|(e )                                 |
|  1                                  |
|                                     |
|       6      32    32               |
|o2 = (3 , (e )  (e )  )              |
|            1     2                  |
|                                     |
|o2 : Sequence                        |
+-------------------------------------+

See also
========

  * carpetDet -- compute the determinant of the crucial
    constant strand of a carpet X(a,b)

Ways to use resonanceDet:
=========================

  * "resonanceDet(ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1364:0.

resonanceScroll -- compute the splitting type of the resonance scroll
*********************************************************************

  * Usage:
        (as,bs) = resonanceScroll(a,b,k)
  * Inputs:
      * a, an integer (Macaulay2Doc),
      * b, an integer (Macaulay2Doc), type of the degenerate K3
      * k, an integer (Macaulay2Doc), the resonance
  * Outputs:
      * as, a list (Macaulay2Doc),
      * bs, a list (Macaulay2Doc), the splitting type of the
        resonance scroll

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

We compute the splitting type of the resonance scroll of a degenerate K3
X_e(a,b) in case of k resonance.

+-----------------------------------+
|i1 : (as,bs)=resonanceScroll(6,4,3)|
|                                   |
|o1 = ({2, 1, 1}, {1, 1, 0})        |
|                                   |
|o1 : Sequence                      |
+-----------------------------------+

See also
========

  * relativeEquations -- compute the relative
    quadrics

Ways to use resonanceScroll:
============================

  * "resonanceScroll(ZZ,ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:2114:0.

schemeInProduct -- multi-graded Ideal of the image of a map to a product of projective spaces
*********************************************************************************************

  * Usage:
        J = schemeInProduct(I,maps,PP)
        J = schemeInProduct(I,maps,X)
  * Inputs:
      * I, an ideal (Macaulay2Doc), defining the source scheme
      * maps, a list (Macaulay2Doc), list of sequences of
        polynomials each of a single degree, in I
      * PP, a ring (Macaulay2Doc), multigraded ring of the product
        of projective spaces
      * X, a symbol (Macaulay2Doc), name of variable to use in
        constructing a ring PP if none is given
  * Outputs:
      * J, an ideal (Macaulay2Doc), multi-graded ideal of the
        image

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

+-----------------------------------------------------------------------------+
|i1 : S = ZZ/101[a,b]                                                         |
|                                                                             |
|o1 = S                                                                       |
|                                                                             |
|o1 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i2 : I = ideal 0_S                                                           |
|                                                                             |
|o2 = ideal 0                                                                 |
|                                                                             |
|o2 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i3 : f0 = matrix"a,b"                                                        |
|                                                                             |
|o3 = | a b |                                                                 |
|                                                                             |
|             1      2                                                        |
|o3 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i4 : f1 = matrix"a,b"                                                        |
|                                                                             |
|o4 = | a b |                                                                 |
|                                                                             |
|             1      2                                                        |
|o4 : Matrix S  <-- S                                                         |
+-----------------------------------------------------------------------------+
|i5 : maps = {f0,f1}                                                          |
|                                                                             |
|o5 = {| a b |, | a b |}                                                      |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : schemeInProduct(I, maps, Y)                                             |
|warning: clearing value of symbol X to allow access to subscripted           |
|       : debug with expression   debug 1308   or with command line           |
|                                                                             |
|o6 = ideal(X   X    - X   X   )                                              |
|            1,0 0,1    0,0 1,1                                               |
|                                                                             |
|               ZZ                                                            |
|o6 : Ideal of ---[X   , X   , X   , X   , a..b]                              |
|              101  0,0   1,0   0,1   1,1                                     |
|-----------------------------------------------------------------------------|
|variables based on it                                                        |
|option   --debug 1308                                                        |
+-----------------------------------------------------------------------------+

See also
========

  * productOfProjectiveSpaces -- Constructs
    the multi-graded ring of a product of copies of P^1 (pp is a synonym)

Ways to use schemeInProduct:
============================

  * "schemeInProduct(Ideal,List,Ring)"
  * "schemeInProduct(Ideal,List,Symbol)"

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

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

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

The source of this document is in K3Carpets.m2:1962:0.

schreyerName -- get the names of generators in the (nonminimal) Schreyer resolution according to Schreyer's convention
**********************************************************************************************************************

  * Usage:
        L = schreyerName(F,i,n)
        h = schreyerName(F,a)
        L = schreyerName(h,i,n)
  * Inputs:
      * F, a complex (Complexes), the nonminimal resolution from
        a Groebner basis
      * i, an integer (Macaulay2Doc), the homological degree
      * n, an integer (Macaulay2Doc), the number of the generator
      * a, an integer (Macaulay2Doc), homological degree
      * h, a hash table (Macaulay2Doc), of lists of names
  * Outputs:
      * L, a list (Macaulay2Doc), list of monomials
      * h, a hash table (Macaulay2Doc), of names

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

We name the generators of the syzygies by the list of the monomial parts of the
leadTerm with position m recursively:

schreyerName(F,i,n) = append(schreyerName(F,i-1,m),mon)

where mon denotes the monomial part and m the position in F_(i-1) of leadTerm
F.dd_i_n.

+-----------------------------------------------------------------------------+
|i1 : (a,b)=(5,4)                                                             |
|                                                                             |
|o1 = (5, 4)                                                                  |
|                                                                             |
|o1 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i2 : I = carpet(a,b);                                                        |
|                                                                             |
|                ZZ                                                           |
|o2 : Ideal of -----[x ..x , y ..y ]                                          |
|              32003  0   5   0   4                                           |
+-----------------------------------------------------------------------------+
|i3 : F = freeResolution(I, Strategy => Nonminimal)                           |
|                                                                             |
|        ZZ                  1        ZZ                  28                  |
|o3 = (-----[x ..x , y ..y ])  <-- (-----[x ..x , y ..y ])   <--              |
|      32003  0   5   0   4         32003  0   5   0   4                      |
|                                                                             |
|     0                            1                                          |
|                                                                             |
|o3 : Complex                                                                 |
|-----------------------------------------------------------------------------|
|   ZZ                  127        ZZ                  286        ZZ          |
|(-----[x ..x , y ..y ])    <-- (-----[x ..x , y ..y ])    <-- (-----[x ..x , |
| 32003  0   5   0   4           32003  0   5   0   4           32003  0   5  |
|                                                                             |
|2                              3                              4              |
|-----------------------------------------------------------------------------|
|        385        ZZ                  323        ZZ                  166    |
|y ..y ])    <-- (-----[x ..x , y ..y ])    <-- (-----[x ..x , y ..y ])    <--|
| 0   4           32003  0   5   0   4           32003  0   5   0   4         |
|                                                                             |
|                5                              6                             |
|-----------------------------------------------------------------------------|
|   ZZ                  48        ZZ                  6                       |
|(-----[x ..x , y ..y ])   <-- (-----[x ..x , y ..y ])                        |
| 32003  0   5   0   4          32003  0   5   0   4                          |
|                                                                             |
|7                             8                                              |
+-----------------------------------------------------------------------------+
|i4 : betti F                                                                 |
|                                                                             |
|            0  1   2   3   4   5   6  7 8                                    |
|o4 = total: 1 28 127 286 385 323 166 48 6                                    |
|         0: 1  .   .   .   .   .   .  . .                                    |
|         1: . 28 105 184 185 110  36  5 .                                    |
|         2: .  .  22 101 195 203 120 38 5                                    |
|         3: .  .   .   1   5  10  10  5 1                                    |
|                                                                             |
|o4 : BettiTally                                                              |
+-----------------------------------------------------------------------------+
|i5 : i=3,n=10                                                                |
|                                                                             |
|o5 = (3, 10)                                                                 |
|                                                                             |
|o5 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i6 : schreyerName(F,3,10)                                                    |
|                                                                             |
|o6 = {x x , x , x }                                                          |
|       3 4   3   1                                                           |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : h=schreyerName F;                                                       |
+-----------------------------------------------------------------------------+
|i8 : h#8                                                                     |
|                                                                             |
|              2                                   2                          |
|o8 = {{y y , x , y , y , x , x , x , x }, {y y , x , y , y , x , x , x , x },|
|        1 3   1   2   1   5   4   3   2     2 3   1   2   1   5   4   3   2  |
|     ------------------------------------------------------------------------|
|       2                                   2                                 |
|     {y , x y , y , y , x , x , x , x }, {y , x y , y , y , x , x , x , x }, |
|       3   2 0   2   1   4   3   2   1     3   3 0   2   1   4   3   2   1   |
|     ------------------------------------------------------------------------|
|       2                                   2         2                       |
|     {y , x y , y , y , x , x , x , x }, {y , x y , x , y , y , x , x , x }} |
|       3   4 0   2   1   4   3   2   1     3   5 0   1   2   1   4   3   2   |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : h#7_20                                                                  |
|                                                                             |
|       2                                                                     |
|o9 = {y , x x , y , y , x , x , x }                                          |
|       3   1 4   2   1   3   2   1                                           |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+
|i10 : h#7_20 == schreyerName(F,7,20)                                         |
|                                                                             |
|o10 = true                                                                   |
+-----------------------------------------------------------------------------+

Ways to use schreyerName:
=========================

  * "schreyerName(Complex)"
  * "schreyerName(Complex,ZZ)"
  * "schreyerName(Complex,ZZ,ZZ)"
  * "schreyerName(HashTable,ZZ,ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1550:0.

Scrolls -- Option for carpet, canonicalCarpet
*********************************************

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

The default is Scrolls => false. If the option Scrolls=>true is given, then a
triple is returned, with the ideal first followed by xmat and ymat, the smaller
and larger of the scrolls containing the carpet.

Functions with optional argument named Scrolls:
===============================================

  * "canonicalCarpet(...,Scrolls=>...)" -- see canonicalCarpet,
    -- Carpet of given genus and Clifford index
  * "carpet(...,Scrolls=>...)" -- see carpet, -- Ideal of the
    unique Gorenstein double structure on a 2-dimensional scroll

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

The object Scrolls, is a symbol (Macaulay2Doc).

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

The source of this document is in K3Carpets.m2:1651:0.

smallDiagonal -- Ideal of the small diagonal in (P^1)^n
*******************************************************

  * Usage:
        I = smallDiagonal n
        I = smallDiagonal S
  * Inputs:
      * n, an integer (Macaulay2Doc), number of factors of P^1
      * S, a ring (Macaulay2Doc), ring with 2n vars, corresponding
        to (P^1)^n for some n
  * Outputs:
      * I, an ideal (Macaulay2Doc), ideal of the small diagonal

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

+-----------------------------------------------------------------------------+
|i1 : smallDiagonal 3                                                         |
|                                                                             |
|o1 = ideal (- x   x    + x   x   , - x   x    + x   x   , - x   x    +       |
|               1,0 0,1    0,0 1,1     1,0 0,2    0,0 1,2     1,1 0,2         |
|     ------------------------------------------------------------------------|
|     x   x   )                                                               |
|      0,1 1,2                                                                |
|                                                                             |
|                ZZ                                                           |
|o1 : Ideal of -----[x   , x   , x   , x   , x   , x   ]                      |
|              32003  0,0   1,0   0,1   1,1   0,2   1,2                       |
+-----------------------------------------------------------------------------+
|i2 : S = productOfProjectiveSpaces 3                                         |
|                                                                             |
|o2 = S                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : smallDiagonal S                                                         |
|                                                                             |
|o3 = ideal (- x   x    + x   x   , - x   x    + x   x   , - x   x    +       |
|               1,0 0,1    0,0 1,1     1,0 0,2    0,0 1,2     1,1 0,2         |
|     ------------------------------------------------------------------------|
|     x   x   )                                                               |
|      0,1 1,2                                                                |
|                                                                             |
|o3 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+

See also
========

  * productOfProjectiveSpaces -- Constructs
    the multi-graded ring of a product of copies of P^1 (pp is a synonym)

Ways to use smallDiagonal:
==========================

  * "smallDiagonal(Ring)"
  * "smallDiagonal(ZZ)"

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

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

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

The source of this document is in K3Carpets.m2:1857:0.