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

NumericalSemigroups -- Compute invariants of a numerical semigroup
******************************************************************

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

In this package we consider numerical semigroups: that is, cofinite subsets of
the natural numbers that are closed under sums. We generally refer to these
simply as semigroups.  A semigroup S thus includes the empty sum, 0, but we
input semigroups by giving generators, all nonzero. The smallest nonzero
element of S is the multiplicity. The Apery set (really sequence) of a
semigroup S is the the list {a_1..a_m-1} where a_i is the smallest element in S
such that a_i = i mod m. The conductor is 1 plus the largest element not in S.
We generally specify a semigroup by giving a list of positive integers L with
gcd = 1, representing the semigroup of all sums of elements of L.

Combinatorial properties of the Kunz cone
=========================================

  * coneEquations -- Find the equations of the Kunz cones
  * mu -- Compute the point representing a semigroup in the Kunz
    cone
  * facetRays -- computes the rays spanning the face in which
    a semigroup lies
  * coneRays -- All the rays of the (homogeneous) Kunz cone
  * allSemigroups -- Compute the Hilbert basis and module
    generators of a cone of semigroups
  * findSemigroups -- Find all semigroups with a given
    number of gaps, multiplicity and/or conductor
  * buchweitzCriterion -- Does L satisfies the
    Buchweitz criterion?
  * buchweitz -- An example of a semigroup that is not a
    Weierstrass semigroup
  * buchweitzSemigroups -- Finds semigroups that
    are not Weierstrass semigroups by the Buchweitz test

Properties of semigroup rings
=============================

  * burchIndex -- Compute the burchIndex of the Burch ring
    of a semigroup
  * semigroupRing -- forms the semigroup ring over
    "BaseField"
  * socle -- elements of the semigroup that are in the socle mod
    the multiplicity
  * kunzRing -- artinian reduction of a semigroup ring
  * isSymmetric -- test whether the semigroup generated by
    L is symmetric

Weierstrass semigroups
======================

The question whether every semigroup is a Weierstrass semigroup was answered
negatively by Buchweitz: the semigroup generated by {13, 14, 15, 16, 17, 18,
20, 22, 23} is not a Weierstrass semigroup, as demonstrated in buchweitz.
On the other hand Pinkham gave a positive criterion with
deformation theory. A semigroup is a Weierstrass semigroup if and only if the
graded semigroup ring of L has a smoothing deformation with strictly positive
deformation parameters.

In this section we implemented Pinkham's approach in POSITIVE CHARACTERISTIC.
We plan to extend the smoothing results to characteristic 0 in the future.
  * makeUnfolding -- Makes the universal homogeneous
    unfolding of an ideal with positive degree parameters
  * flatteningRelations -- Compute the flattening
    relations of an unfolding
  * getFlatFamily -- Compute the flat family depending on
    a subset of parameters of the universal unfolding
  * findPoint -- Find a kk-rational point in a variety
  * isARandomFiberSmooth -- Test whether a random
    fiber is smooth
  * heuristicSmoothness -- Check whether an affine
    curve is smooth
  * isWeierstrassSemigroup -- Experimentally
    decide whether L is a Weierstrass semigroup
  * nonWeierstrassSemigroups -- Find possibly
    non Weierstrass Semigroups
  * LabBookProtocol -- Weierstrass Semigroups in Low
    genus

Authors
=======

  * David Eisenbud (see http://eisenbud.github.io ) <de@berkeley.edu>
  * Frank-Olaf Schreyer (see
    https://www.math.uni-sb.de/ag/schreyer/index.php/publications/publications-
    frank-olaf-schreyer ) <schreyer@math.uni-sb.de>

Version
=======

This documentation describes version 1.0 of NumericalSemigroups.

Citation
========

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

+----------------------------------------------------------------------------+
|@misc{NumericalSemigroupsSource,                                            |
|  title = {{NumericalSemigroups: A \emph{Macaulay2} package. Version~1.0}}, |
|  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
      * allSemigroups -- Compute the Hilbert basis and
        module generators of a cone of semigroups
      * apery -- Compute the apery set, multiplicity and
        conductor
      * aperySemigroupRing -- computes the semigroup
        ring using both the multiplicity and the full Apery set
      * aperySet -- Compute the apery set of a numerical
        semigroup
      * buchweitz -- An example of a semigroup that is not a
        Weierstrass semigroup
      * buchweitzCriterion -- Does L satisfies the
        Buchweitz criterion?
      * buchweitzSemigroups -- Finds semigroups
        that are not Weierstrass semigroups by the Buchweitz test
      * burchIndex -- Compute the burchIndex of the Burch
        ring of a semigroup
      * coneEquations -- Find the equations of the Kunz
        cones
      * coneRays -- All the rays of the (homogeneous) Kunz
        cone
      * def1 -- degrees of a basis of T^1
      * "effectiveWeight" -- see ewt, -- Effective weight of a
        semigroup (Pflueger)
      * ewt -- Effective weight of a semigroup (Pflueger)
      * facetRays -- computes the rays spanning the face in
        which a semigroup lies
      * findPoint -- Find a kk-rational point in a variety
      * findSemigroups -- Find all semigroups with a
        given number of gaps, multiplicity and/or conductor
      * flatteningRelations -- Compute the
        flattening relations of an unfolding
      * fractionalIdeal -- turn a fractional ideal into
        a proper ideal
      * gaps -- The gap sequence of a semigroup
      * getFlatFamily -- Compute the flat family
        depending on a subset of parameters of the universal unfolding
      * heuristicSmoothness -- Check whether an
        affine curve is smooth
      * isARandomFiberSmooth -- Test whether a
        random fiber is smooth
      * isGapSequence -- test whether a list of integers
        can be the list of gaps of a semigroup
      * isSmoothableSemigroup -- Look for a
        smoothing family
      * isSymmetric -- test whether the semigroup generated
        by L is symmetric
      * isWeierstrassSemigroup -- Experimentally
        decide whether L is a Weierstrass semigroup
      * knownExample -- Is L a known Weierstrass
        semigroup?
      * kunzMatrix -- determine the set of facet equations
        satisfied by a semigroup
      * kunzRing -- artinian reduction of a semigroup ring
      * LabBookProtocol -- Weierstrass Semigroups in
        Low genus
      * makeUnfolding -- Makes the universal homogeneous
        unfolding of an ideal with positive degree parameters
      * mu -- Compute the point representing a semigroup in the Kunz
        cone
      * nonWeierstrassSemigroups -- Find
        possibly non Weierstrass Semigroups
      * semigroup -- Compute the semigroup generated by a
        list of positive integers
      * semigroupIdeal -- The ideal defining the
        semigroup ring
      * semigroupRing -- forms the semigroup ring over
        "BaseField"
      * socle -- elements of the semigroup that are in the socle
        mod the multiplicity
      * sums -- sum of two sequences
      * type -- type of the local semigroup ring
      * weight -- weight of a semigroup
  * Methods
      * "allSemigroups(List)" -- see allSemigroups, --
        Compute the Hilbert basis and module generators of a cone of semigroups
      * "allSemigroups(ZZ)" -- see allSemigroups, --
        Compute the Hilbert basis and module generators of a cone of semigroups
      * "apery(List)" -- see apery, -- Compute the apery set,
        multiplicity and conductor
      * "aperySemigroupRing(List)" -- see aperySemigroupRing,
        -- computes the semigroup ring using both the
        multiplicity and the full Apery set
      * "aperySet(HashTable)" -- see aperySet, -- Compute the
        apery set of a numerical semigroup
      * "aperySet(List)" -- see aperySet, -- Compute the apery
        set of a numerical semigroup
      * "buchweitz(ZZ)" -- see buchweitz, -- An example of a
        semigroup that is not a Weierstrass semigroup
      * "buchweitzCriterion(List)" -- see buchweitzCriterion,
        -- Does L satisfies the Buchweitz criterion?
      * "buchweitzCriterion(ZZ,List)" -- see buchweitzCriterion,
        -- Does L satisfies the Buchweitz criterion?
      * "buchweitzSemigroups(ZZ)" -- see buchweitzSemigroups,
        -- Finds semigroups that are not Weierstrass
        semigroups by the Buchweitz test
      * "buchweitzSemigroups(ZZ,ZZ)" -- see buchweitzSemigroups,
        -- Finds semigroups that are not Weierstrass
        semigroups by the Buchweitz test
      * "buchweitzSemigroups(ZZ,ZZ,ZZ)" -- see buchweitzSemigroups,
        -- Finds semigroups that are not Weierstrass
        semigroups by the Buchweitz test
      * "burchIndex(List)" -- see burchIndex, -- Compute the
        burchIndex of the Burch ring of a semigroup
      * conductor(List) -- conductor of a semigroup
      * "coneEquations(List)" -- see coneEquations, --
        Find the equations of the Kunz cones
      * "coneEquations(ZZ)" -- see coneEquations, -- Find
        the equations of the Kunz cones
      * "coneRays(ZZ)" -- see coneRays, -- All the rays of the
        (homogeneous) Kunz cone
      * "def1(List)" -- see def1, -- degrees of a basis of T^1
      * "effectiveWeight(List)" -- see ewt, -- Effective weight of a
        semigroup (Pflueger)
      * "ewt(List)" -- see ewt, -- Effective weight of a semigroup
        (Pflueger)
      * "facetRays(List)" -- see facetRays, -- computes the
        rays spanning the face in which a semigroup lies
      * "findPoint(Ideal)" -- see findPoint, -- Find a
        kk-rational point in a variety
      * "findSemigroups(ZZ)" -- see findSemigroups, --
        Find all semigroups with a given number of gaps, multiplicity and/or
        conductor
      * "findSemigroups(ZZ,ZZ)" -- see findSemigroups, --
        Find all semigroups with a given number of gaps, multiplicity and/or
        conductor
      * "findSemigroups(ZZ,ZZ,ZZ)" -- see findSemigroups,
        -- Find all semigroups with a given number of gaps, multiplicity and/or
        conductor
      * "flatteningRelations(Ideal,Ring,Matrix)" -- see
        flatteningRelations, -- Compute the flattening
        relations of an unfolding
      * "fractionalIdeal(List,List)" -- see fractionalIdeal,
        -- turn a fractional ideal into a proper ideal
      * "gaps(List)" -- see gaps, -- The gap sequence of a
        semigroup
      * genus(List) -- Compute the number of gaps
        (genus) of a semigroup
      * "getFlatFamily(List,RR,ZZ)" -- see getFlatFamily,
        -- Compute the flat family depending on a subset of parameters of the
        universal unfolding
      * "heuristicSmoothness(Ideal)" -- see heuristicSmoothness,
        -- Check whether an affine curve is smooth
      * "isARandomFiberSmooth(Ideal,Ideal,Matrix)" -- see
        isARandomFiberSmooth, -- Test whether a random
        fiber is smooth
      * "isGapSequence(List)" -- see isGapSequence, --
        test whether a list of integers can be the list of gaps of a semigroup
      * "isSmoothableSemigroup(List,RR,ZZ)" -- see isSmoothableSemigroup,
        -- Look for a smoothing family
      * "isSymmetric(List)" -- see isSymmetric, -- test
        whether the semigroup generated by L is symmetric
      * "isWeierstrassSemigroup(List,RR)" -- see isWeierstrassSemigroup,
        -- Experimentally decide whether L is a
        Weierstrass semigroup
      * "knownExample(List)" -- see knownExample, -- Is L a
        known Weierstrass semigroup?
      * "kunzMatrix(HashTable)" -- see kunzMatrix, --
        determine the set of facet equations satisfied by a semigroup
      * "kunzMatrix(List)" -- see kunzMatrix, -- determine
        the set of facet equations satisfied by a semigroup
      * "kunzRing(List)" -- see kunzRing, -- artinian reduction
        of a semigroup ring
      * "LabBookProtocol(ZZ)" -- see LabBookProtocol, --
        Weierstrass Semigroups in Low genus
      * "makeUnfolding(Ideal)" -- see makeUnfolding, --
        Makes the universal homogeneous unfolding of an ideal with positive
        degree parameters
      * "makeUnfolding(List)" -- see makeUnfolding, --
        Makes the universal homogeneous unfolding of an ideal with positive
        degree parameters
      * mingens(List) -- Find a mininmal set of
        semigroup generators
      * "mu(HashTable)" -- see mu, -- Compute the point representing
        a semigroup in the Kunz cone
      * "mu(List)" -- see mu, -- Compute the point representing a
        semigroup in the Kunz cone
      * "nonWeierstrassSemigroups(ZZ,ZZ)" -- see
        nonWeierstrassSemigroups, -- Find possibly
        non Weierstrass Semigroups
      * "nonWeierstrassSemigroups(ZZ,ZZ,List)" -- see
        nonWeierstrassSemigroups, -- Find possibly
        non Weierstrass Semigroups
      * "semigroup(List)" -- see semigroup, -- Compute the
        semigroup generated by a list of positive integers
      * "semigroupIdeal(List)" -- see semigroupIdeal, --
        The ideal defining the semigroup ring
      * "semigroupRing(List)" -- see semigroupRing, --
        forms the semigroup ring over "BaseField"
      * "socle(List)" -- see socle, -- elements of the semigroup
        that are in the socle mod the multiplicity
      * "sums(List,List)" -- see sums, -- sum of two sequences
      * "sums(ZZ,List)" -- see sums, -- sum of two sequences
      * "type(List)" -- see type, -- type of the local semigroup
        ring
      * "weight(List)" -- see weight, -- weight of a semigroup

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

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

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

The source of this document is in NumericalSemigroups.m2:1494:0.

allSemigroups -- Compute the Hilbert basis and module generators of a cone of semigroups
****************************************************************************************

  * Usage:
        (H,M) = allSemigroups L
        (H,M) = allSemigroups m
  * Inputs:
      * L, a list (Macaulay2Doc), of generators of a semigroup
      * m, an integer (Macaulay2Doc), the multiplicity of the
        semigroups
  * Outputs:
      * H, a matrix (Macaulay2Doc), of integers; the rows form
        the Hilbert basis  of the cone
      * M, a matrix (Macaulay2Doc), of module generators of the
        cone

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

Using Normaliz we compute the face of the Kunz cone containing L. In case of
allSemigroups m the output describes the complete Kunz cone of all semigroups
of multiplicity m.

+--------------------------------+
|i1 : allSemigroups {4,7,9}      |
|                                |
|o1 = (| 4  8 4 |, | 9  14 7 |)  |
|      | 8  8 4 |  | 13 14 7 |   |
|      | 12 8 4 |  | 17 14 7 |   |
|                  | 21 14 7 |   |
|                                |
|o1 : Sequence                   |
+--------------------------------+
|i2 : allSemigroups 4            |
|                                |
|o2 = (| 4  0 4  |, | 5  6  7  |)|
|      | 4  4 4  |  | 5  6  11 | |
|      | 4  4 8  |  | 5  10 7  | |
|      | 4  8 4  |  | 5  10 11 | |
|      | 4  8 8  |  | 5  10 15 | |
|      | 4  8 12 |  | 9  6  7  | |
|      | 8  4 4  |  | 9  10 7  | |
|      | 8  8 4  |  | 9  14 7  | |
|      | 12 8 4  |  | 13 6  7  | |
|                   | 13 10 7  | |
|                   | 13 14 7  | |
|                   | 17 10 7  | |
|                   | 17 14 7  | |
|                   | 21 14 7  | |
|                                |
|o2 : Sequence                   |
+--------------------------------+

On the face with the buchweitz, example there are two facet
rays:

+-----------------------------------------------------------------------------+
|i3 : (H,M) = allSemigroups buchweitz 0                                       |
|                                                                             |
|o3 = (| 13 13 13 13 13 26 13 26  13  13  26  26  |, | 14 15 16 17 18 32 20   |
|      | 13 26 39 52 65 78 91 104 117 130 143 156 |  | 14 28 42 56 70 84 98   |
|     ------------------------------------------------------------------------|
|     34  22  23  37  38  |)                                                  |
|     112 126 140 154 168 |                                                   |
|                                                                             |
|o3 : Sequence                                                                |
+-----------------------------------------------------------------------------+

The first row of H is 13*(mu buchweitz 0), the mu vector of the Buchweitz
example. Adding multiples of the first row to the Weierstrass semigroups of an
ordinary point on a curve of genus 12, we eventually reach a semigroup that
fails the Buchweitz test to be a Weierstrass semigroup:

+-----------------------------------------------------------+
|i4 : b = {0}|flatten (entries H)_0                         |
|                                                           |
|o4 = {0, 13, 13, 13, 13, 13, 26, 13, 26, 13, 13, 26, 26}   |
|                                                           |
|o4 : List                                                  |
+-----------------------------------------------------------+
|i5 : L = toList (13..25)                                   |
|                                                           |
|o5 = {13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}  |
|                                                           |
|o5 : List                                                  |
+-----------------------------------------------------------+
|i6 : for i from 0 to 15 list (                             |
|         L' = L+i*b;                                       |
|         G = gaps L';                                      |
|         3*(genus L' -1)-#sums(G,G)                        |
|         )                                                 |
|                                                           |
|o6 = {10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5}|
|                                                           |
|o6 : List                                                  |
+-----------------------------------------------------------+

By Riemann-Roch the quantity 3*(genus L' -1)-#sums(G,G) is non-negative for
Weierstrass semigroups. We conjecture that the same thing is true for any
semigroup L0 of multiplicity 13 in place of L. Here is a "random" example:

+-----------------------------------------------------------------------------+
|i7 : setRandomSeed 0                                                         |
| -- setting random seed to 0                                                 |
|                                                                             |
|o7 = 0                                                                       |
+-----------------------------------------------------------------------------+
|i8 : L0 = {13}|aperySet ({13}|apply(1 + random 10, i->13+random 10))         |
|                                                                             |
|o8 = {13, 14, 28, 16, 30, 44, 32, 20, 21, 35, 36, 37, 51}                    |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : for i from 0 to 20 list (                                               |
|        L' = L0+i*b;                                                         |
|        G = gaps L';                                                         |
|        3*(genus L' -1)-#sums(G,G)                                           |
|        )                                                                    |
|                                                                             |
|o9 = {3, 8, 10, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0, -1, -2, -3, -4, -5, -6, -7}|
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * aperySet -- Compute the apery set of a numerical semigroup
  * coneEquations -- Find the equations of the Kunz cones
  * buchweitzCriterion -- Does L satisfies the
    Buchweitz criterion?

Ways to use allSemigroups:
==========================

  * "allSemigroups(List)"
  * "allSemigroups(ZZ)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2268:0.

apery -- Compute the apery set, multiplicity and conductor
**********************************************************

  * Usage:
        A = apery L
  * Inputs:
      * L, a list (Macaulay2Doc), of positive integers
  * Outputs:
      * A, a hash table (Macaulay2Doc),

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

The smallest nonzero element of s is the \emph{multiplicity}. The Apery set
(really sequence) of a semigroup S is the the list {a_1..a_m-1} where a_i is
the smallest element in s such that a_i = i mod m. The \emph{conductor} is 1
plus the largest element \emph{not} in S. We generally specify a semigroup by
giving a list of positive integers L with gcd = 1, representing the semigroup
of all sums of elements of L.

+-----------------------------------------------------+
|i1 : L = {3,5}                                       |
|                                                     |
|o1 = {3, 5}                                          |
|                                                     |
|o1 : List                                            |
+-----------------------------------------------------+
|i2 : apery L                                         |
|                                                     |
|o2 = HashTable{1 => 10                              }|
|               2 => 5                                |
|               "conductor" => 8                      |
|               "multiplicity" => 3                   |
|               "semigroup" => {0, 3, 5, 6, 8, 9, 10} |
|                                                     |
|o2 : HashTable                                       |
+-----------------------------------------------------+

See also
========

  * aperySet -- Compute the apery set of a numerical semigroup

Ways to use apery:
==================

  * "apery(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1661:0.

aperySemigroupRing -- computes the semigroup ring using both the multiplicity and the full Apery set
****************************************************************************************************

  * Usage:
        R = aperySemigroupRing L
  * Inputs:
      * L, a list (Macaulay2Doc),
  * Outputs:
      * R, a ring (Macaulay2Doc),

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

While the function semigroupRing L uses just a minimal set of generators, the
function aperySemigroupRing L uses the larger Apery set, and puts the generator
corresponding to the multiplicity at the end.

+------------------------------+
|i1 : L = {5,6}                |
|                              |
|o1 = {5, 6}                   |
|                              |
|o1 : List                     |
+------------------------------+
|i2 : aperySet L               |
|                              |
|o2 = {6, 12, 18, 24}          |
|                              |
|o2 : List                     |
+------------------------------+
|i3 : gens aperySemigroupRing L|
|                              |
|o3 = {x , x , x , x , x }     |
|       1   2   3   4   0      |
|                              |
|o3 : List                     |
+------------------------------+
|i4 : gens semigroupRing L     |
|                              |
|o4 = {x , x }                 |
|       0   1                  |
|                              |
|o4 : List                     |
+------------------------------+

See also
========

  * semigroupRing -- forms the semigroup ring over
    "BaseField"
  * aperySet -- Compute the apery set of a numerical semigroup
  * mingens (Macaulay2Doc) -- minimal generator matrix

Ways to use aperySemigroupRing:
===============================

  * "aperySemigroupRing(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:3001:0.

aperySet -- Compute the apery set of a numerical semigroup
**********************************************************

  * Usage:
        as = aperySet L
        aS = aperySet HL
  * Inputs:
      * L, a list (Macaulay2Doc), of positive integers
      * H, a hash table (Macaulay2Doc), as computed by H =
        apery L
  * Outputs:
      * aS, a list (Macaulay2Doc),

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

L is taken as generators of a numerical semigroup S; should have gcd = 1. The
apery set is then the list aS = {a_1..a_(m-1)} where m is the smallest element
of L, and a_i is the smallest element of S with a_i = i mod m.

+---------------------------+
|i1 : aperySet {3,5}        |
|                           |
|o1 = {10, 5}               |
|                           |
|o1 : List                  |
+---------------------------+
|i2 : semigroup {3,5}       |
|                           |
|o2 = {0, 3, 5, 6, 8, 9, 10}|
|                           |
|o2 : List                  |
+---------------------------+

See also
========

  * apery -- Compute the apery set, multiplicity and conductor

Ways to use aperySet:
=====================

  * "aperySet(HashTable)"
  * "aperySet(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1690:0.

buchweitz -- An example of a semigroup that is not a Weierstrass semigroup
**************************************************************************

  * Usage:
        L = buchweitz i
  * Inputs:
      * i, an integer (Macaulay2Doc),
  * Outputs:
      * L, a list (Macaulay2Doc), generators of a semigroup

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

For i>=0 this produces a semigroup B with genus 16+i, conductor 26+2i, and
#sums(2, gaps buchweitz i) = 3*(genus B -1)+1). This implies that these
semigroups are NOT Weierstrass semigroups by the following argument, first
employed by Buchweitz:

If L generates the Weierstrass semigroup of a point x on a Riemann surface C,
then the gaps L is the set {1+v | v is the order at p of vanishing of a global
section of \omega_C}. Thus sums(d, #gaps L) <= dim H^0(\omega_C^{d) = d*(2g-1)
- g + 1.

+-----------------------------------------+
|i1 : B = buchweitz 0                     |
|                                         |
|o1 = {13, 14, 15, 16, 17, 18, 20, 22, 23}|
|                                         |
|o1 : List                                |
+-----------------------------------------+
|i2 : g = #gaps B                         |
|                                         |
|o2 = 16                                  |
+-----------------------------------------+
|i3 : m = 3                               |
|                                         |
|o3 = 3                                   |
+-----------------------------------------+
|i4 : 2*(2*g-2) - g + 1                   |
|                                         |
|o4 = 45                                  |
+-----------------------------------------+
|i5 : #sums(2, gaps B)                    |
|                                         |
|o5 = 46                                  |
+-----------------------------------------+

More such semigroups can be found with buchweitzSemigroups,

Acknowledgement
===============

The result was written in Ragnar Buchweitz' These d'Etat, but never otherwise
published by Buchweitz. In the meantime it became famous anyway.

Ways to use buchweitz:
======================

  * "buchweitz(ZZ)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2783:0.

buchweitzCriterion -- Does L satisfies the Buchweitz criterion?
***************************************************************

  * Usage:
        d = buchweitzCriterion L
        d = buchweitzCriterion(m,L)
  * Inputs:
      * L, a list (Macaulay2Doc), generators of a semigroup or the
        aperyset of a semigroup
      * m, an integer (Macaulay2Doc), the multiplicity of the
        semigroup
  * Outputs:
      * d, an integer (Macaulay2Doc),

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

A Weierstrass semigroups L satisfies

3*(genus L-1) -#sums(G,G) >=0.

The function returns this difference.

+-----------------------------------------------------------------------------+
|i1 : L={7,12,13}                                                             |
|                                                                             |
|o1 = {7, 12, 13}                                                             |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : buchweitzCriterion L                                                    |
|                                                                             |
|o2 = 0                                                                       |
+-----------------------------------------------------------------------------+
|i3 : L= buchweitz 0                                                          |
|                                                                             |
|o3 = {13, 14, 15, 16, 17, 18, 20, 22, 23}                                    |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : buchweitzCriterion L                                                    |
|                                                                             |
|o4 = -1                                                                      |
+-----------------------------------------------------------------------------+
|i5 : (H,M)=allSemigroups L                                                   |
|                                                                             |
|o5 = (| 13 13 13 13 13 26 13 26  13  13  26  26  |, | 14 15 16 17 18 32 20   |
|      | 13 26 39 52 65 78 91 104 117 130 143 156 |  | 14 28 42 56 70 84 98   |
|     ------------------------------------------------------------------------|
|     34  22  23  37  38  |)                                                  |
|     112 126 140 154 168 |                                                   |
|                                                                             |
|o5 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i6 : b=(entries M)_0                                                         |
|                                                                             |
|o6 = {14, 15, 16, 17, 18, 32, 20, 34, 22, 23, 37, 38}                        |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : g=(entries H)_0                                                         |
|                                                                             |
|o7 = {13, 13, 13, 13, 13, 26, 13, 26, 13, 13, 26, 26}                        |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : apply(3,i->buchweitzCriterion(13,b+i*g))                                |
|                                                                             |
|o8 = {-1, -2, -3}                                                            |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+

See also
========

  * buchweitz -- An example of a semigroup that is not a
    Weierstrass semigroup

Ways to use buchweitzCriterion:
===============================

  * "buchweitzCriterion(List)"
  * "buchweitzCriterion(ZZ,List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1634:0.

buchweitzSemigroups -- Finds semigroups that are not Weierstrass semigroups by the Buchweitz test
*************************************************************************************************

  * Usage:
        LL = buchweitzSemigroups g
        LL = buchweitzSemigroups (m,g)
        LL = buchweitzSemigroups (m,c,g)
  * Inputs:
      * g, an integer (Macaulay2Doc), genus
      * m, an integer (Macaulay2Doc), multiplicity
      * c, an integer (Macaulay2Doc), conductor
  * Outputs:
      * LL, a list (Macaulay2Doc), list of semigroups

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

Uses findSemigroups to produce lists of semigroups with the given invariants,
and then uses the Buchweitz test: the following inequality holds for
Weierstrass semigroups: sums(2, #gaps L) <= dim H^0(\omega_C^{2) = 2*(2g-1) - g
+ 1.

+-----------------------------------------------------------------------------+
|i1 : B = buchweitzSemigroups (13,26,16)                                      |
|                                                                             |
|o1 = {{13, 14, 15, 16, 17, 18, 21, 22, 24}, {13, 14, 15, 16, 17, 18, 20, 22, |
|     ------------------------------------------------------------------------|
|     23}}                                                                    |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : buchweitz 0                                                             |
|                                                                             |
|o2 = {13, 14, 15, 16, 17, 18, 20, 22, 23}                                    |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+
|i3 : B = buchweitzSemigroups (14,28,17)                                      |
|                                                                             |
|o3 = {{14, 15, 16, 17, 18, 19, 20, 23, 24, 26}, {14, 15, 16, 17, 18, 19, 20, |
|     ------------------------------------------------------------------------|
|     22, 24, 25}}                                                            |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+

The second example in these two cases are part of the sequence defined in
buchweitz. As g increases there are many more.

+------------------------------------+
|i4 : #buchweitzSemigroups (15,30,18)|
|                                    |
|o4 = 8                              |
+------------------------------------+

See also
========

  * buchweitz -- An example of a semigroup that is not a
    Weierstrass semigroup
  * findSemigroups -- Find all semigroups with a given
    number of gaps, multiplicity and/or conductor

Ways to use buchweitzSemigroups:
================================

  * "buchweitzSemigroups(ZZ)"
  * "buchweitzSemigroups(ZZ,ZZ)"
  * "buchweitzSemigroups(ZZ,ZZ,ZZ)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2825:0.

burchIndex -- Compute the burchIndex of the Burch ring of a semigroup
*********************************************************************

  * Usage:
        b = burchIndex L
  * Inputs:
      * L, a list (Macaulay2Doc), of generators of a semigroup
  * Outputs:
      * b, an integer (Macaulay2Doc),

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

The Burch index of an artinian local ring A = S/I, where (S,n,k) is regular
local, is dim_k (n/(nI:(I:n))). The number returned by

burchIndex L

where L is a list of integers, is the burch index of the Kunz ring of L, that
is, the semigroup ring of L modulo the lowest degree element.

+-----------------------+
|i1 : burchIndex {3,4,5}|
|                       |
|o1 = 2                 |
+-----------------------+

References
==========

Dao, HL and Eisenbud, D, Burch index, summands of syzygies and linearity in
resolutions. Bull. Iranian Math. Soc. 49 (2023).

See also
========

  * kunzRing -- artinian reduction of a semigroup ring

Ways to use burchIndex:
=======================

  * "burchIndex(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:3045:0.

conductor(List) -- conductor of a semigroup
*******************************************

  * Function: conductor (IntegralClosure),
  * Usage:
        c = conductor L
  * Inputs:
      * L, a list (Macaulay2Doc), of generators of a semigroup
  * Outputs:
      * c, an integer (Macaulay2Doc), conductor of the semigroups

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

Semigroups in this package are additively closed cofinite subsets of ZZ_{>= 0}.
The conductor is the smallest element c such that c+i is in the semigroup for
all i >= 0. For a semigroup generated by two elements a,b, the conductor is
(a-1)(b-1), but for semigroups with more generators there is no known formula.

+----------------------------+
|i1 : conductor {3,5}        |
|                            |
|o1 = 8                      |
+----------------------------+
|i2 : conductor {5, 7, 9, 13}|
|                            |
|o2 = 12                     |
+----------------------------+

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

  * conductor(List) -- conductor of a semigroup
-------------------------------------------------------------------------------

The source of this document is in NumericalSemigroups.m2:2138:0.

coneEquations -- Find the equations of the Kunz cones
*****************************************************

  * Usage:
        M =  coneEquations m
        M = coneEquations sgrp
  * Inputs:
      * m, an integer (Macaulay2Doc), multiplicity
      * sgrp, a list (Macaulay2Doc), generators of a semigroup
  * Optional inputs (Macaulay2Doc),:
      * Inhomogeneous
  * Outputs:
      * M, a matrix (Macaulay2Doc), m-1 x d matrix whose columns
        represent inequalities defining the Kunz cone

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

Let S be the numerical semigroup defined by a list sgrp, have multiplicity m
and apery set a_1,\dots,a_(m-1) and set mu_i = (a_i -i)//m. The homogeneous
Kunz cone of semigroups of multiplity m is the convex polyhedral cone defined
by the inequalities of the form

a_i + a_j - a_(i+j) \geq 0.

where 1\leq i,j\leq m-1 and i+j\neq m is interpreted mod m. The function
coneEquations m returns an m-1 x d matrix of ZZ whose columns are the
coefficients of the left hand sides of these inequalities. The function
coneEquations sgrp does the same, with additional columns representing the
additional inequalities of this type that are satisfied by the Apery set
apery(sgrp). For m = 3, the semigroup {3,4,5} is interior (and thus satisfies
no further equations), while the semigroups {3,4} and {3,5} are on the two
extremal rays of the cone.

+--------------------------+
|i1 : coneEquations 3      |
|                          |
|o1 = | 2  -1 |            |
|     | -1 2  |            |
|                          |
|              2       2   |
|o1 : Matrix ZZ  <-- ZZ    |
+--------------------------+
|i2 : coneEquations {3,4,5}|
|                          |
|o2 = | 2  -1 |            |
|     | -1 2  |            |
|                          |
|              2       2   |
|o2 : Matrix ZZ  <-- ZZ    |
+--------------------------+
|i3 : coneEquations {3,4}  |
|                          |
|o3 = | 2  -1 -2 |         |
|     | -1 2  1  |         |
|                          |
|              2       3   |
|o3 : Matrix ZZ  <-- ZZ    |
+--------------------------+
|i4 : coneEquations {3,5}  |
|                          |
|o4 = | 2  -1 1  |         |
|     | -1 2  -2 |         |
|                          |
|              2       3   |
|o4 : Matrix ZZ  <-- ZZ    |
+--------------------------+
|i5 : allSemigroups 3      |
|                          |
|o5 = (| 3 3 |, | 4  5 |)  |
|      | 3 6 |  | 4  8 |   |
|      | 6 3 |  | 7  5 |   |
|               | 10 5 |   |
|                          |
|o5 : Sequence             |
+--------------------------+

The inhomogeneous Kunz cone does the same, but for the numbers mu_i instead of
a_i. Thus when i+j > m the inequality mu_i+mu_j-mu_(i+j) \geq 0 is replaced by
the inequality

mu_i+mu_j - mu_(i+j) -1.

The function coneEquations(m, "Inhomogeneous" => true) returns the same matrix
as in the homogeneous case, with one more row, where the last row represents
the constant terms of this inquality:

+-----------------------------------------------------+
|i6 : eq=coneEquations(3, "Inhomogeneous" => true)    |
|                                                     |
|o6 = | 2  -1 |                                       |
|     | -1 2  |                                       |
|     | 0  -1 |                                       |
|                                                     |
|              3       2                              |
|o6 : Matrix ZZ  <-- ZZ                               |
+-----------------------------------------------------+
|i7 : coneEquations({3,4,5}, "Inhomogeneous" => true) |
|                                                     |
|o7 = | 2  -1 |                                       |
|     | -1 2  |                                       |
|     | 0  -1 |                                       |
|                                                     |
|              3       2                              |
|o7 : Matrix ZZ  <-- ZZ                               |
+-----------------------------------------------------+
|i8 : coneEquations({3,4}, "Inhomogeneous" => true)   |
|                                                     |
|o8 = | 2  -1 -2 |                                    |
|     | -1 2  1  |                                    |
|     | 0  -1 0  |                                    |
|                                                     |
|              3       3                              |
|o8 : Matrix ZZ  <-- ZZ                               |
+-----------------------------------------------------+
|i9 : coneEquations({3,5}, "Inhomogeneous" => true)   |
|                                                     |
|o9 = | 2  -1 1  |                                    |
|     | -1 2  -2 |                                    |
|     | 0  -1 1  |                                    |
|                                                     |
|              3       3                              |
|o9 : Matrix ZZ  <-- ZZ                               |
+-----------------------------------------------------+
|i10 : (H,M)=allSemigroups 3                          |
|                                                     |
|o10 = (| 3 3 |, | 4  5 |)                            |
|       | 3 6 |  | 4  8 |                             |
|       | 6 3 |  | 7  5 |                             |
|                | 10 5 |                             |
|                                                     |
|o10 : Sequence                                       |
+-----------------------------------------------------+
|i11 : (H,M)=allSemigroups 4                          |
|                                                     |
|o11 = (| 4  0 4  |, | 5  6  7  |)                    |
|       | 4  4 4  |  | 5  6  11 |                     |
|       | 4  4 8  |  | 5  10 7  |                     |
|       | 4  8 4  |  | 5  10 11 |                     |
|       | 4  8 8  |  | 5  10 15 |                     |
|       | 4  8 12 |  | 9  6  7  |                     |
|       | 8  4 4  |  | 9  10 7  |                     |
|       | 8  8 4  |  | 9  14 7  |                     |
|       | 12 8 4  |  | 13 6  7  |                     |
|                    | 13 10 7  |                     |
|                    | 13 14 7  |                     |
|                    | 17 10 7  |                     |
|                    | 17 14 7  |                     |
|                    | 21 14 7  |                     |
|                                                     |
|o11 : Sequence                                       |
+-----------------------------------------------------+
|i12 : M1=(M|matrix apply(rank target M,i->{-1}))     |
|                                                     |
|o12 = | 5  6  7  -1 |                                |
|      | 5  6  11 -1 |                                |
|      | 5  10 7  -1 |                                |
|      | 5  10 11 -1 |                                |
|      | 5  10 15 -1 |                                |
|      | 9  6  7  -1 |                                |
|      | 9  10 7  -1 |                                |
|      | 9  14 7  -1 |                                |
|      | 13 6  7  -1 |                                |
|      | 13 10 7  -1 |                                |
|      | 13 14 7  -1 |                                |
|      | 17 10 7  -1 |                                |
|      | 17 14 7  -1 |                                |
|      | 21 14 7  -1 |                                |
|                                                     |
|               14       4                            |
|o12 : Matrix ZZ   <-- ZZ                             |
+-----------------------------------------------------+
|i13 : eqInh=coneEquations(4, "Inhomogeneous" => true)|
|                                                     |
|o13 = | 2  1  -1 0  |                                |
|      | -1 1  1  -1 |                                |
|      | 0  -1 1  2  |                                |
|      | 0  0  -1 -1 |                                |
|                                                     |
|               4       4                             |
|o13 : Matrix ZZ  <-- ZZ                              |
+-----------------------------------------------------+
|i14 : eqh=coneEquations(4)                           |
|                                                     |
|o14 = | 2  1  -1 0  |                                |
|      | -1 1  1  -1 |                                |
|      | 0  -1 1  2  |                                |
|                                                     |
|               3       4                             |
|o14 : Matrix ZZ  <-- ZZ                              |
+-----------------------------------------------------+
|i15 : M1*eqInh                                       |
|                                                     |
|o15 = | 4  4  9  9  |                                |
|      | 4  0  13 17 |                                |
|      | 0  8  13 5  |                                |
|      | 0  4  17 13 |                                |
|      | 0  0  21 21 |                                |
|      | 12 8  5  9  |                                |
|      | 8  12 9  5  |                                |
|      | 4  16 13 1  |                                |
|      | 20 12 1  9  |                                |
|      | 16 16 5  5  |                                |
|      | 12 20 9  1  |                                |
|      | 24 20 1  5  |                                |
|      | 20 24 5  1  |                                |
|      | 28 28 1  1  |                                |
|                                                     |
|               14       4                            |
|o15 : Matrix ZZ   <-- ZZ                             |
+-----------------------------------------------------+
|i16 : H*eqh                                          |
|                                                     |
|o16 = | 8  0  0  8  |                                |
|      | 4  4  4  4  |                                |
|      | 4  0  8  12 |                                |
|      | 0  8  8  0  |                                |
|      | 0  4  12 8  |                                |
|      | 0  0  16 16 |                                |
|      | 12 8  0  4  |                                |
|      | 8  12 4  0  |                                |
|      | 16 16 0  0  |                                |
|                                                     |
|               9       4                             |
|o16 : Matrix ZZ  <-- ZZ                              |
+-----------------------------------------------------+

All entries of M1*eqInh and H*eqh are non-negative as desired.

References
==========

Kunz, Ernst: Klassification numerische Halbgruppen

Caveat
======

See also
========

  * apery -- Compute the apery set, multiplicity and conductor
  * coneRays -- All the rays of the (homogeneous) Kunz cone

Ways to use coneEquations:
==========================

  * "coneEquations(List)"
  * "coneEquations(ZZ)"

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

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

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

The source of this document is in NumericalSemigroups.m2:3192:0.

coneRays -- All the rays of the (homogeneous) Kunz cone
*******************************************************

  * Usage:
        M = coneRays m
  * Inputs:
      * m, an integer (Macaulay2Doc), multiplicity
  * Outputs:
      * M, a matrix (Macaulay2Doc), of ZZ -- columns are vectors
        on the rays of the cone

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

Uses the Fourier-Motzkin algorithm to compute the rays from the list of
supporting hyperplanes, which is given by coneEquations.
The number of rays grows rather quickly with m; the actual number is unknown.
Use facetRays, to determine the rays bounding the face on
which a given semigroup lies.

+-----------------------+
|i1 : coneRays 3        |
|                       |
|o1 = | 1 2 |           |
|     | 2 1 |           |
|                       |
|              2       2|
|o1 : Matrix ZZ  <-- ZZ |
+-----------------------+
|i2 : coneRays 4        |
|                       |
|o2 = | 1 1 3 1 |       |
|     | 2 0 2 2 |       |
|     | 3 1 1 1 |       |
|                       |
|              3       4|
|o2 : Matrix ZZ  <-- ZZ |
+-----------------------+
|i3 : facetRays {4,5,6} |
|                       |
|o3 = | 1 1 |           |
|     | 2 0 |           |
|     | 3 1 |           |
|                       |
|              3       2|
|o3 : Matrix ZZ  <-- ZZ |
+-----------------------+

See also
========

  * coneEquations -- Find the equations of the Kunz cones
  * facetRays -- computes the rays spanning the face in which
    a semigroup lies

Ways to use coneRays:
=====================

  * "coneRays(ZZ)"

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

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

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

The source of this document is in NumericalSemigroups.m2:3221:0.

def1 -- degrees of a basis of T^1
*********************************

  * Usage:
        D = def1 L
  * Inputs:
      * L, a list (Macaulay2Doc), generators of a semigroup
  * Optional inputs (Macaulay2Doc),:
      * BaseField
      * JustDegs
  * Outputs:
      * D, a list (Macaulay2Doc), degrees of a basis of
        T^1(semigroupRing L)

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

T^1(B) is the tangent space to the versal deformation of the ring B, and is
finite dimensional when B has isolated singularity. If B = S/I is a Cohen
presentation, then T^1(B) = coker Hom(Omega_S, B) -> Hom(I/I^2, B). When B is a
semigroup ring, then Henry Pinkham proved that an open subset of the space of
elements of T1 of negative degree correspond to smoothings of the projective
cone of the semigroup ring to Riemann surfaces

+--------------+
|i1 : def1{2,3}|
|              |
|o1 = {-6, -4} |
|              |
|o1 : List     |
+--------------+

Ways to use def1:
=================

  * "def1(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2111:0.

ewt -- Effective weight of a semigroup (Pflueger)
*************************************************

  * Usage:
        w = ewt L
  * Inputs:
      * L, a list (Macaulay2Doc), generators of a semigroup
  * Outputs:
      * w, an integer (Macaulay2Doc), the effective weight

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

The effective weight of a semigroup S is defined as the number of pairs (a,b)
such that a is a minimal generator of S and b is a gap of S with a<b.

By contrast, the weight, of S (the sum of the ramification
indices of the corresponding Weierstrass point) may be defined as the number of
pairs (a,b) such that a is in S and b is a gap with a<b.

Improving on work of Eisenbud-Harris (who proved that primitive semigroups S
are Weierstrass), and occur in codimension equal to the weight,
of S), Nathan Pflueger introduced the "effective weight" and showed that all
semigroups with genus g and effective weight w<g are Weierstrass, and occur on
a subvariety of M_(g,1) with codimension w.

For example, semigroups generated by two elements are always Weierstrass since
complete intersections are smoothable; they are almost never primitive,

+--------------+
|i1 : L = {6,7}|
|              |
|o1 = {6, 7}   |
|              |
|o1 : List     |
+--------------+
|i2 : genus L  |
|              |
|o2 = 15       |
+--------------+
|i3 : weight L |
|              |
|o3 = 55       |
+--------------+
|i4 : ewt L    |
|              |
|o4 = 20       |
+--------------+

References
==========

Pflueger, Nathan . On nonprimitive Weierstrass points. Algebra Number Theory
12  (2018),  no. 8, 1923–1947.

See also
========

  * weight -- weight of a semigroup
  * genus (Macaulay2Doc)

Ways to use ewt:
================

  * "ewt(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2902:0.

facetRays -- computes the rays spanning the face in which a semigroup lies
**************************************************************************

  * Usage:
        R = facetRays L
  * Inputs:
      * L, a list (Macaulay2Doc), of generators of a semigroup
  * Outputs:
      * R, a matrix (Macaulay2Doc), of integers; the columns are
        the rays of the face on which semigroup L lies

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

Uses the Fourier-Motzkin algorithm to go from the coneEquations,
satisfied by the semigroup to the rays. For example, in
multiplicity 3, the cone has two rays, occupied by the semigroups
semigroup{3,4} and semigroup{3,5}, with semigroup{3,4,5} in the interior. The
rays are given in reduced form (a vector of positive integers with gcd 1), and
appear as the columns of the output matrix.

+-----------------------+
|i1 : aperySet{3,4}     |
|                       |
|o1 = {4, 8}            |
|                       |
|o1 : List              |
+-----------------------+
|i2 : facetRays{3,4}    |
|                       |
|o2 = | 1 |             |
|     | 2 |             |
|                       |
|              2       1|
|o2 : Matrix ZZ  <-- ZZ |
+-----------------------+
|i3 : facetRays{3,5}    |
|                       |
|o3 = | 2 |             |
|     | 1 |             |
|                       |
|              2       1|
|o3 : Matrix ZZ  <-- ZZ |
+-----------------------+
|i4 : facetRays{3,4,5}  |
|                       |
|o4 = | 1 2 |           |
|     | 2 1 |           |
|                       |
|              2       2|
|o4 : Matrix ZZ  <-- ZZ |
+-----------------------+

On the face with the buchweitz, example there are two facet
rays:

+------------------------------+
|i5 : F = facetRays buchweitz 0|
|                              |
|o5 = | 1  1 |                 |
|     | 2  1 |                 |
|     | 3  1 |                 |
|     | 4  1 |                 |
|     | 5  1 |                 |
|     | 6  2 |                 |
|     | 7  1 |                 |
|     | 8  2 |                 |
|     | 9  1 |                 |
|     | 10 1 |                 |
|     | 11 2 |                 |
|     | 12 2 |                 |
|                              |
|              12       2      |
|o5 : Matrix ZZ   <-- ZZ       |
+------------------------------+

The second column is mu buchweitz 0, the mu vector of the Buchweitz example.
Adding multiples of it to the Weierstrass semigroups ordinary point of genus
12, we eventually reach a semigroup that fails the Buchweitz test to be a
Weierstrass semigroup:

+----------------------------------------------------------------+
|i6 : b = {0}|flatten entries F_{1}                              |
|                                                                |
|o6 = {0, 1, 1, 1, 1, 1, 2, 1, 2, 1, 1, 2, 2}                    |
|                                                                |
|o6 : List                                                       |
+----------------------------------------------------------------+
|i7 : L = toList (13..25)                                        |
|                                                                |
|o7 = {13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25}       |
|                                                                |
|o7 : List                                                       |
+----------------------------------------------------------------+
|i8 : for i from 0 to 15 list (                                  |
|         L' = L+i*13*b;                                         |
|         G = gaps L';                                           |
|         #sums(G, G) - 3*(genus L' -1)                          |
|         )                                                      |
|                                                                |
|o8 = {-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5}|
|                                                                |
|o8 : List                                                       |
+----------------------------------------------------------------+

We conjecture that the same phenomen  for any semigroup L0 of multiplicity 13
in place of L. Here is a "random" example:

+-----------------------------------------------------------------------------+
|i9 : setRandomSeed 0                                                         |
| -- setting random seed to 0                                                 |
|                                                                             |
|o9 = 0                                                                       |
+-----------------------------------------------------------------------------+
|i10 : L0 = {13}|aperySet ({13}|apply(1 + random 10, i->13+random 10))        |
|                                                                             |
|o10 = {13, 14, 28, 16, 30, 44, 32, 20, 21, 35, 36, 37, 51}                   |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+
|i11 : for i from 0 to 20 list (                                              |
|         L' = L0+i*13*b;                                                     |
|         G = gaps L';                                                        |
|         #sums(G, G) - 3*(genus L' -1)                                       |
|         )                                                                   |
|                                                                             |
|o11 = {-3, -8, -10, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4,  |
|      -----------------------------------------------------------------------|
|      5, 6, 7}                                                               |
|                                                                             |
|o11 : List                                                                   |
+-----------------------------------------------------------------------------+

See also
========

  * aperySet -- Compute the apery set of a numerical semigroup
  * coneEquations -- Find the equations of the Kunz cones
  * coneRays -- All the rays of the (homogeneous) Kunz cone

Ways to use facetRays:
======================

  * "facetRays(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2203:0.

findPoint -- Find a kk-rational point in a variety
**************************************************

  * Usage:
        point=findPoint c
  * Inputs:
      * I, an ideal (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Verbose => ..., default value false
  * Outputs:
      * B, a matrix (Macaulay2Doc), coordinates of a point in the
        finite ground field

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

Given ideal c the functions adds random linear equations L to c to obtain
1-dimensional ideal. Since the ground field is finite, decompose the ideal c+L
will lead to a point with positive probability. Thus repeating will lead to
success.

+-----------------------------------------------------------------------------+
|i1 : kk=ZZ/101                                                               |
|                                                                             |
|o1 = kk                                                                      |
|                                                                             |
|o1 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i2 : R=kk[x_0..x_6]                                                          |
|                                                                             |
|o2 = R                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : c=ideal random(R^1,R^{2:-1,2:-2})                                       |
|                                                                             |
|                                                                             |
|o3 = ideal (24x  - 30x  + 19x  - 10x  - 8x  - 29x  - 38x , - 36x  - 29x  +   |
|               0      1      2      3     4      5      6       0      1     |
|     ------------------------------------------------------------------------|
|                                          2               2                  |
|     19x  - 29x  - 22x  - 24x  - 16x , 39x  + 34x x  + 16x  - 47x x  + 45x x |
|        2      3      4      5      6     0      0 1      1      0 2      1 2|
|     ------------------------------------------------------------------------|
|          2                                 2                                |
|     + 39x  - 18x x  - 48x x  - 17x x  + 40x  - 43x x  + 47x x  + 48x x  +   |
|          2      0 3      1 3      2 3      3      0 4      1 4      2 4     |
|     ------------------------------------------------------------------------|
|                 2                                                2          |
|     46x x  - 23x  - 28x x  - 16x x  + 35x x  + x x  + 2x x  - 37x  + 38x x  |
|        3 4      4      0 5      1 5      2 5    3 5     4 5      5      0 6 |
|     ------------------------------------------------------------------------|
|                                                       2     2               |
|     + 15x x  - 38x x  + 22x x  - 47x x  - 10x x  - 18x , 21x  + 19x x  +    |
|          1 6      2 6      3 6      4 6      5 6      6     0      0 1      |
|     ------------------------------------------------------------------------|
|        2                        2                                 2         |
|     22x  - 39x x  - 34x x  + 43x  - 13x x  - 47x x  - 11x x  + 11x  - 15x x |
|        1      0 2      1 2      2      0 3      1 3      2 3      3      0 4|
|     ------------------------------------------------------------------------|
|                                    2                                        |
|     + 19x x  + 36x x  - 28x x  - 7x  - 47x x  + 7x x  + 11x x  - 3x x  +    |
|          1 4      2 4      3 4     4      0 5     1 5      2 5     3 5      |
|     ------------------------------------------------------------------------|
|                 2                                                           |
|     29x x  - 13x  + 2x x  - 23x x  + 33x x  - 47x x  + 15x x  + 30x x  +    |
|        4 5      5     0 6      1 6      2 6      3 6      4 6      5 6      |
|     ------------------------------------------------------------------------|
|        2                                                                    |
|     39x )                                                                   |
|        6                                                                    |
|                                                                             |
|o3 : Ideal of R                                                              |
+-----------------------------------------------------------------------------+
|i4 : B=findPoint c                                                           |
|                                                                             |
|o4 = | -43 -32 24 -21 -15 3 -34 |                                            |
|                                                                             |
|             1      7                                                        |
|o4 : Matrix R  <-- R                                                         |
+-----------------------------------------------------------------------------+
|i5 : sub(c,B)==0                                                             |
|                                                                             |
|o5 = true                                                                    |
+-----------------------------------------------------------------------------+

Ways to use findPoint:
======================

  * "findPoint(Ideal)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2473:0.

findSemigroups -- Find all semigroups with a given number of gaps, multiplicity and/or conductor
************************************************************************************************

  * Usage:
        LL = findSemigroups(mult, cond, numgaps)
        LL = findSemigroups(mult, numgaps)
        LL = findSemigroups(numgaps)
  * Inputs:
      * mult, an integer (Macaulay2Doc), multiplicity
      * cond, an integer (Macaulay2Doc), conductor
      * numgaps, an integer (Macaulay2Doc), number of gaps
  * Outputs:
      * LL, a list (Macaulay2Doc), of sequences of generators of
        semigroups with the given invariants

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

If S is the Weierstrass semigroup of a point p on a Riemann surface X -- that
is, the semigroup of pole orders of rational functions at p, then the genus of
X is the number of gaps of S and there is a differential on X vanishing to
order exactly d iff d+1 is a gap.

+--------------------------------------------------------+
|i1 : findSemigroups(5,14,8)                             |
|                                                        |
|o1 = {{5, 7, 11}, {5, 7, 9}, {5, 6, 14}, {5, 9, 11, 12}}|
|                                                        |
|o1 : List                                               |
+--------------------------------------------------------+
|i2 : G = gaps {5,7,9}                                   |
|                                                        |
|o2 = {1, 2, 3, 4, 6, 8, 11, 13}                         |
|                                                        |
|o2 : List                                               |
+--------------------------------------------------------+
|i3 : #G                                                 |
|                                                        |
|o3 = 8                                                  |
+--------------------------------------------------------+

The number of vanishing orders of quadratic differentials on is h^0(2K) =
(4g-4) - g + 1 = 3g-3, so if s is the semigroup of pole orders of a point on X
and G is the set of gaps, then there can be at most 3g-3 distinct sums of pairs
of elements of G. This gives a nontrivial obstruction to the smoothability of
the semigroup ring of S and thus to the existence of a Weierstrass point with
semigroup s.

The following example, discovered by Ragnar Buchweitz (Thesis) was the first
known example of a non-Weierstrass semigroup.

+------------------------------------------------------------+
|i4 : G=toList(1..12)|{19,21,24,25}                          |
|                                                            |
|o4 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 19, 21, 24, 25}|
|                                                            |
|o4 : List                                                   |
+------------------------------------------------------------+

The function isGapSequence, returns generators for the
semigroups with given gap sequence or returns false if there is no such
semigroup

+-----------------------------------------+
|i5 : L=isGapSequence G                   |
|                                         |
|o5 = {13, 14, 15, 16, 17, 18, 20, 22, 23}|
|                                         |
|o5 : List                                |
+-----------------------------------------+
|i6 : g = #G                              |
|                                         |
|o6 = 16                                  |
+-----------------------------------------+
|i7 : 3*g-3                               |
|                                         |
|o7 = 45                                  |
+-----------------------------------------+
|i8 : #sums(G,G)                          |
|                                         |
|o8 = 46                                  |
+-----------------------------------------+

See also
========

  * isGapSequence -- test whether a list of integers can
    be the list of gaps of a semigroup
  * gaps -- The gap sequence of a semigroup

Ways to use findSemigroups:
===========================

  * "findSemigroups(ZZ)"
  * "findSemigroups(ZZ,ZZ)"
  * "findSemigroups(ZZ,ZZ,ZZ)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1897:0.

flatteningRelations -- Compute the flattening relations of an unfolding
***********************************************************************

  * Usage:
        J= flattening(I,A,unfolding)
  * Inputs:
      * I, an ideal (Macaulay2Doc), homogeneous with respect to a
        possibly nonstandard NN-grading
      * A, a ring (Macaulay2Doc), the ring of parameters of the
        unfolding
      * unfolding, a matrix (Macaulay2Doc), an unfolding of gens
        I
  * Outputs:
      * J, an ideal (Macaulay2Doc), of A

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

Given the tuple (I,A,unfolding) the function computes the flattening relations
via the set of Buchberger test syzygies. The procedure terminates since the
parameters of A have positive degree, and the unfolding is homogeneous.

+-----------------------------------------------------------------------------+
|i1 : L={4,6,7}                                                               |
|                                                                             |
|o1 = {4, 6, 7}                                                               |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : I = trim semigroupIdeal L;                                              |
|                                                                             |
|               ZZ                                                            |
|o2 : Ideal of ----[x , x ..x ]                                               |
|              1009  0   2   3                                                |
+-----------------------------------------------------------------------------+
|i3 : (A,unfolding)=makeUnfolding I                                           |
|                                                                             |
|o3 = (A, | x_0^3-x_2^2+a_{0, 0}+x_0a_{0, 1}+x_2a_{0, 2}+x_3a_{0,             |
|     ------------------------------------------------------------------------|
|     3}+x_0^2a_{0, 4}+x_0x_2a_{0, 5}+x_0x_3a_{0, 6} x_0^2x_2-x_3^2+a_{1,     |
|     ------------------------------------------------------------------------|
|     0}+x_0a_{1, 1}+x_2a_{1, 2}+x_3a_{1, 3}+x_0^2a_{1, 4}+x_0x_2a_{1,        |
|     ------------------------------------------------------------------------|
|     5}+x_0x_3a_{1, 6}+x_2^2a_{1, 7}+x_2x_3a_{1, 8} |)                       |
|                                                                             |
|o3 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i4 : S=ring I                                                                |
|                                                                             |
|o4 = S                                                                       |
|                                                                             |
|o4 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i5 : fI=res I                                                                |
|                                                                             |
|      1      2      1                                                        |
|o5 = S  <-- S  <-- S  <-- 0                                                  |
|                                                                             |
|     0      1      2      3                                                  |
|                                                                             |
|o5 : ChainComplex                                                            |
+-----------------------------------------------------------------------------+
|i6 : degs=flatten (gens A/degree)                                            |
|                                                                             |
|o6 = {14, 12, 10, 8, 8, 7, 6, 6, 5, 4, 4, 3, 2, 2, 1, 1}                     |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : n=floor(max degs/2)+3                                                   |
|                                                                             |
|o7 = 10                                                                      |
+-----------------------------------------------------------------------------+
|i8 : restricted=ideal select(gens A, y-> (degree y)_0<n);                    |
|                                                                             |
|o8 : Ideal of A                                                              |
+-----------------------------------------------------------------------------+
|i9 : SA=ring unfolding                                                       |
|                                                                             |
|o9 = SA                                                                      |
|                                                                             |
|o9 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i10 : runfolding=unfolding%sub(restricted,SA);                               |
|                                                                             |
|               1       2                                                     |
|o10 : Matrix SA  <-- SA                                                      |
+-----------------------------------------------------------------------------+
|i11 : transpose runfolding                                                   |
|                                                                             |
|o11 = {-12} | x_0^3-x_2^2+a_{0, 0}                |                          |
|      {-14} | x_0^2x_2-x_3^2+a_{1, 0}+x_0a_{1, 1} |                          |
|                                                                             |
|               2       1                                                     |
|o11 : Matrix SA  <-- SA                                                      |
+-----------------------------------------------------------------------------+
|i12 : J=flatteningRelations(I,A,runfolding);                                 |
|                                                                             |
|o12 : Ideal of A                                                             |
+-----------------------------------------------------------------------------+
|i13 : cJ=decompose J;#cJ                                                     |
|                                                                             |
|o14 = 1                                                                      |
+-----------------------------------------------------------------------------+
|i15 : ideal prune (A/J)                                                      |
|                                                                             |
|o15 = ideal ()                                                               |
|                                                                             |
|                ZZ                                                           |
|o15 : Ideal of ----[a      , a      , a      , a      , a      , a      ,    |
|               1009  {1, 0}   {0, 0}   {1, 1}   {1, 2}   {0, 1}   {1, 3}     |
|-----------------------------------------------------------------------------|
|a      , a      , a      , a      , a      , a      , a      , a      , a    |
| {1, 4}   {0, 2}   {0, 3}   {1, 5}   {0, 4}   {1, 6}   {1, 7}   {0, 5}   {1, |
|-----------------------------------------------------------------------------|
|  , a      ]                                                                 |
|8}   {0, 6}                                                                  |
+-----------------------------------------------------------------------------+
|i16 : family=runfolding%sub(J,SA);                                           |
|                                                                             |
|               1       2                                                     |
|o16 : Matrix SA  <-- SA                                                      |
+-----------------------------------------------------------------------------+
|i17 : betti res ideal family == betti res I                                  |
|                                                                             |
|o17 = true                                                                   |
+-----------------------------------------------------------------------------+

Thus this is a flat family!

+----------------------------------------------------------------------------+
|i18 : fiber=ideal sub(family,vars S|random(S^1,S^(numgens A)));             |
|                                                                            |
|o18 : Ideal of S                                                            |
+----------------------------------------------------------------------------+
|i19 : singFiber=radical ideal gens gb (fiber+minors(codim I,jacobian fiber))|
|                                                                            |
|o19 = ideal 1                                                               |
|                                                                            |
|o19 : Ideal of S                                                            |
+----------------------------------------------------------------------------+

Thus the family is a smoothing of S/I so the semigroup L in the example is a
Weierstrass semigroup by Pinkham's thesis.

See also
========

  * makeUnfolding -- Makes the universal homogeneous
    unfolding of an ideal with positive degree parameters

Ways to use flatteningRelations:
================================

  * "flatteningRelations(Ideal,Ring,Matrix)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2444:0.

fractionalIdeal -- turn a fractional ideal into a proper ideal
**************************************************************

  * Usage:
        I = fractionalIdeal(sgrp,mons)
        L = fractionalIdeal(sgrp,mons)
  * Inputs:
      * sgrp, a list (Macaulay2Doc), of ZZ, representing a
        semigroup
      * mons, a list (Macaulay2Doc), of ZZ representing the degrees
        of generators of a fractional ideal
  * Optional inputs (Macaulay2Doc),:
      * Ideal
  * Outputs:
      * I, an ideal (Macaulay2Doc), ideal in semigroupRing sgrp

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

sgrp is a list of ZZ_{>0}, interpreted as generators of a semigroup; mons is a
list of ZZ interpreted as generating a module in the quotient field of sgrp
with the option "Ideal" => false we get a list of integers belonging to the
semigroup, otherwise a proper ideal of the semigroup ring. of the ring
semigroupRing sgrp. In both cases, the program chooses the generators of least
possible degree.

This is perhaps most useful when regarding a blowup or iterated blowup as a
module over the original ring. For example, the sequence of blowups of the
semigroupRing {5,9} is given by semigroupRing{4,5}, semigroupRing{1}:

+-------------------------------------------------+
|i1 : sgrp = {5,9}                                |
|                                                 |
|o1 = {5, 9}                                      |
|                                                 |
|o1 : List                                        |
+-------------------------------------------------+
|i2 : sgrp1 = {4,5}                               |
|                                                 |
|o2 = {4, 5}                                      |
|                                                 |
|o2 : List                                        |
+-------------------------------------------------+
|i3 : sgrp2 = {1}                                 |
|                                                 |
|o3 = {1}                                         |
|                                                 |
|o3 : List                                        |
+-------------------------------------------------+
|i4 : fractionalIdeal(sgrp, sgrp1, "Ideal"=>false)|
|                                                 |
|o4 = {9, 10, 14, 15, 18, 19}                     |
|                                                 |
|o4 : List                                        |
+-------------------------------------------------+
|i5 : fractionalIdeal(sgrp, sgrp2)                |
|                                                 |
|o5 = ideal 1                                     |
|                                                 |
|               ZZ                                |
|              ---[x , x ]                        |
|              101  0   4                         |
|o5 : Ideal of -----------                        |
|                 9    5                          |
|                x  - x                           |
|                 0    4                          |
+-------------------------------------------------+

See also
========

  * semigroupRing -- forms the semigroup ring over
    "BaseField"

Ways to use fractionalIdeal:
============================

  * "fractionalIdeal(List,List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:3118:0.

gaps -- The gap sequence of a semigroup
***************************************

  * Usage:
        G = gaps L
  * Inputs:
      * L, a list (Macaulay2Doc), of semigroup generators
  * Outputs:
      * G, a list (Macaulay2Doc), the gap sequence

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

If semigroup L is the Weierstrass semigroup of a Riemann surface C at a point,
then #gaps L = g = h^0(omega_C), the genus of C. Furthermore, the number of
elements of sums(n, G) is bounded by the dimension of h^0(omega_C^n) =
n*(2g-2)-g+1 = (2n-1)g-2n+1. However, for an arbitrary semigroup the number
#sums(n,G) may be larger; the first such example was found by Ragnar Buchweitz,
and is given below.

The function isGapSequence returns either false or generators of the semigroup
of which the sequence is the gap sequence.

+------------------------------------------------------------+
|i1 : G=toList(1..12)|{19,21,24,25}                          |
|                                                            |
|o1 = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 19, 21, 24, 25}|
|                                                            |
|o1 : List                                                   |
+------------------------------------------------------------+
|i2 : g = #G                                                 |
|                                                            |
|o2 = 16                                                     |
+------------------------------------------------------------+
|i3 : for n from 1 to 3 list (#sums(n,G),n*(2*g-2) - g + 1)  |
|                                                            |
|o3 = {(16, 15), (46, 45), (73, 75)}                         |
|                                                            |
|o3 : List                                                   |
+------------------------------------------------------------+
|i4 : L=isGapSequence G                                      |
|                                                            |
|o4 = {13, 14, 15, 16, 17, 18, 20, 22, 23}                   |
|                                                            |
|o4 : List                                                   |
+------------------------------------------------------------+
|i5 : G ==gaps L                                             |
|                                                            |
|o5 = true                                                   |
+------------------------------------------------------------+

Caveat
======

See also
========

  * isGapSequence -- test whether a list of integers can
    be the list of gaps of a semigroup
  * findSemigroups -- Find all semigroups with a given
    number of gaps, multiplicity and/or conductor

Ways to use gaps:
=================

  * "gaps(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2046:0.

genus(List) -- Compute the number of gaps (genus) of a semigroup
****************************************************************

  * Function: genus (Macaulay2Doc),
  * Usage:
        g = genus L
  * Inputs:
      * L, a list (Macaulay2Doc),
  * Outputs:
      * g, an integer (Macaulay2Doc),

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

The gaps S is the list of the finitely many positive integers not in S

+-----------------------------------------------------+
|i1 : genus {4,7}                                     |
|                                                     |
|o1 = 9                                               |
+-----------------------------------------------------+
|i2 : G = gaps {4,7}                                  |
|                                                     |
|o2 = {1, 2, 3, 5, 6, 9, 10, 13, 17}                  |
|                                                     |
|o2 : List                                            |
+-----------------------------------------------------+
|i3 : #G                                              |
|                                                     |
|o3 = 9                                               |
+-----------------------------------------------------+
|i4 : S = semigroup{4,7}                              |
|                                                     |
|o4 = {0, 4, 7, 8, 11, 12, 14, 15, 16, 18, 19, 20, 21}|
|                                                     |
|o4 : List                                            |
+-----------------------------------------------------+
|i5 : set G + set S  == set(0..21)                    |
|                                                     |
|o5 = true                                            |
+-----------------------------------------------------+

See also
========

  * gaps -- The gap sequence of a semigroup
  * semigroup -- Compute the semigroup generated by a list of
    positive integers

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

  * genus(List) -- Compute the number of gaps (genus)
    of a semigroup
-------------------------------------------------------------------------------

The source of this document is in NumericalSemigroups.m2:1802:0.

getFlatFamily -- Compute the flat family depending on a subset of parameters of the universal unfolding
*******************************************************************************************************

  * Usage:
        (I,J1,family)=getFlatFamily(L,RR,ZZ)
  * Inputs:
      * L, a list (Macaulay2Doc), the generators of a semigroup
      * r, a real number (Macaulay2Doc),
      * n, an integer (Macaulay2Doc), numbers which influences the
        truncation
  * Optional inputs (Macaulay2Doc),:
      * BaseField
      * Verbose => ..., default value false
  * Outputs:
      * I, an ideal (Macaulay2Doc), semigroup ideal
      * J1, an ideal (Macaulay2Doc), flatness relations among the
        parameters
      * family, a matrix (Macaulay2Doc), defining equation of the
        family

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

After computing an unfolding and restricting the unfolding to variables of
degree larger than

(maximal degree of a parameter)*r+n,

we compute the flattening relations and remove dependent variables. The
remaining flattening relation are returned in the ideal J1. Using the function
isARandomFiberSmooth we then can check with good luck whether a random fiber
over some component of J1 is smooth.

+-----------------------------------------------------------------------------+
|i1 : L={6,8,10,11}                                                           |
|                                                                             |
|o1 = {6, 8, 10, 11}                                                          |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : genus L                                                                 |
|                                                                             |
|o2 = 9                                                                       |
+-----------------------------------------------------------------------------+
|i3 : (I,J1,family)=getFlatFamily(L,0.30,0);                                  |
+-----------------------------------------------------------------------------+
|i4 : betti res ideal family == betti res I                                   |
|                                                                             |
|o4 = true                                                                    |
+-----------------------------------------------------------------------------+
|i5 : isARandomFiberSmooth(I,J1,family)                                       |
|                                                                             |
|o5 = true                                                                    |
+-----------------------------------------------------------------------------+
|i6 : support family                                                          |
|                                                                             |
|o6 = {x , x , x , x , a      , a      , a      , a      , a      , a      ,  |
|       0   2   4   5   {3, 0}   {3, 1}   {3, 2}   {3, 3}   {1, 1}   {3, 4}   |
|     ------------------------------------------------------------------------|
|     a      , a      , a      , a      , a      , a      }                   |
|      {3, 5}   {1, 2}   {0, 1}   {3, 6}   {1, 3}   {0, 2}                    |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : support family /degree                                                  |
|                                                                             |
|o7 = {{6}, {8}, {10}, {11}, {22}, {16}, {14}, {12}, {12}, {11}, {10}, {10},  |
|     ------------------------------------------------------------------------|
|     {10}, {8}, {8}, {8}}                                                    |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : gens ring J1 /degree                                                    |
|                                                                             |
|o8 = {{22}, {20}, {18}, {16}, {16}, {14}, {14}, {12}, {12}, {12}, {11}, {10},|
|     ------------------------------------------------------------------------|
|     {10}, {10}, {10}, {9}, {8}, {8}, {8}, {8}, {7}, {6}, {6}, {6}, {6}, {5},|
|     ------------------------------------------------------------------------|
|     {5}, {4}, {4}, {4}, {4}, {3}, {3}, {2}, {2}, {2}, {2}, {1}, {1}, {1}}   |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+

Parameters of the universal unfolding of degree <= 22*0.3 are not used

+-------------------------------------------------------------------+
|i9 : (I,J1,family)=getFlatFamily(L,0.00,11);                       |
+-------------------------------------------------------------------+
|i10 : support family                                               |
|                                                                   |
|o10 = {x , x , x , x , a      , a      , a      , a      , a      }|
|        0   2   4   5   {3, 0}   {3, 1}   {3, 2}   {3, 3}   {1, 1} |
|                                                                   |
|o10 : List                                                         |
+-------------------------------------------------------------------+
|i11 : support family /degree                                       |
|                                                                   |
|o11 = {{6}, {8}, {10}, {11}, {22}, {16}, {14}, {12}, {12}}         |
|                                                                   |
|o11 : List                                                         |
+-------------------------------------------------------------------+

Parameters of the universal unfolding of degree < 11) are not used

+---------------------------------------------------------------------------+
|i12 : isARandomFiberSmooth(I,J1,family)                                    |
|                                                                           |
|o12 = true                                                                 |
+---------------------------------------------------------------------------+
|i13 : A = ring family                                                      |
|                                                                           |
|o13 = A                                                                    |
|                                                                           |
|o13 : PolynomialRing                                                       |
+---------------------------------------------------------------------------+
|i14 : transpose family                                                     |
|                                                                           |
|o14 = {-16} | x_2^2-x_0x_4                                                ||
|      {-18} | x_0^3-x_2x_4+x_0a_{1, 1}                                    ||
|      {-20} | x_0^2x_2-x_4^2+x_2a_{1, 1}                                  ||
|      {-22} | x_0^2x_4-x_5^2+a_{3, 0}+x_0a_{3, 1}+x_2a_{3, 2}+x_4a_{3, 3} ||
|                                                                           |
|              4      1                                                     |
|o14 : Matrix A  <-- A                                                      |
+---------------------------------------------------------------------------+

See also
========

  * makeUnfolding -- Makes the universal homogeneous
    unfolding of an ideal with positive degree parameters
  * flatteningRelations -- Compute the flattening
    relations of an unfolding
  * getFlatFamily -- Compute the flat family depending on
    a subset of parameters of the universal unfolding
  * isARandomFiberSmooth -- Test whether a random
    fiber is smooth

Ways to use getFlatFamily:
==========================

  * "getFlatFamily(List,RR,ZZ)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2674:0.

heuristicSmoothness -- Check whether an affine curve is smooth
**************************************************************

  * Usage:
        b=heuristicSmoothness c
  * Inputs:
      * c, an ideal (Macaulay2Doc), of an affine curve
  * Optional inputs (Macaulay2Doc),:
      * BaseField
      * Verbose => ..., default value false
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true if the
        computation showes that c is smooth false otherwise

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

We  check for smoothness using only some of the minors of the jacobian matrix.
If we are lucky this establishes smoothness. With bad luck we might fail even
in case when c is smooth.

+-----------------------------------------------------------------------------+
|i1 : kk=ZZ/2; S=kk[x_0..x_3]                                                 |
|                                                                             |
|o2 = S                                                                       |
|                                                                             |
|o2 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i3 : setRandomSeed "some singular and some smooth curves";                   |
| -- setting random seed to 16448145344044912743134112851860419880995675639057|
|-----------------------------------------------------------------------------|
|80374824086062516559438                                                      |
+-----------------------------------------------------------------------------+
|i4 : elapsedTime tally apply(10,i-> (                                        |
|             c=minors(2,random(S^2,S^{3:-2}));                               |
|             c=sub(c,x_0=>1);                                                |
|             R=kk[support c];c=sub(c,R);                                     |
|             heuristicSmoothness c))                                         |
| -- 5.25241s elapsed                                                         |
|                                                                             |
|o4 = Tally{false => 6}                                                       |
|           true => 4                                                         |
|                                                                             |
|o4 : Tally                                                                   |
+-----------------------------------------------------------------------------+

Ways to use heuristicSmoothness:
================================

  * "heuristicSmoothness(Ideal)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2744:0.

isARandomFiberSmooth -- Test whether a random fiber is smooth
*************************************************************

  * Usage:
        b=isARandomFiberSmooth(I,J1,family)
  * Inputs:
      * I, an ideal (Macaulay2Doc), semigroup ideal
      * J1, an ideal (Macaulay2Doc), flatness relations among the
        parameters
      * family, a matrix (Macaulay2Doc), a flat family
  * Optional inputs (Macaulay2Doc),:
      * BaseField
      * Verbose => ..., default value false
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true if a random
        fiber is smooth, false otherwise

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

We check whether a random fiber over a random closed point of each component of
J1 is smooth. If we find a smooth fiber we return true, else we return false.

+-----------------------------------------------------------------------------+
|i1 : L={6,8,10,11}                                                           |
|                                                                             |
|o1 = {6, 8, 10, 11}                                                          |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : genus L                                                                 |
|                                                                             |
|o2 = 9                                                                       |
+-----------------------------------------------------------------------------+
|i3 : (I,J1,family)=getFlatFamily(L,0.30,0);                                  |
+-----------------------------------------------------------------------------+
|i4 : isARandomFiberSmooth(I,J1,family)                                       |
|                                                                             |
|o4 = true                                                                    |
+-----------------------------------------------------------------------------+
|i5 : SA=ring family                                                          |
|                                                                             |
|o5 = SA                                                                      |
|                                                                             |
|o5 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i6 : transpose family                                                        |
|                                                                             |
|o6 = {-16} | x_2^2-x_0x_4+x_0a_{0, 1}-a_{1, 3}^2+x_2a_{0, 2}-a_{1, 3}a_{0, 2}|
|     {-18} | x_0^3-x_2x_4+x_0a_{1, 1}+x_2a_{1, 2}+x_4a_{1, 3}-a_{1, 2}a_{1, 3|
|     {-20} | x_0^2x_2-x_4^2+x_2a_{1, 1}+x_4a_{1, 2}+x_4a_{0, 1}-a_{1, 2}a_{0,|
|     {-22} | x_0^2x_4-x_5^2+a_{3, 0}+x_0a_{3, 1}+x_2a_{3, 2}+x_4a_{3, 3}+x_5a|
|     ------------------------------------------------------------------------|
|                                                                       |     |
|     }                                                                 |     |
|      1}+x_0^2a_{1, 3}+a_{1, 1}a_{1, 3}+x_0^2a_{0, 2}+a_{1, 1}a_{0, 2} |     |
|     _{3, 4}+x_0^2a_{3, 5}+x_0x_2a_{3, 6}                              |     |
|                                                                             |
|              4       1                                                      |
|o6 : Matrix SA  <-- SA                                                       |
+-----------------------------------------------------------------------------+

See also
========

  * makeUnfolding -- Makes the universal homogeneous
    unfolding of an ideal with positive degree parameters
  * flatteningRelations -- Compute the flattening
    relations of an unfolding
  * getFlatFamily -- Compute the flat family depending on
    a subset of parameters of the universal unfolding

Ways to use isARandomFiberSmooth:
=================================

  * "isARandomFiberSmooth(Ideal,Ideal,Matrix)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2711:0.

isGapSequence -- test whether a list of integers can be the list of gaps of a semigroup
***************************************************************************************

  * Usage:
        L = isGapSequence G
  * Inputs:
      * G, a list (Macaulay2Doc),
  * Outputs:
      * L, a Boolean value (Macaulay2Doc),
      * L, a list (Macaulay2Doc),

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

The function isGapSequence returns either false or a list of generators of the
semigroup of which the sequence is the gap sequence. Note that the gap sequence
of a semigroup of multiplicity m begins with 1..m-1, and ends with the
Frobenius number c-1, where c is the conductor.

+-------------------------------+
|i1 : G = {1,2,3,4,6,9,11,14}   |
|                               |
|o1 = {1, 2, 3, 4, 6, 9, 11, 14}|
|                               |
|o1 : List                      |
+-------------------------------+
|i2 : isGapSequence G           |
|                               |
|o2 = false                     |
+-------------------------------+
|i3 : G = {1,2,3,4,6,9,11}      |
|                               |
|o3 = {1, 2, 3, 4, 6, 9, 11}    |
|                               |
|o3 : List                      |
+-------------------------------+
|i4 : S = isGapSequence G       |
|                               |
|o4 = {5, 7, 8}                 |
|                               |
|o4 : List                      |
+-------------------------------+
|i5 : G == gaps S               |
|                               |
|o5 = true                      |
+-------------------------------+

See also
========

  * gaps -- The gap sequence of a semigroup

Ways to use isGapSequence:
==========================

  * "isGapSequence(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2857:0.

isSmoothableSemigroup -- Look for a smoothing family
****************************************************

  * Usage:
        b=isSmoothableSemigroup(L,r,n)
  * Inputs:
      * L, a list (Macaulay2Doc), the generators of a semigroup
      * r, a real number (Macaulay2Doc),
      * n, an integer (Macaulay2Doc), numbers which influences the
        truncation
  * Optional inputs (Macaulay2Doc),:
      * BaseField
      * Verbose => ..., default value false
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true if a smoothing
        family was found, false no smoothing family was found

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

After computing an unfolding and restricting the unfolding to variables of
degree larger than

(maximal degree of a parameter)*r+n,

we compute the flattening relations J of the restricted unfolding. If J defines
a union of components X, we check whether the fiber over a random closed point
of each X is smooth. If we find a smooth fiber we return true, else we return
false.

+------------------------------------------------+
|i1 : L={6,8,9,11}                               |
|                                                |
|o1 = {6, 8, 9, 11}                              |
|                                                |
|o1 : List                                       |
+------------------------------------------------+
|i2 : genus L                                    |
|                                                |
|o2 = 8                                          |
+------------------------------------------------+
|i3 : elapsedTime isSmoothableSemigroup(L,0.30,0)|
| -- 1.46927s elapsed                            |
|                                                |
|o3 = false                                      |
+------------------------------------------------+
|i4 : elapsedTime isSmoothableSemigroup(L,0.14,0)|
| -- 7.6188s elapsed                             |
|                                                |
|o4 = true                                       |
+------------------------------------------------+

See also
========

  * makeUnfolding -- Makes the universal homogeneous
    unfolding of an ideal with positive degree parameters
  * flatteningRelations -- Compute the flattening
    relations of an unfolding
  * getFlatFamily -- Compute the flat family depending on
    a subset of parameters of the universal unfolding
  * isARandomFiberSmooth -- Test whether a random
    fiber is smooth

Ways to use isSmoothableSemigroup:
==================================

  * "isSmoothableSemigroup(List,RR,ZZ)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2516:0.

isSymmetric -- test whether the semigroup generated by L is symmetric
*********************************************************************

  * Usage:
        t = isSymmetric L
  * Inputs:
      * L, a list (Macaulay2Doc),
  * Outputs:
      * t, a Boolean value (Macaulay2Doc),

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

Suppose that c = conductor S, so that c-1 is the last gap. If x in S, and x<c
then c-1-x must be a gap, so the number g of gaps <c is at least the number of
semigroup elements e < c. The semigroup is called \emph{symmetric} if g = e, or
equivalently if the semigroup ring is Gorenstein. Thus for example any
semigroup generated by just 2 elements is symmetric.

+-----------------------+
|i1 : isSymmetric{3,4,5}|
|                       |
|o1 = false             |
+-----------------------+
|i2 : isSymmetric{3, 5} |
|                       |
|o2 = true              |
+-----------------------+
|i3 : gaps {3,5}        |
|                       |
|o3 = {1, 2, 4, 7}      |
|                       |
|o3 : List              |
+-----------------------+
|i4 : mu {3,5}          |
|                       |
|o4 = {3, 1}            |
|                       |
|o4 : List              |
+-----------------------+

See also
========

  * apery -- Compute the apery set, multiplicity and conductor
  * semigroup -- Compute the semigroup generated by a list of
    positive integers
  * gaps -- The gap sequence of a semigroup
  * mu -- Compute the point representing a semigroup in the Kunz
    cone

Ways to use isSymmetric:
========================

  * "isSymmetric(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1743:0.

isWeierstrassSemigroup -- Experimentally decide whether L is a Weierstrass semigroup
************************************************************************************

  * Usage:
        b=isWeierstrassSemgroup(L,r)
  * Inputs:
      * L, a list (Macaulay2Doc), the generators of a semigroup
      * r, a real number (Macaulay2Doc), numbers which influences the
        truncation
  * Optional inputs (Macaulay2Doc),:
      * BaseField
      * Verbose => ..., default value false
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true if a smoothing
        family was found, false no smoothing family was found

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

After computing an unfolding we successivly restricting the unfolding to
variables of degree larger  an integer n  for an n with

n<=(maximal degree of a parameter)*r,

compute the flattening relations J of the restricted unfolding. If J defines a
union of components X, we check whether the fiber over a random closed point of
each X is smooth. If we find a smooth fiber we return true, else we continue
with n-1 until we checked the full unfolding.

+-----------------------------------------------+
|i1 : L={6,8,9,11}                              |
|                                               |
|o1 = {6, 8, 9, 11}                             |
|                                               |
|o1 : List                                      |
+-----------------------------------------------+
|i2 : genus L                                   |
|                                               |
|o2 = 8                                         |
+-----------------------------------------------+
|i3 : elapsedTime isWeierstrassSemigroup(L,0.15)|
| -- 5.95294s elapsed                           |
|                                               |
|o3 = true                                      |
+-----------------------------------------------+

See also
========

  * makeUnfolding -- Makes the universal homogeneous
    unfolding of an ideal with positive degree parameters
  * flatteningRelations -- Compute the flattening
    relations of an unfolding
  * getFlatFamily -- Compute the flat family depending on
    a subset of parameters of the universal unfolding
  * isARandomFiberSmooth -- Test whether a random
    fiber is smooth

Ways to use isWeierstrassSemigroup:
===================================

  * "isWeierstrassSemigroup(List,RR)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2558:0.

knownExample -- Is L a known Weierstrass semigroup?
***************************************************

  * Usage:
        b = knownExample L
  * Inputs:
      * g, an integer (Macaulay2Doc), genus
  * Outputs:
      * b, a Boolean value (Macaulay2Doc), true if L is a known
        example of a Weierstrass semigroup

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

Certain semigroups are known to be Weierstrass. For example L has 2  or 3
generators only, by work of Pinkham and Sally. Another sort examples are
semigroup with small weight ewt(L) < genus L by the work Nathan Pflueger
extending work of Eisenbud-Harris.

+-----------------------------------------------------------------------------+
|i1 : L={7,12,13}                                                             |
|                                                                             |
|o1 = {7, 12, 13}                                                             |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : knownExample L                                                          |
|                                                                             |
|o2 = true                                                                    |
+-----------------------------------------------------------------------------+
|i3 : L={7,8,9,11,13}                                                         |
|                                                                             |
|o3 = {7, 8, 9, 11, 13}                                                       |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : ewt L, genus L                                                          |
|                                                                             |
|o4 = (7, 8)                                                                  |
|                                                                             |
|o4 : Sequence                                                                |
+-----------------------------------------------------------------------------+
|i5 : knownExample L                                                          |
|                                                                             |
|o5 = true                                                                    |
+-----------------------------------------------------------------------------+
|i6 : LL=findSemigroups(9,10);#LL                                             |
|                                                                             |
|o7 = 29                                                                      |
+-----------------------------------------------------------------------------+
|i8 : select(LL,L->not knownExample L)                                        |
|                                                                             |
|o8 = {{9, 10, 11, 12, 13, 16, 17}, {9, 10, 11, 12, 14, 15, 17}, {9, 10, 11,  |
|     ------------------------------------------------------------------------|
|     12, 13, 15, 17}, {9, 10, 11, 12, 13, 14, 17}, {9, 10, 11, 12, 13, 14,   |
|     ------------------------------------------------------------------------|
|     15}, {9, 10, 11, 13, 14, 15, 16}, {9, 10, 11, 12, 14, 15, 16}, {9, 10,  |
|     ------------------------------------------------------------------------|
|     11, 12, 13, 15, 16}, {9, 10, 11, 12, 13, 14, 16}}                       |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : #oo                                                                     |
|                                                                             |
|o9 = 9                                                                       |
+-----------------------------------------------------------------------------+

See also
========

  * LabBookProtocol -- Weierstrass Semigroups in Low
    genus
  * findSemigroups -- Find all semigroups with a given
    number of gaps, multiplicity and/or conductor

Ways to use knownExample:
=========================

  * "knownExample(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1595:0.

kunzMatrix -- determine the set of facet equations satisfied by a semigroup
***************************************************************************

  * Usage:
        M = kunzMatrix L
        M = kunzMatrix H
  * Inputs:
      * L, a list (Macaulay2Doc),
      * H, a hash table (Macaulay2Doc), such as produced by
        apery
  * Outputs:
      * M, a matrix (Macaulay2Doc), of 0s and 1s

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

The equations defining the facets of the homogeneous Kunz cone P_m^* are
E_(i,j): a_i+a_j = a_(i+j mod m) for those (i,j) such that  i+j != 0 mod m.

Given a list L generating the semigroups s with Apery set a = {a_1..a_i}, M =
kunzMatrix L has a 1 in the (i,j) position if and only if a satisfies equation
E_(i,j). Thus M = kunzMatrix L is a symmetric matrix of 0s and 1s that
determines the face of the kunz cone P on which it lies.

+-----------------------+
|i1 : L = {4,7}         |
|                       |
|o1 = {4, 7}            |
|                       |
|o1 : List              |
+-----------------------+
|i2 : aperySet L        |
|                       |
|o2 = {21, 14, 7}       |
|                       |
|o2 : List              |
+-----------------------+
|i3 : kunzMatrix L      |
|                       |
|o3 = | 0 0 0 |         |
|     | 0 0 1 |         |
|     | 0 1 1 |         |
|                       |
|              3       3|
|o3 : Matrix ZZ  <-- ZZ |
+-----------------------+

See also
========

  * aperySet -- Compute the apery set of a numerical semigroup

Ways to use kunzMatrix:
=======================

  * "kunzMatrix(HashTable)"
  * "kunzMatrix(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1838:0.

kunzRing -- artinian reduction of a semigroup ring
**************************************************

  * Usage:
        R = kunzRing L
  * Inputs:
      * L, a list (Macaulay2Doc), of ZZ
  * Outputs:
      * R, a ring (Macaulay2Doc), semigroup ring mod multiplicity
        element

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

returns the semigroup ring modulo the element of least degree. The kunzRing
shares many properties with the semigroup ring.

+------------------------+
|i1 : semigroupRing {3,5}|
|                        |
|      ZZ                |
|     ---[x , x ]        |
|     101  0   2         |
|o1 = -----------        |
|        5    3          |
|       x  - x           |
|        0    2          |
|                        |
|o1 : QuotientRing       |
+------------------------+
|i2 : kunzRing {3,5}     |
|                        |
|      ZZ                |
|     ---[x ]            |
|     101  2             |
|o2 = -------            |
|         3              |
|        x               |
|         2              |
|                        |
|o2 : QuotientRing       |
+------------------------+

The Kunz ring is an invariant of the face of the Kunz cone which contains L.
For all L in the interior of the corresponding face have isomorphic Kunz rings.

+--------------------------------------------+
|i3 : L=semigroup {4,6,7}                    |
|                                            |
|o3 = {0, 4, 6, 7, 8, 10, 11, 12, 13}        |
|                                            |
|o3 : List                                   |
+--------------------------------------------+
|i4 : (H,M)=allSemigroups {4,6,7}            |
|                                            |
|o4 = (| 4  0 4 |, | 13 6  7 |)              |
|      | 8  4 4 |  | 17 10 7 |               |
|      | 12 8 4 |  | 21 14 7 |               |
|                                            |
|o4 : Sequence                               |
+--------------------------------------------+
|i5 : L1={4}|flatten (entries(M^{2}+3*H^{1}))|
|                                            |
|o5 = {4, 45, 26, 19}                        |
|                                            |
|o5 : List                                   |
+--------------------------------------------+
|i6 : #gaps L1, socle L1                     |
|                                            |
|o6 = (21, {45})                             |
|                                            |
|o6 : Sequence                               |
+--------------------------------------------+
|i7 : kunzRing {4,6,7}                       |
|                                            |
|      ZZ                                    |
|     ---[x ..x ]                            |
|     101  2   3                             |
|o7 = -----------                            |
|         2   2                              |
|       (x , x )                             |
|         2   3                              |
|                                            |
|o7 : QuotientRing                           |
+--------------------------------------------+
|i8 : kunzRing L1                            |
|                                            |
|      ZZ                                    |
|     ---[x , x ]                            |
|     101  3   2                             |
|o8 = -----------                            |
|         2   2                              |
|       (x , x )                             |
|         3   2                              |
|                                            |
|o8 : QuotientRing                           |
+--------------------------------------------+

Ways to use kunzRing:
=====================

  * "kunzRing(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:3078:0.

LabBookProtocol -- Weierstrass Semigroups in Low genus
******************************************************

  * Usage:
        s = LabBookProtocol g
  * Inputs:
      * g, an integer (Macaulay2Doc), genus
  * Outputs:
      * s, a string (Macaulay2Doc), commands to study semigroups
        of genus g

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

This function prints a series of commands that check that most semigroups of
genus g (up to g = 10) are Weierstrass. It outputs a short list of "difficult"
examples that currently take too long to check.

+-----------------------------------------------------------------------------+
|i1 : LabBookProtocol 7                                                       |
|                                                                             |
|    LL7=findSemigroups 7;#LL7                                                |
|    LL7a=select(LL7,L->not knownExample L);#LL7a                             |
|    elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0))     |
|    LL7b=={} -- => every genus 7 semigroup is Weierstrass                    |
|                                                                             |
+-----------------------------------------------------------------------------+
|i2 : LL7=findSemigroups 7;#LL7                                               |
|                                                                             |
|o3 = 39                                                                      |
+-----------------------------------------------------------------------------+
|i4 : LL7a=select(LL7,L->not knownExample L);#LL7a                            |
|                                                                             |
|o5 = 2                                                                       |
+-----------------------------------------------------------------------------+
|i6 : elapsedTime LL7b=select(LL7a,L->not                                     |
|unfolding                                                                    |
| -- .275754s elapsed                                                         |
|flatteningRelations                                                          |
| -- .23103s elapsed                                                          |
|next gb                                                                      |
| -- .000869484s elapsed                                                      |
|true                                                                         |
|unfolding                                                                    |
| -- .201603s elapsed                                                         |
|flatteningRelations                                                          |
| -- .126961s elapsed                                                         |
|next gb                                                                      |
| -- .00061726s elapsed                                                       |
|true                                                                         |
| -- 2.48626s elapsed                                                         |
|                                                                             |
|o6 = {}                                                                      |
|                                                                             |
|o6 : List                                                                    |
|-----------------------------------------------------------------------------|
|isSmoothableSemigroup(L,0.25,0,Verbose=>true))                               |
+-----------------------------------------------------------------------------+
|i7 : elapsedTime LL7b=select(LL7a,L->not isSmoothableSemigroup(L,0.25,0))    |
| -- 2.20039s elapsed                                                         |
|                                                                             |
|o7 = {}                                                                      |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : LL7b=={}                                                                |
|                                                                             |
|o8 = true                                                                    |
+-----------------------------------------------------------------------------+

With the option Verbose=>true one gets timings on various parts of the
computation. To check all semigroups of genus g=8,9 and 10 takes about

18.2, 161.1 and 945.6 seconds respectively.

+-----------------------------------------------------------------------------+
|i9 : LabBookProtocol 11                                                      |
|                                                                             |
|    LL11=findSemigroups 11;#LL11                                             |
|    LL11a=select(LL11,L->not knownExample L);#LL11a                          |
|    last LL11a, last LL11 -- shows that all examples of genus 11 not covered |
|                                                                             |
|    elapsedTime nonWeierstrassSemigroups(5,11) -- 117.422 seconds elapsed -  |
|    LLdifficult={{6, 8, 17, 19, 21},{6, 8, 10, 19, 21, 23},{6, 9, 11, 14}}   |
|    elapsedTime nonWeierstrassSemigroups(6,11,LLdifficult,Verbose=>true)   --|
|    --(6, 11,  all but difficult semigroups are smoothable)                  |
|    elapsedTime LL611=select(LLdifficult,L->(<<L<<endl<<flush;elapsedTime not|
|                                                                             |
|    elapsedTime nonWeierstrassSemigroups(7,11, LLdifficult, Verbose => true) |
|    LLdifficult={{8, 9, 11, 15, 21}}                                         |
|    elapsedTime nonWeierstrassSemigroups(8,11, LLdifficult, Verbose => true) |
|    LLdifficult={}                                                           |
|    elapsedTime nonWeierstrassSemigroups(9,11, LLdifficult, Verbose => true) |
|    LLdifficult={}                                                           |
|    elapsedTime nonWeierstrassSemigroups(10,11, LLdifficult, Verbose => true)|
|                                                                             |
|-----------------------------------------------------------------------------|
|by Plueger have multiplicity <= 10.                                          |
|                                                                             |
|                                                                             |
|                                                                             |
| 267.818 seconds elapsed                                                     |
|                                                                             |
| isWeierstrassSemigroup(L,0.4,Verbose=>true)));   -- 197.l321 seconds elapsed|
|                                                                             |
|--257 sec                                                                    |
+-----------------------------------------------------------------------------+

Since the number of cases gets rather large, we break up the list of all
semigroups into sublists of semigroups of given multiplicity and call the
function nonWeierstrassSemigroups:

+-------------------------------------------------------------+
|i10 : m=5,g=8                                                |
|                                                             |
|o10 = (5, 8)                                                 |
|                                                             |
|o10 : Sequence                                               |
+-------------------------------------------------------------+
|i11 : elapsedTime nonWeierstrassSemigroups(m,g,Verbose=>true)|
|(13, 1)                                                      |
|{5, 8, 11, 12}                                               |
|unfolding                                                    |
| -- .448475s elapsed                                         |
|flatteningRelations                                          |
| -- .226413s elapsed                                         |
|next gb                                                      |
| -- .000962178s elapsed                                      |
|true                                                         |
| -- 1.18821s elapsed                                         |
|(5, 8,  all semigroups are smoothable) -- 1.24073s elapsed   |
|                                                             |
|                                                             |
|o11 = {}                                                     |
|                                                             |
|o11 : List                                                   |
+-------------------------------------------------------------+

In the verbose mode we get timings of various computation steps and further
information. The first line, (13,1), indicates that there 13 semigroups of
multiplicity 5 and genus 8 of which only 1 is not flagged as smoothable by the
function knownExample. The second line, {5,8,11,12}, gives the current
semigroup. The timing under various  headers tells how much time was used in
each of the steps.

+-------------------------------------------------+
|i12 : L={6,8,9,11}                               |
|                                                 |
|o12 = {6, 8, 9, 11}                              |
|                                                 |
|o12 : List                                       |
+-------------------------------------------------+
|i13 : genus L                                    |
|                                                 |
|o13 = 8                                          |
+-------------------------------------------------+
|i14 : isWeierstrassSemigroup(L,0.2,Verbose=>true)|
| -- .189389s elapsed                             |
|6                                                |
|false                                            |
|5                                                |
|false                                            |
|4                                                |
|decompose                                        |
| -- .527944s elapsed                             |
|number of components: 2                          |
|support c, codim c: {(1, 1), (16, 3)}            |
|{0, -1}                                          |
|                                                 |
|o14 = true                                       |
+-------------------------------------------------+

The first integer, 6, tells that in this attempt deformation parameters of
degree >= 6 were used and no smooth fiber was found. Finally with all
parameters of degree >= 4, the flatteningRelations define a scheme that
decomposes into 2 components, both affine spaces. If we encounter non affine
components we print  "has to solve", and find a point in each such component.
We then print the number of singular points in the fiber. Finally the output
"{0,-1}" is the dimension of the singular loci of a random fiber over each
component. Thus the entry "-1" indicates that a general fiber of the second
component is smooth.

See also
========

  * isSmoothableSemigroup -- Look for a smoothing
    family
  * isWeierstrassSemigroup -- Experimentally
    decide whether L is a Weierstrass semigroup
  * nonWeierstrassSemigroups -- Find possibly
    non Weierstrass Semigroups
  * knownExample -- Is L a known Weierstrass semigroup?

Ways to use LabBookProtocol:
============================

  * "LabBookProtocol(ZZ)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1562:0.

makeUnfolding -- Makes the universal homogeneous unfolding of an ideal with positive degree parameters
******************************************************************************************************

  * Usage:
        (A,unfolding) = makeUnfolding I
        (A,unfolding) = makeUnfolding sgrp
  * Inputs:
      * I, an ideal (Macaulay2Doc),
      * sgrp, a list (Macaulay2Doc), generators of a semigroup
  * Optional inputs (Macaulay2Doc),:
      * BaseField
      * Verbose => ..., default value false
  * Outputs:
      * A, a ring (Macaulay2Doc), algebra of unfolding parameters
      * unfolding, a matrix (Macaulay2Doc), equations of the
        unfolding

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

Given a (quasi)homogeneous ideal in a ring S = kk[x_0..x_n] the function
creates a positively graded polynomial ring A = kk[a_{i,j}] and computes the
unfolding of I as an ideal of SA = kk[x_0..x_n, a_{i,j}]. This can be used as a
step in computing the semi-universal deformation of the affine cone defined by
I.

In the case of

makeUnfolding sgrp

the routine first forms the ideal of the semigroup ring, and applies
makeUnfolding to this.

+-----------------------------------------------------------------------------+
|i1 : L={4,5,7}                                                               |
|                                                                             |
|o1 = {4, 5, 7}                                                               |
|                                                                             |
|o1 : List                                                                    |
+-----------------------------------------------------------------------------+
|i2 : I := semigroupIdeal L;                                                  |
|                                                                             |
|               ZZ                                                            |
|o2 : Ideal of ----[x ..x , x ]                                               |
|              1009  0   1   3                                                |
+-----------------------------------------------------------------------------+
|i3 : (A,unfolding):= makeUnfolding I;                                        |
+-----------------------------------------------------------------------------+
|i4 : S=ring I                                                                |
|                                                                             |
|o4 = S                                                                       |
|                                                                             |
|o4 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i5 : fI=res I                                                                |
|                                                                             |
|      1      3      2                                                        |
|o5 = S  <-- S  <-- S  <-- 0                                                  |
|                                                                             |
|     0      1      2      3                                                  |
|                                                                             |
|o5 : ChainComplex                                                            |
+-----------------------------------------------------------------------------+
|i6 : degs=flatten (gens A/degree)                                            |
|                                                                             |
|o6 = {15, 14, 12, 11, 10, 10, 9, 8, 8, 7, 7, 7, 6, 6, 5, 5, 5, 4, 4, 4, 3, 3,|
|     ------------------------------------------------------------------------|
|     3, 2, 2, 2, 1, 1, 1}                                                    |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : n=floor(max degs/2+3)                                                   |
|                                                                             |
|o7 = 10                                                                      |
+-----------------------------------------------------------------------------+
|i8 : restricted=ideal select(gens A, y-> (degree y)_0<n);                    |
|                                                                             |
|               ZZ                                                            |
|o8 : Ideal of ----[a      , a      , a      , a      , a      , a      , a   |
|              1009  {2, 0}   {1, 0}   {0, 0}   {2, 1}   {2, 2}   {1, 1}   {1,|
|-----------------------------------------------------------------------------|
|  , a      , a      , a      , a      , a      , a      , a      , a      ,  |
|2}   {2, 3}   {0, 1}   {2, 4}   {1, 3}   {0, 2}   {2, 5}   {1, 4}   {2, 6}   |
|-----------------------------------------------------------------------------|
|a      , a      , a      , a      , a      , a      , a      , a      , a    |
| {1, 5}   {0, 3}   {2, 7}   {1, 6}   {0, 4}   {2, 8}   {1, 7}   {0, 5}   {2, |
|-----------------------------------------------------------------------------|
|  , a      , a      , a       , a      , a      ]                            |
|9}   {1, 8}   {0, 6}   {2, 10}   {1, 9}   {0, 7}                             |
+-----------------------------------------------------------------------------+
|i9 : SA=ring unfolding                                                       |
|                                                                             |
|o9 = SA                                                                      |
|                                                                             |
|o9 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i10 : runfolding=unfolding%sub(restricted,SA);                               |
|                                                                             |
|               1       3                                                     |
|o10 : Matrix SA  <-- SA                                                      |
+-----------------------------------------------------------------------------+
|i11 : transpose runfolding                                                   |
|                                                                             |
|o11 = {-12} | x_0^3-x_1x_3+a_{0, 0}                           |              |
|      {-14} | x_0x_1^2-x_3^2+a_{1, 0}+x_0a_{1, 1}             |              |
|      {-15} | x_1^3-x_0^2x_3+a_{2, 0}+x_0a_{2, 1}+x_1a_{2, 2} |              |
|                                                                             |
|               3       1                                                     |
|o11 : Matrix SA  <-- SA                                                      |
+-----------------------------------------------------------------------------+
|i12 : J=flatteningRelations(I,A,runfolding);                                 |
|                                                                             |
|                ZZ                                                           |
|o12 : Ideal of ----[a      , a      , a      , a      , a      , a      ,    |
|               1009  {2, 0}   {1, 0}   {0, 0}   {2, 1}   {2, 2}   {1, 1}     |
|-----------------------------------------------------------------------------|
|a      , a      , a      , a      , a      , a      , a      , a      , a    |
| {1, 2}   {2, 3}   {0, 1}   {2, 4}   {1, 3}   {0, 2}   {2, 5}   {1, 4}   {2, |
|-----------------------------------------------------------------------------|
|  , a      , a      , a      , a      , a      , a      , a      , a      ,  |
|6}   {1, 5}   {0, 3}   {2, 7}   {1, 6}   {0, 4}   {2, 8}   {1, 7}   {0, 5}   |
|-----------------------------------------------------------------------------|
|a      , a      , a      , a       , a      , a      ]                       |
| {2, 9}   {1, 8}   {0, 6}   {2, 10}   {1, 9}   {0, 7}                        |
+-----------------------------------------------------------------------------+
|i13 : cJ=decompose J;#cJ                                                     |
|                                                                             |
|o14 = 1                                                                      |
+-----------------------------------------------------------------------------+
|i15 : ideal prune (A/J)                                                      |
|                                                                             |
|o15 = ideal ()                                                               |
|                                                                             |
|                ZZ                                                           |
|o15 : Ideal of ----[a      , a      , a      , a      , a      , a      ,    |
|               1009  {1, 1}   {1, 2}   {2, 3}   {0, 1}   {2, 4}   {1, 3}     |
|-----------------------------------------------------------------------------|
|a      , a      , a      , a      , a      , a      , a      , a      , a    |
| {0, 2}   {2, 5}   {1, 4}   {2, 6}   {1, 5}   {0, 3}   {2, 7}   {1, 6}   {0, |
|-----------------------------------------------------------------------------|
|  , a      , a      , a      , a      , a      , a      , a       , a      , |
|4}   {2, 8}   {1, 7}   {0, 5}   {2, 9}   {1, 8}   {0, 6}   {2, 10}   {1, 9}  |
|-----------------------------------------------------------------------------|
|a      ]                                                                     |
| {0, 7}                                                                      |
+-----------------------------------------------------------------------------+
|i16 : family=runfolding%sub(J,SA);                                           |
|                                                                             |
|               1       3                                                     |
|o16 : Matrix SA  <-- SA                                                      |
+-----------------------------------------------------------------------------+

This is a flat family!

+----------------------------------------------------------------------------+
|i17 : betti res ideal family == betti res I                                 |
|                                                                            |
|o17 = true                                                                  |
+----------------------------------------------------------------------------+
|i18 : fiber=ideal sub(family,vars S|random(S^1,S^(numgens A)));             |
|                                                                            |
|o18 : Ideal of S                                                            |
+----------------------------------------------------------------------------+
|i19 : singFiber=radical ideal gens gb (fiber+minors(codim I,jacobian fiber))|
|                                                                            |
|o19 = ideal 1                                                               |
|                                                                            |
|o19 : Ideal of S                                                            |
+----------------------------------------------------------------------------+

Thus the family is a smoothing of S/I so the semigroup L in the example is a
Weierstrass semigroup by Pinkham's thesis.

See also
========

  * flatteningRelations -- Compute the flattening
    relations of an unfolding

Ways to use makeUnfolding:
==========================

  * "makeUnfolding(Ideal)"
  * "makeUnfolding(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2390:0.

mingens(List) -- Find a mininmal set of semigroup generators
************************************************************

  * Function: mingens (Macaulay2Doc),
  * Usage:
        L' = mingens L
  * Inputs:
      * L, a list (Macaulay2Doc), generators of a semigroup
  * Optional inputs (Macaulay2Doc),:
      * Strategy (Macaulay2Doc), => ..., default value null,
  * Outputs:
      * L', a list (Macaulay2Doc), minimal generators of the same
        semigroup

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

The set of generators is minimal if it has empty intersection with the set of
sums of non-zero generators.

It would have been nicer to overload mingens (Macaulay2Doc), to
accept a list.

+------------------------------------+
|i1 : L = semigroup {3,7}            |
|                                    |
|o1 = {0, 3, 6, 7, 9, 10, 12, 13, 14}|
|                                    |
|o1 : List                           |
+------------------------------------+
|i2 : mingens L                      |
|                                    |
|o2 = {3, 7}                         |
|                                    |
|o2 : List                           |
+------------------------------------+

See also
========

  * semigroup -- Compute the semigroup generated by a list of
    positive integers

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

  * mingens(List) -- Find a mininmal set of semigroup
    generators
-------------------------------------------------------------------------------

The source of this document is in NumericalSemigroups.m2:1947:0.

mu -- Compute the point representing a semigroup in the Kunz cone
*****************************************************************

  * Usage:
        K = mu L
        K = mu H
  * Inputs:
      * L, a list (Macaulay2Doc),
      * H, a hash table (Macaulay2Doc), produced by apery L
  * Outputs:
      * K, a list (Macaulay2Doc),

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

The apery set A of a semigroup s with multiplicity m has the form A_i = i+
mu_i*m. The point with coordinates mu(L) represents semigroup L in the Kunz
cone P_m.

+-----------------------------------+
|i1 : m = 3                         |
|                                   |
|o1 = 3                             |
+-----------------------------------+
|i2 : L = {3,7}                     |
|                                   |
|o2 = {3, 7}                        |
|                                   |
|o2 : List                          |
+-----------------------------------+
|i3 : a = aperySet L                |
|                                   |
|o3 = {7, 14}                       |
|                                   |
|o3 : List                          |
+-----------------------------------+
|i4 : b = mu L                      |
|                                   |
|o4 = {2, 4}                        |
|                                   |
|o4 : List                          |
+-----------------------------------+
|i5 : apply (#b, i -> (i+1)+(b_i*m))|
|                                   |
|o5 = {7, 14}                       |
|                                   |
|o5 : List                          |
+-----------------------------------+

See also
========

  * aperySet -- Compute the apery set of a numerical semigroup

Ways to use mu:
===============

  * "mu(HashTable)"
  * "mu(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1776:0.

nonWeierstrassSemigroups -- Find possibly non Weierstrass Semigroups
********************************************************************

  * Usage:
        LL=nonWeierstrassSemgroups(m,g)
        LL=nonWeierstrassSemgroups(m,g,LLdifficult)
  * Inputs:
      * m, an integer (Macaulay2Doc), the multiplicity of a semigroup
      * g, an integer (Macaulay2Doc), the genus of a semigroup
      * LLdifficult, a list (Macaulay2Doc), List of difficult
        semigroups which we exclude from the test
  * Optional inputs (Macaulay2Doc),:
      * BaseField
      * Verbose => ..., default value false
  * Outputs:
      * LL, a list (Macaulay2Doc), List of possible non Weierstrass
        semigroups including LLdifficult

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

We test which semigroups of multiplicity m and genus g are smoothable. If no
smoothing was found then L is a candidate for a non Weierstrass semigroup. In
this search certain semigroups L in LLdifficult, where the computation is
particular heavy are excluded.

+------------------------------------------------------------------------+
|i1 : elapsedTime nonWeierstrassSemigroups(6,7)                          |
|(6, 7,  all semigroups are smoothable) -- 2.40859s elapsed              |
|                                                                        |
|                                                                        |
|o1 = {}                                                                 |
|                                                                        |
|o1 : List                                                               |
+------------------------------------------------------------------------+
|i2 : LLdifficult={{6, 8, 9, 11}}                                        |
|                                                                        |
|o2 = {{6, 8, 9, 11}}                                                    |
|                                                                        |
|o2 : List                                                               |
+------------------------------------------------------------------------+
|i3 : elapsedTime nonWeierstrassSemigroups(6,8,LLdifficult,Verbose=>true)|
|(17, 5)                                                                 |
|{6, 7, 8, 17}                                                           |
|unfolding                                                               |
| -- .471307s elapsed                                                    |
|flatteningRelations                                                     |
| -- .16743s elapsed                                                     |
|next gb                                                                 |
| -- .00201578s elapsed                                                  |
|true                                                                    |
| -- 1.03747s elapsed                                                    |
|{6, 7, 9, 17}                                                           |
|unfolding                                                               |
| -- .601562s elapsed                                                    |
|flatteningRelations                                                     |
| -- .413848s elapsed                                                    |
|next gb                                                                 |
| -- .00592834s elapsed                                                  |
|decompose                                                               |
| -- .287537s elapsed                                                    |
|number of components: 2                                                 |
|support c, codim c: {(2, 2), (5, 2)}                                    |
|{0, -1}                                                                 |
| -- 5.12237s elapsed                                                    |
|{6, 8, 9, 10}                                                           |
|unfolding                                                               |
| -- .28639s elapsed                                                     |
|flatteningRelations                                                     |
| -- .209721s elapsed                                                    |
|next gb                                                                 |
| -- .000512443s elapsed                                                 |
|true                                                                    |
| -- 1.33327s elapsed                                                    |
|{6, 8, 10, 11, 13}                                                      |
|unfolding                                                               |
| -- .731996s elapsed                                                    |
|flatteningRelations                                                     |
| -- .282573s elapsed                                                    |
|next gb                                                                 |
| -- .00416736s elapsed                                                  |
|decompose                                                               |
| -- 1.60177s elapsed                                                    |
|number of components: 1                                                 |
|support c, codim c: {(5, 1)}                                            |
|{-1}                                                                    |
| -- 4.32014s elapsed                                                    |
| -- 11.8134s elapsed                                                    |
|0                                                                       |
|                                                                        |
| -- .000004438s elapsed                                                 |
| -- 11.9593s elapsed                                                    |
|{}                                                                      |
|                                                                        |
|o3 = {{6, 8, 9, 11}}                                                    |
|                                                                        |
|o3 : List                                                               |
+------------------------------------------------------------------------+

In the verbose mode we get timings of various computation steps and further
information. The first line, (17,5), indicates that there 17 semigroups of
multiplicity 6 and genus 8 of which only 5 is not flagged as smoothable by the
function knownExample. The second line, {6, 7, 8, 17}, gives the current
semigroup. The timing under various  headers tells how much time was used in
each of the steps.

See also
========

  * isWeierstrassSemigroup -- Experimentally
    decide whether L is a Weierstrass semigroup
  * LabBookProtocol -- Weierstrass Semigroups in Low
    genus

Ways to use nonWeierstrassSemigroups:
=====================================

  * "nonWeierstrassSemigroups(ZZ,ZZ)"
  * "nonWeierstrassSemigroups(ZZ,ZZ,List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2605:0.

semigroup -- Compute the semigroup generated by a list of positive integers
***************************************************************************

  * Usage:
        L = semigroup L0
  * Inputs:
      * L0, a list (Macaulay2Doc),
  * Outputs:
      * L, a list (Macaulay2Doc),

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

The semigroup is actually computed by the function apery, and semigroup L =
(apery L)#"semigroup"

+----------------------------------------+
|i1 : semigroup {5,4}                    |
|                                        |
|o1 = {0, 4, 5, 8, 9, 10, 12, 13, 14, 15}|
|                                        |
|o1 : List                               |
+----------------------------------------+

See also
========

  * apery -- Compute the apery set, multiplicity and conductor

Ways to use semigroup:
======================

  * "semigroup(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1712:0.

semigroupIdeal -- The ideal defining the semigroup ring
*******************************************************

  * Usage:
        I =  semigroupIdeal L
  * Inputs:
      * L, a list (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * BaseField
      * MinimalGenerators
      * VariableName
  * Outputs:
      * I, an ideal (Macaulay2Doc),

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

The semingroup ideal of the semigroup generated by L is the kernel of the map
kk[x_0..x_(#L)] -> kk[t] sending x_i to t^(L_i), where kk is the specified
BaseField, defaulting to ZZ/101 and x is the specified VariableName. If the
option "MinimalGenerators" is set to true, the default, then the program first
computes a minimal set of generators from L; if it is set to false, the program
uses L itself.

+-----------------------------------------------------------+
|i1 : semigroupIdeal {5,7}                                  |
|                                                           |
|            7    5                                         |
|o1 = ideal(x  - x )                                        |
|            0    2                                         |
|                                                           |
|               ZZ                                          |
|o1 : Ideal of ----[x , x ]                                 |
|              1009  0   2                                  |
+-----------------------------------------------------------+
|i2 : semigroupIdeal({5,7,10}, "MinimalGenerators" => false)|
|                                                           |
|             2            5        3                       |
|o2 = ideal (x    - x   , x  - x   x   )                    |
|             0,0    1,0   2    0,0 1,0                     |
|                                                           |
|               ZZ                                          |
|o2 : Ideal of ----[x   , x , x   ]                         |
|              1009  0,0   2   1,0                          |
+-----------------------------------------------------------+

See also
========

  * mingens (Macaulay2Doc) -- minimal generator matrix
  * semigroupRing -- forms the semigroup ring over
    "BaseField"

Ways to use semigroupIdeal:
===========================

  * "semigroupIdeal(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2974:0.

semigroupRing -- forms the semigroup ring over "BaseField"
**********************************************************

  * Usage:
        A = semigroupRing L
  * Inputs:
      * L, a list (Macaulay2Doc), of semigroup generators
  * Optional inputs (Macaulay2Doc),:
      * BaseField
      * MinimalGenerators
      * VariableName
  * Outputs:
      * A, a ring (Macaulay2Doc), algebra over "BaseField"

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

If the basering is kk, the semigroup ring is A = kk[x^S] where x^S denotes the
set of monomials in variables x_i with exponent vectors in S, and kk is the
field that is the value of the option "BaseField" (ZZ/101 by default).

If m is the  multiplicity of S, the semigroup ring depends up to an isomorphism
that may change the degrees, only on the face of the Kunz cone in which the
semigroup lies.

Semigroup rings are interesting as examples, and arise as Weierstrass
semigroups of points on algebraic curves: if p in C is such a point, then the
Weierstrass semigroup of C at p is the set of pole orders of rational functions
with poles only at p, and the semigroupRing is the associated graded ring of
the filtered ring $\bigcup_{n >= 0} H^0(O_C(np))$. For non-Weierstrass points
the semigroup is 0,g+1,g+2.., and there are finitely many "Weierstrass" point p
whose semigroup has weight >=2.

For example if C is a smooth plane quartic, then at each ordinary flex point,
the semigroup is 0,3,5,6,7,..

+---------------------------------------------------------------------------+
|i1 : semigroupRing {3,4,5}                                                 |
|                                                                           |
|                 ZZ                                                        |
|                ---[x ..x ]                                                |
|                101  0   2                                                 |
|o1 = ---------------------------------                                     |
|       2          3          2      2                                      |
|     (x  - x x , x  - x x , x x  - x )                                     |
|       1    0 2   0    1 2   0 1    2                                      |
|                                                                           |
|o1 : QuotientRing                                                          |
+---------------------------------------------------------------------------+
|i2 : weight {4,5,6,7}, gaps {4,5,6,7}                                      |
|                                                                           |
|o2 = (0, {1, 2, 3})                                                        |
|                                                                           |
|o2 : Sequence                                                              |
+---------------------------------------------------------------------------+
|i3 : semigroupRing {4,5,6,7}                                               |
|                                                                           |
|                                    ZZ                                     |
|                                   ---[x ..x ]                             |
|                                   101  0   3                              |
|o3 = ----------------------------------------------------------------------|
|       2                       2          3          2            2      2 |
|     (x  - x x , x x  - x x , x  - x x , x  - x x , x x  - x x , x x  - x )|
|       1    0 2   1 2    0 3   2    1 3   0    1 3   0 1    2 3   0 2    3 |
|                                                                           |
|o3 : QuotientRing                                                          |
+---------------------------------------------------------------------------+
|i4 : weight {3,5,7}, gaps {3,5,7}                                          |
|                                                                           |
|o4 = (1, {1, 2, 4})                                                        |
|                                                                           |
|o4 : Sequence                                                              |
+---------------------------------------------------------------------------+
|i5 : semigroupRing {3,5,7}                                                 |
|                                                                           |
|               ZZ                                                          |
|              ---[x , x , x ]                                              |
|              101  0   2   1                                               |
|o5 = ---------------------------------                                     |
|       2          4          3      2                                      |
|     (x  - x x , x  - x x , x x  - x )                                     |
|       2    0 1   0    2 1   0 2    1                                      |
|                                                                           |
|o5 : QuotientRing                                                          |
+---------------------------------------------------------------------------+
|i6 : weight {3,4}, gaps {3,4}                                              |
|                                                                           |
|o6 = (2, {1, 2, 5})                                                        |
|                                                                           |
|o6 : Sequence                                                              |
+---------------------------------------------------------------------------+
|i7 : semigroupRing({3,4}, "BaseField" => QQ)                               |
|                                                                           |
|     QQ[x ..x ]                                                            |
|         0   1                                                             |
|o7 = ----------                                                            |
|        4    3                                                             |
|       x  - x                                                              |
|        0    1                                                             |
|                                                                           |
|o7 : QuotientRing                                                          |
+---------------------------------------------------------------------------+

See also
========

  * semigroupIdeal -- The ideal defining the semigroup
    ring
  * weight -- weight of a semigroup

Ways to use semigroupRing:
==========================

  * "semigroupRing(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2327:0.

socle -- elements of the semigroup that are in the socle mod the multiplicity
*****************************************************************************

  * Usage:
        socle L
  * Inputs:
      * L, a list (Macaulay2Doc), generators of a semigroup
  * Outputs:
      * L, a list (Macaulay2Doc), subset of the Apery set
        representing the socle mod the multiplicity

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

Let S = semigroup L be a numerical semigroup with minimal non-zero element m,
and consider the artinian ring A(s) = k[{t^i : i in s]/(t^m). The socle of A(s)
is the sum of the minimal nonzero ideals, and socle L is a set of generators of
the socle

+------------------------------------+
|i1 : L = {3,7}                      |
|                                    |
|o1 = {3, 7}                         |
|                                    |
|o1 : List                           |
+------------------------------------+
|i2 : s = semigroup L                |
|                                    |
|o2 = {0, 3, 6, 7, 9, 10, 12, 13, 14}|
|                                    |
|o2 : List                           |
+------------------------------------+
|i3 : socle L                        |
|                                    |
|o3 = {14}                           |
|                                    |
|o3 : List                           |
+------------------------------------+
|i4 : L = {3,4,5}                    |
|                                    |
|o4 = {3, 4, 5}                      |
|                                    |
|o4 : List                           |
+------------------------------------+
|i5 : s = semigroup L                |
|                                    |
|o5 = {0, 3, 4, 5}                   |
|                                    |
|o5 : List                           |
+------------------------------------+
|i6 : socle L                        |
|                                    |
|o6 = {4, 5}                         |
|                                    |
|o6 : List                           |
+------------------------------------+

See also
========

  * semigroup -- Compute the semigroup generated by a list of
    positive integers

Ways to use socle:
==================

  * "socle(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:1980:0.

sums -- sum of two sequences
****************************

  * Usage:
        L = sums(L1, L2)
        L = sums(n,L1)
  * Inputs:
      * L1, a list (Macaulay2Doc),
      * L2, a list (Macaulay2Doc),
      * n, an integer (Macaulay2Doc),
  * Outputs:
      * L, a list (Macaulay2Doc),

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

sums(L1,L2) returns a sorted list of the unique sums of nonzero elements of L1
with L2; sums(n, L1) returns the sorted list of unique sums of n nonzero
elements of L1.

+----------------------+
|i1 : L1 = {2,3}       |
|                      |
|o1 = {2, 3}           |
|                      |
|o1 : List             |
+----------------------+
|i2 : L2 = {4,5}       |
|                      |
|o2 = {4, 5}           |
|                      |
|o2 : List             |
+----------------------+
|i3 : sums(L1, L2)     |
|                      |
|o3 = {6, 7, 8}        |
|                      |
|o3 : List             |
+----------------------+
|i4 : sums(1, L1) == L1|
|                      |
|o4 = true             |
+----------------------+
|i5 : sums(L1, L1)     |
|                      |
|o5 = {4, 5, 6}        |
|                      |
|o5 : List             |
+----------------------+
|i6 : sums(2,L1)       |
|                      |
|o6 = {4, 5, 6}        |
|                      |
|o6 : List             |
+----------------------+

Of course the sequence of arbitrary sums of elements including 0 is essentially
semigroup L. To get just the sums of n elements, one could write:

+----------------------------------------------------------------+
|i7 : n = 3                                                      |
|                                                                |
|o7 = 3                                                          |
+----------------------------------------------------------------+
|i8 : {0}|sort unique flatten (for i from 1 to n list sums(i,L1))|
|                                                                |
|o8 = {0, 2, 3, 4, 5, 6, 7, 8, 9}                                |
|                                                                |
|o8 : List                                                       |
+----------------------------------------------------------------+

Ways to use sums:
=================

  * "sums(List,List)"
  * "sums(ZZ,List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2083:0.

type -- type of the local semigroup ring
****************************************

  * Usage:
        r = type L
  * Inputs:
      * L, a list (Macaulay2Doc), of semigroup generators
  * Outputs:
      * r, an integer (Macaulay2Doc), the type

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

The type of a local Cohen-Macaulay ring is the number of generators of the
canonical module, or equivalently the dimension of the socle of an
zero-dimensional reduction.

For example, the type of a complete intersection such as the semigroup ring of
a semigroup generated by 2 elements.

+---------------+
|i1 : type {3,5}|
|               |
|o1 = 1         |
+---------------+

See also
========

  * socle -- elements of the semigroup that are in the socle mod
    the multiplicity

Ways to use type:
=================

  * "type(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2008:0.

weight -- weight of a semigroup
*******************************

  * Usage:
        w = weight L
  * Inputs:
      * L, a list (Macaulay2Doc),
  * Outputs:
      * w, an integer (Macaulay2Doc),

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

If S is the Weierstrass semigroup S of a point p on a Riemann surface C, then
the vanishing sequence (v_0,\dots, v_(g-1)) of the canonical series at p is the
list of orders of vanishing of differential forms at p, and the ramification
sequence at p is (v_0 - 0, v_1 - 1, .. ,v_(g-1) - (g-1)). The weight of the
Weierstrass point p is the sum of the ramification sequence at p.

The vanishing sequence can be computed from the set G of gaps in S as v_i = G_i
- 1, so the weight is sum(G_i - 1 - i) or as the number of pairs (a,b) such
that a is in S, b is a gap, and a < b.

+----------------------------------------------------------------------+
|i1 : weight {5,7}                                                     |
|                                                                      |
|o1 = 36                                                               |
+----------------------------------------------------------------------+
|i2 : semigroup{5,7}                                                   |
|                                                                      |
|o2 = {0, 5, 7, 10, 12, 14, 15, 17, 19, 20, 21, 22, 24, 25, 26, 27, 28}|
|                                                                      |
|o2 : List                                                             |
+----------------------------------------------------------------------+
|i3 : gaps{5,7}                                                        |
|                                                                      |
|o3 = {1, 2, 3, 4, 6, 8, 9, 11, 13, 16, 18, 23}                        |
|                                                                      |
|o3 : List                                                             |
+----------------------------------------------------------------------+

The effective weight ewt is the number of such pairs where a is a minimal
generator of S; this may be a better measure.

+-----------------+
|i4 : mingens{5,7}|
|                 |
|o4 = {5, 7}      |
|                 |
|o4 : List        |
+-----------------+
|i5 : ewt {5,7}   |
|                 |
|o5 = 15          |
+-----------------+

See also
========

  * gaps -- The gap sequence of a semigroup
  * ewt -- Effective weight of a semigroup (Pflueger)
  * mingens (Macaulay2Doc) -- minimal generator matrix

Ways to use weight:
===================

  * "weight(List)"

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

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

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

The source of this document is in NumericalSemigroups.m2:2942:0.