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

NormalToricVarieties -- working with normal toric varieties and related objects
*******************************************************************************

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

A toric variety is an integral scheme such that an algebraic torus forms a
Zariski open subscheme and the natural action this torus on itself extends to
an action on the entire scheme.  Normal toric varieties correspond to strongly
convex rational polyhedral fans. This makes the theory of normal toric
varieties very explicit and computable.

This Macaulay2 package is designed to manipulate normal toric varieties and
related geometric objects.  An introduction to the theory of normal toric
varieties can be found in the following textbooks:

  * David A. Cox, John B. Little, Hal Schenck, Toric varieties (see
    https://dacox.people.amherst.edu/toric.html ), Graduate Studies in
    Mathematics 124. American Mathematical Society, Providence RI, 2011.  ISBN:
    978-0-8218-4817-7
  * Günter Ewald, Combinatorial convexity and algebraic geometry, Graduate
    Texts in Mathematics 168. Springer-Verlag, New York, 1996.  ISBN:
    0-387-94755-8
  * William Fulton, Introduction to toric varieties, Annals of Mathematics
    Studies 131, Princeton University Press, Princeton, NJ, 1993. ISBN:
    0-691-00049-2
  * Tadao Oda, Convex bodies and algebraic geometry, an introduction to the
    theory of toric varieties, Ergebnisse der Mathematik und ihrer Grenzgebiete
    (3) 15, Springer-Verlag, Berlin, 1988. ISBN: 3-540-17600-4

Contributors
============

The following people have generously contributed code, improved existing code,
or enhanced the documentation: Paul Aspinwall (see
http://www.math.duke.edu/~psa/ ), Christine Berkesch (see
http://www-users.math.umn.edu/~cberkesc/ ), René Birkner (see
http://page.mi.fu-berlin.de/rbirkner/indexen.htm ), Justin Chen (see
http://people.math.gatech.edu/~jchen646/ ), Chris Eur (see
https://math.berkeley.edu/~ceur/index.html ), Matthew Faust (see
https://www.math.tamu.edu/~mfaust/ ), Corey Harris (see
http://www.coreyharris.name ), Michael Loper (see
http://www-users.math.umn.edu/~loper012/ ), Diane Maclagan (see
http://www.warwick.ac.uk/staff/D.Maclagan/ ), Maryam Nowroozi (see
https://www.math.mcmaster.ca/people/grad-students.html ), Erika Pirnes (see
https://sites.google.com/view/erikapirnes ), Ritvik Ramkumar (see
https://math.berkeley.edu/~ritvik/index.html ), Julie Rana (see
https://sites.google.com/site/jranamath ), Mahrud Sayrafi (see
https://math.umn.edu/~mahrud/ ), Alexandra Seceleanu (see
http://www.math.unl.edu/~aseceleanu2/ ), Mike Stillman (see
http://www.math.cornell.edu/~mike/ ), Sameera Vemulapalli (see
https://www.math.princeton.edu/people/sameera-vemulapalli ), Elise Walker (see
https://www.math.tamu.edu/~walkere ), Weikun Wang (see https://wangweikun.com
), Rachel Webb (see https://sites.google.com/view/rachel-webb ), Thomas Yahl
(see https://www.math.tamu.edu/~thomasjyahl ), and Jay Yang (see
https://www-users.math.umn.edu/~jkyang/ ).

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * resolving singularities -- information
    about find a smooth proper birational surjection
  * working with toric maps -- information
    about toric maps and the induced operations
  * working with divisors -- information about
    toric divisors and their related groups
  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)

Author
======

  * Gregory G. Smith (see http://www.mast.queensu.ca/~ggsmith )
    <ggsmith@mast.queensu.ca>

Version
=======

This documentation describes version 1.9 of NormalToricVarieties, released 31
May 2020.

Citation
========

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

+-----------------------------------------------------------------------------+
|@misc{NormalToricVarietiesSource,                                            |
|  title = {{NormalToricVarieties: routines for working with normal           |
|  author = {Gregory G. Smith},                                               |
|  howpublished = {A \emph{Macaulay2} package available at                    |
|    \url{https://github.com/Macaulay2/M2/tree/stable/M2/Macaulay2/           |
|}                                                                            |
|-----------------------------------------------------------------------------|
| toric varieties and related objects. Version~1.9}},                         |
|                                                                             |
|                                                                             |
|packages}}                                                                   |
+-----------------------------------------------------------------------------+

Exports
=======

  * Types
      * NormalToricVariety -- the class of all
        normal toric varieties
      * ToricDivisor -- the class of all torus-invariant
        Weil divisors
      * ToricMap -- the class of all torus-equivariant maps
        between normal toric varieties
  * Functions and commands
      * "affineSpace" -- see affineSpace(ZZ), --
        make an affine space as a normal toric variety
      * "cartesianProduct" -- see cartesianProduct(Sequence),
        -- make the Cartesian product of normal
        toric varieties
      * "cartierDivisorGroup" -- see
        cartierDivisorGroup(NormalToricVariety),
        -- compute the group of
        torus-invariant Cartier divisors
      * "classGroup" -- see classGroup(NormalToricVariety),
        -- make the class group
      * diagonalToricMap -- make a diagonal map into a
        Cartesian product
      * "fromCDivToPic" -- see fromCDivToPic(NormalToricVariety),
        -- get the map from Cartier
        divisors to the Picard group
      * "fromCDivToWDiv" -- see fromCDivToWDiv(NormalToricVariety),
        -- get the map from Cartier
        divisors to Weil divisors
      * "fromPicToCl" -- see fromPicToCl(NormalToricVariety),
        -- get the map from Picard group
        to class group
      * "fromWDivToCl" -- see fromWDivToCl(NormalToricVariety),
        -- get the map from the group of
        Weil divisors to the class group
      * "hirzebruchSurface" -- see hirzebruchSurface(ZZ),
        -- make any Hirzebruch surface
      * "isAmple" -- see isAmple(ToricDivisor),
        -- whether a torus-invariant Weil divisor is
        ample
      * "isCartier" -- see isCartier(ToricDivisor),
        -- whether a torus-invariant Weil divisor
        is Cartier
      * "isDegenerate" -- see isDegenerate(NormalToricVariety),
        -- whether a toric variety is
        degenerate
      * "isDominant" -- see isDominant(ToricMap),
        -- whether a toric map is dominant
      * "isEffective" -- see isEffective(ToricDivisor),
        -- whether a torus-invariant Weil
        divisor is effective
      * "isFano" -- see isFano(NormalToricVariety),
        -- whether a normal toric variety is
        Fano
      * "isFibration" -- see isFibration(ToricMap),
        -- whether a toric map is a fibration
      * "isNef" -- see isNef(ToricDivisor), --
        whether a torus-invariant Weil divisor is nef
      * "isProper" -- see isProper(ToricMap), --
        whether a toric map is proper
      * "isQQCartier" -- see isQQCartier(ToricDivisor),
        -- whether a torus-invariant Weil
        divisor is QQ-Cartier
      * "kleinschmidt" -- see kleinschmidt(ZZ,List),
        -- make any smooth normal toric variety
        having Picard rank two
      * "makeSimplicial" -- see makeSimplicial(NormalToricVariety),
        -- make a birational simplicial
        toric variety
      * "makeSmooth" -- see makeSmooth(NormalToricVariety),
        -- make a birational smooth toric
        variety
      * "normalToricVariety" -- see normalToricVariety(List,List),
        -- make a normal toric variety
      * "orbits" -- see orbits(NormalToricVariety),
        -- make a hashtable indexing the torus
        orbits (a.k.a. cones in the fan)
      * "picardGroup" -- see picardGroup(NormalToricVariety),
        -- make the Picard group
      * "smallAmpleToricDivisor" -- see smallAmpleToricDivisor(ZZ,ZZ),
        -- get a very ample toric divisor
        from the database
      * "smoothFanoToricVariety" -- see smoothFanoToricVariety(ZZ,ZZ),
        -- get a smooth Fano toric variety
        from database
      * "toricBlowup" -- see toricBlowup(List,NormalToricVariety,List),
        -- makes the
        toricBlowup of a normal toric variety along a torus orbit closure
      * "toricDivisor" -- see toricDivisor(List,NormalToricVariety),
        -- make a torus-invariant
        Weil divisor
      * "toricProjectiveSpace" -- see toricProjectiveSpace(ZZ),
        -- make a projective space as a normal
        toric variety
      * "weightedProjectiveSpace" -- see weightedProjectiveSpace(List),
        -- make a weighted projective space
      * "weilDivisorGroup" -- see weilDivisorGroup(NormalToricVariety),
        -- make the group of
        torus-invariant Weil divisors
  * Methods
      * abstractSheaf(NormalToricVariety,AbstractVariety,CoherentSheaf)
        -- make the corresponding abstract sheaf
      * "abstractSheaf(NormalToricVariety,CoherentSheaf)" -- see
        abstractSheaf(NormalToricVariety,AbstractVariety,CoherentSheaf),
        -- make the corresponding abstract sheaf
      * abstractSheaf(NormalToricVariety,AbstractVariety,ToricDivisor),
        -- make the corresponding abstract sheaf
      * "abstractSheaf(NormalToricVariety,ToricDivisor)" -- see
        abstractSheaf(NormalToricVariety,AbstractVariety,ToricDivisor),
        -- make the corresponding abstract sheaf
      * "abstractVariety(NormalToricVariety)" -- see
        abstractVariety(NormalToricVariety,AbstractVariety),
        -- make the
        corresponding abstract variety
      * abstractVariety(NormalToricVariety,AbstractVariety)
        -- make the
        corresponding abstract variety
      * affineSpace(ZZ) -- make an affine space as
        a normal toric variety
      * "cartesianProduct(NormalToricVariety)" -- see
        cartesianProduct(Sequence), -- make the
        Cartesian product of normal toric varieties
      * cartesianProduct(Sequence), --
        make the Cartesian product of normal toric varieties
      * cartierDivisorGroup(NormalToricVariety)
        -- compute the group of
        torus-invariant Cartier divisors
      * cartierDivisorGroup(ToricMap),
        -- make the induced map between groups of Cartier divisors.
      * "ch(CoherentSheaf)" -- see ch(ZZ,CoherentSheaf),
        -- compute the Chern character of a
        coherent sheaf
      * ch(ZZ,CoherentSheaf) -- compute the
        Chern character of a coherent sheaf
      * "chern(CoherentSheaf)" -- see chern(ZZ,CoherentSheaf),
        -- compute the Chern class of a coherent
        sheaf
      * chern(ZZ,CoherentSheaf), --
        compute the Chern class of a coherent sheaf
      * chi(CoherentSheaf) -- compute the Euler
        characteristic of a coherent sheaf
      * "intersectionRing(NormalToricVariety)" -- see Chow ring,
        -- make the rational Chow ring
      * "intersectionRing(NormalToricVariety,AbstractVariety)" -- see
        Chow ring, -- make the rational Chow ring
      * classGroup(NormalToricVariety)
        -- make the class group
      * classGroup(ToricMap) -- make the
        induced map between class groups
      * components(NormalToricVariety)
        -- list the factors in a product
      * "cotangentSheaf(List,NormalToricVariety)" -- see
        cotangentSheaf(NormalToricVariety),
        -- make the sheaf of Zariski
        1-forms
      * cotangentSheaf(NormalToricVariety)
        -- make the sheaf of Zariski
        1-forms
      * "cotangentSheaf(ZZ,NormalToricVariety)" -- see
        cotangentSheaf(NormalToricVariety),
        -- make the sheaf of Zariski
        1-forms
      * ctop(CoherentSheaf) -- compute the top
        Chern class of a coherent sheaf
      * degree(ToricDivisor) -- make the
        degree of the associated rank-one reflexive sheaf
      * "diagonalToricMap(NormalToricVariety)" -- see diagonalToricMap,
        -- make a diagonal map into a Cartesian product
      * "diagonalToricMap(NormalToricVariety,ZZ)" -- see
        diagonalToricMap, -- make a diagonal map into a
        Cartesian product
      * "diagonalToricMap(NormalToricVariety,ZZ,Array)" -- see
        diagonalToricMap, -- make a diagonal map into a
        Cartesian product
      * dim(NormalToricVariety) -- get the
        dimension of a normal toric variety
      * "- ToricDivisor" -- see divisor arithmetic,
        -- perform arithmetic on toric divisors
      * "ToricDivisor + ToricDivisor" -- see divisor arithmetic,
        -- perform arithmetic on toric divisors
      * "ToricDivisor - ToricDivisor" -- see divisor arithmetic,
        -- perform arithmetic on toric divisors
      * "ZZ * ToricDivisor" -- see divisor arithmetic,
        -- perform arithmetic on toric divisors
      * effCone(NormalToricVariety) (missing documentation)
      * effGenerators(NormalToricVariety) (missing documentation)
      * entries(ToricDivisor) -- get the list
        of coefficients
      * expression(NormalToricVariety)
        -- get the expression used to
        format for printing
      * expression(ToricDivisor) -- get
        the expression used to format for printing
      * fan(NormalToricVariety) -- make the
        'Polyhedra' fan associated to the normal toric variety
      * fromCDivToPic(NormalToricVariety)
        -- get the map from Cartier
        divisors to the Picard group
      * fromCDivToWDiv(NormalToricVariety)
        -- get the map from Cartier
        divisors to Weil divisors
      * fromPicToCl(NormalToricVariety)
        -- get the map from Picard group
        to class group
      * fromWDivToCl(NormalToricVariety)
        -- get the map from the group of
        Weil divisors to the class group
      * HH^ZZ(NormalToricVariety,CoherentSheaf)
        -- compute the
        cohomology of a coherent sheaf
      * "HH^ZZ(NormalToricVariety,SheafOfRings)" -- see
        HH^ZZ(NormalToricVariety,CoherentSheaf),
        -- compute the
        cohomology of a coherent sheaf
      * hilbertPolynomial(NormalToricVariety)
        -- compute the multivariate
        Hilbert polynomial
      * "hilbertPolynomial(NormalToricVariety,Ring)" -- see
        hilbertPolynomial(NormalToricVariety),
        -- compute the multivariate
        Hilbert polynomial
      * "hilbertPolynomial(NormalToricVariety,SheafOfRings)" -- see
        hilbertPolynomial(NormalToricVariety),
        -- compute the multivariate
        Hilbert polynomial
      * hilbertPolynomial(NormalToricVariety,CoherentSheaf)
        -- compute
        the multivariate Hilbert polynomial
      * "hilbertPolynomial(NormalToricVariety,Ideal)" -- see
        hilbertPolynomial(NormalToricVariety,CoherentSheaf),
        -- compute
        the multivariate Hilbert polynomial
      * "hilbertPolynomial(NormalToricVariety,Module)" -- see
        hilbertPolynomial(NormalToricVariety,CoherentSheaf),
        -- compute
        the multivariate Hilbert polynomial
      * hirzebruchSurface(ZZ) -- make any
        Hirzebruch surface
      * ideal(NormalToricVariety) -- make
        the irrelevant ideal
      * "monomialIdeal(NormalToricVariety)" -- see
        ideal(NormalToricVariety), -- make the
        irrelevant ideal
      * ideal(ToricMap) -- make the ideal defining
        the closure of the image
      * inducedMap(ToricMap) -- make the
        induced map between total coordinate rings (a.k.a. Cox rings)
      * isAmple(ToricDivisor) -- whether a
        torus-invariant Weil divisor is ample
      * isCartier(ToricDivisor) -- whether
        a torus-invariant Weil divisor is Cartier
      * isComplete(NormalToricVariety)
        -- whether a toric variety is
        complete
      * isDegenerate(NormalToricVariety)
        -- whether a toric variety is
        degenerate
      * isDominant(ToricMap) -- whether a
        toric map is dominant
      * isEffective(ToricDivisor), --
        whether a torus-invariant Weil divisor is effective
      * isFano(NormalToricVariety), --
        whether a normal toric variety is Fano
      * isFibration(ToricMap) -- whether a
        toric map is a fibration
      * isNef(ToricDivisor) -- whether a
        torus-invariant Weil divisor is nef
      * isProjective(NormalToricVariety)
        -- whether a toric variety is
        projective
      * isProper(ToricMap) -- whether a toric
        map is proper
      * isQQCartier(ToricDivisor), --
        whether a torus-invariant Weil divisor is QQ-Cartier
      * isSimplicial(NormalToricVariety)
        -- whether a normal toric variety
        is simplicial
      * isSmooth(NormalToricVariety),
        -- whether a normal toric variety is smooth
      * isSurjective(ToricMap) -- whether a
        toric map is surjective
      * isVeryAmple(ToricDivisor), --
        whether a torus-invariant Weil divisor is very ample
      * isWellDefined(NormalToricVariety)
        -- whether a toric variety is
        well-defined
      * isWellDefined(ToricDivisor), --
        whether a toric divisor is well-defined
      * isWellDefined(ToricMap) -- whether
        a toric map is well defined
      * kleinschmidt(ZZ,List) -- make any
        smooth normal toric variety having Picard rank two
      * latticePoints(ToricDivisor), --
        compute the lattice points in the associated polytope
      * makeSimplicial(NormalToricVariety)
        -- make a birational simplicial
        toric variety
      * makeSmooth(NormalToricVariety)
        -- make a birational smooth toric
        variety
      * map(NormalToricVariety,NormalToricVariety,Matrix)
        -- make a
        torus-equivariant map between normal toric varieties
      * map(NormalToricVariety,NormalToricVariety,ZZ)
        -- make a
        torus-equivariant map between normal toric varieties
      * matrix(ToricMap) -- get the underlying map
        of lattices
      * max(NormalToricVariety) -- get the
        maximal cones in the associated fan
      * monomials(ToricDivisor) -- list the
        monomials that span the linear series
      * nefCone(NormalToricVariety) (missing documentation)
      * nefGenerators(NormalToricVariety)
        -- compute generators of the nef
        cone
      * NormalToricVariety ** NormalToricVariety
        -- make the Cartesian product of two normal
        toric varieties
      * NormalToricVariety ^ Array -- make a
        canonical projection map
      * NormalToricVariety ^** ZZ -- make
        the Cartesian power of a normal toric variety
      * NormalToricVariety _ Array -- make
        a canonical inclusion into a product
      * NormalToricVariety _ ZZ -- make an
        irreducible torus-invariant divisor
      * normalToricVariety(Fan) -- make a
        normal toric variety from a 'Polyhedra' fan
      * normalToricVariety(List,List)
        -- make a normal toric variety
      * normalToricVariety(Matrix), --
        make a normal toric variety from a polytope
      * normalToricVariety(Polyhedron)
        -- make a normal toric variety from
        a 'Polyhedra' polyhedron
      * normalToricVariety(Ring) -- get
        the associated normal toric variety
      * OO ToricDivisor -- make the associated rank-one
        reflexive sheaf
      * orbits(NormalToricVariety), --
        make a hashtable indexing the torus orbits (a.k.a. cones in the fan)
      * orbits(NormalToricVariety,ZZ)
        -- get a list of the torus orbits
        (a.k.a. cones in the fan) of a given dimension
      * picardGroup(NormalToricVariety)
        -- make the Picard group
      * picardGroup(ToricMap) -- make the
        induced map between Picard groups
      * polytope(ToricDivisor) -- makes the
        associated 'Polyhedra' polyhedron
      * pullback(ToricMap,CoherentSheaf)
        -- make the pullback of a
        coherent sheaf under a toric map
      * "pullback(ToricMap,Module)" -- see
        pullback(ToricMap,CoherentSheaf),
        -- make the pullback of a
        coherent sheaf under a toric map
      * pullback(ToricMap,ToricDivisor)
        -- make the pullback of a
        Cartier divisor under a toric map
      * rays(NormalToricVariety) -- get
        the rays of the associated fan
      * ring(NormalToricVariety) -- make
        the total coordinate ring (a.k.a. Cox ring)
      * sheaf(NormalToricVariety,Module)
        -- make a coherent sheaf
      * "OO _ NormalToricVariety" -- see sheaf(NormalToricVariety,Ring),
        -- make a coherent sheaf of rings
      * "sheaf(NormalToricVariety)" -- see
        sheaf(NormalToricVariety,Ring),
        -- make a coherent sheaf of rings
      * sheaf(NormalToricVariety,Ring)
        -- make a coherent sheaf of rings
      * smallAmpleToricDivisor(ZZ,ZZ)
        -- get a very ample toric divisor
        from the database
      * smoothFanoToricVariety(ZZ,ZZ)
        -- get a smooth Fano toric variety
        from database
      * source(ToricMap) -- get the source of the
        map
      * support(ToricDivisor) -- make the
        list of irreducible divisors with nonzero coefficients
      * target(ToricMap) -- get the target of the
        map
      * todd(CoherentSheaf) -- compute the Todd
        class of a coherent sheaf
      * "todd(NormalToricVariety)" -- see todd(CoherentSheaf),
        -- compute the Todd class of a coherent sheaf
      * "toricBlowup(List,NormalToricVariety)" -- see
        toricBlowup(List,NormalToricVariety,List),
        -- makes the
        toricBlowup of a normal toric variety along a torus orbit closure
      * toricBlowup(List,NormalToricVariety,List)
        -- makes the
        toricBlowup of a normal toric variety along a torus orbit closure
      * ToricDivisor == ToricDivisor, --
        equality of toric divisors
      * "ToricDivisor == ZZ" -- see ToricDivisor == ToricDivisor,
        -- equality of toric divisors
      * "ZZ == ToricDivisor" -- see ToricDivisor == ToricDivisor,
        -- equality of toric divisors
      * toricDivisor(List,NormalToricVariety)
        -- make a torus-invariant
        Weil divisor
      * toricDivisor(NormalToricVariety)
        -- make the canonical divisor
      * toricDivisor(Polyhedron) -- make
        the toric divisor associated to a polyhedron
      * ToricMap * ToricMap -- make the
        composition of two toric maps
      * ToricMap == ToricMap -- whether to toric
        maps are equal
      * toricProjectiveSpace(ZZ) -- make a
        projective space as a normal toric variety
      * "normalToricVariety(ToricDivisor)" -- see variety(ToricDivisor),
        -- get the underlying normal toric variety
      * variety(ToricDivisor) -- get the
        underlying normal toric variety
      * vector(ToricDivisor) -- make the
        vector of coefficients
      * vertices(ToricDivisor) -- compute
        the vertices of the associated polytope
      * weightedProjectiveSpace(List),
        -- make a weighted projective space
      * weilDivisorGroup(NormalToricVariety)
        -- make the group of
        torus-invariant Weil divisors
      * weilDivisorGroup(ToricMap), --
        make the induced map between groups of Weil divisors
  * Symbols
      * "WeilToClass" -- see normalToricVariety(List,List),
        -- make a normal toric variety

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

The object NormalToricVarieties, is a package (Macaulay2Doc),
defined in NormalToricVarieties.m2, with auxiliary
files in NormalToricVarieties/.

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

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:79:0.

abstractSheaf(NormalToricVariety,AbstractVariety,CoherentSheaf) -- make the corresponding abstract sheaf
********************************************************************************************************

  * Function: abstractSheaf (Schubert2),
  * Usage:
        abstractSheaf (X, B, F)
  * Inputs:
      * X, a normal toric variety, that is complete
        and simplicial
      * B, an abstract variety (Schubert2), the base
        variety, when omitted the default base variety of dimension 0 (Schubert2),
        is used
      * F, a coherent sheaf (Varieties), on X
  * Optional inputs (Macaulay2Doc),:
      * Rank (Schubert2),
        => ..., default value null, unused
      * ChernCharacter (Schubert2),
        => ..., default value null, unused
      * ChernClass (Schubert2),
        => ..., default value null, unused
      * Name (Schubert2),
        => ..., default value null, unused
  * Outputs:
      * an abstract sheaf (Schubert2),

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

This method converts a CoherentSheaf (Varieties), over a
NormalToricVariety, into an AbstractSheaf (Schubert2),
over the corresponding AbstractVariety (Schubert2),
as defined in the Schubert2,
package.

Since many routines from the Schubert2, package have been
overloaded so that they apply directly to coherent sheaves on normal toric
varieties, this method is primarily of interest to developers.

We illustrate this methods with some classic coherent sheaves on projective
3-space.

+------------------------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;                                |
+------------------------------------------------------------------+
|i2 : F = OO_PP3 (2) ++ OO_PP3 (5);                                |
+------------------------------------------------------------------+
|i3 : aF = abstractSheaf (PP3, F);                                 |
+------------------------------------------------------------------+
|i4 : chern aF                                                     |
|                                                                  |
|                  2                                               |
|o4 = 1 + 7t  + 10t                                                |
|           3      3                                               |
|                                                                  |
|                     QQ[][t ..t ]                                 |
|                           0   3                                  |
|o4 : -------------------------------------------                  |
|     (t t t t , - t  + t , - t  + t , - t  + t )                  |
|       0 1 2 3     0    1     0    2     0    3                   |
+------------------------------------------------------------------+
|i5 : assert (chern aF === chern (OO_PP3 (2)) * chern (OO_PP3 (5)))|
+------------------------------------------------------------------+
|i6 : assert (chern aF == chern F)                                 |
+------------------------------------------------------------------+
|i7 : Omega = cotangentSheaf PP3;                                  |
+------------------------------------------------------------------+
|i8 : aOmega = abstractSheaf (PP3, Omega);                         |
+------------------------------------------------------------------+
|i9 : chern aOmega                                                 |
|                                                                  |
|                 2     3                                          |
|o9 = 1 - 4t  + 6t  - 4t                                           |
|           3     3     3                                          |
|                                                                  |
|                     QQ[][t ..t ]                                 |
|                           0   3                                  |
|o9 : -------------------------------------------                  |
|     (t t t t , - t  + t , - t  + t , - t  + t )                  |
|       0 1 2 3     0    1     0    2     0    3                   |
+------------------------------------------------------------------+
|i10 : assert (aOmega === cotangentBundle abstractVariety PP3)     |
+------------------------------------------------------------------+

We also provide a similar collection of examples on a larger variety.

+-----------------------------------------------------------------------------+
|i11 : X = smoothFanoToricVariety (5, 100);                                   |
+-----------------------------------------------------------------------------+
|i12 : rank picardGroup X                                                     |
|                                                                             |
|o12 = 6                                                                      |
+-----------------------------------------------------------------------------+
|i13 : nefGenerators X                                                        |
|                                                                             |
|o13 = | 1 0 1 0 0 0  |                                                       |
|      | 1 1 1 0 0 0  |                                                       |
|      | 0 1 1 0 0 0  |                                                       |
|      | 0 0 0 0 0 -1 |                                                       |
|      | 0 0 0 0 1 1  |                                                       |
|      | 0 0 0 1 2 2  |                                                       |
|                                                                             |
|               6       6                                                     |
|o13 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i14 : G = OO_X (1,1,-1,1,1,2) ++ OO_X (1,1,-1,0,0,1);                        |
+-----------------------------------------------------------------------------+
|i15 : aG = abstractSheaf (X, G);                                             |
+-----------------------------------------------------------------------------+
|i16 : A = intersectionRing variety aG;                                       |
+-----------------------------------------------------------------------------+
|i17 : chern aG                                                               |
|                                                                             |
|                                                  2                          |
|o17 = 1 + (2t  + 2t  - 2t  + t  + t  + 3t  ) + (3t  + t t  + t t  - t t  +   |
|             3     5     6    8    9     10       6    3 8    5 8    6 8     |
|      -----------------------------------------------------------------------|
|                                                                        2    |
|      t t  + t t  - t t  + 3t t   + 3t t   - 3t t   + t t   + t t   + 2t  )  |
|       3 9    5 9    6 9     3 10     5 10     6 10    8 10    9 10     10   |
|                                                                             |
|o17 : A                                                                      |
+-----------------------------------------------------------------------------+
|i18 : assert (chern aG === chern (OO_X (1,1,-1,1,1,2)) * chern (OO_X         |
|-----------------------------------------------------------------------------|
|(1,1,-1,0,0,1)))                                                             |
+-----------------------------------------------------------------------------+
|i19 : assert (chern aG == chern G)                                           |
+-----------------------------------------------------------------------------+
|i20 : Omega = cotangentSheaf X;                                              |
+-----------------------------------------------------------------------------+
|i21 : aOmega = abstractSheaf (X, Omega);                                     |
+-----------------------------------------------------------------------------+
|i22 : chern aOmega                                                           |
|                                                                             |
|                                                       2                     |
|o22 = 1 + (- 2t  - 3t  - 2t  + t  - 2t  - 5t  ) + (- 5t  - 2t t  - 3t t  -   |
|               3     5     6    8     9     10         6     3 8     5 8     |
|      -----------------------------------------------------------------------|
|                                                                             |
|      2t t  + 4t t  + 6t t  + 4t t  + 10t t   + 15t t   + 10t t   - 5t t   + |
|        6 8     3 9     5 9     6 9      3 10      5 10      6 10     8 10   |
|      -----------------------------------------------------------------------|
|                  2          2        2        2                             |
|      7t t   + 11t  ) + (- 5t t  + 10t t  + 25t t   + 10t t t   + 15t t t   +|
|        9 10      10         6 8      6 9      6 10      3 8 10      5 8 10  |
|      -----------------------------------------------------------------------|
|                                                           2         2       |
|      10t t t   - 14t t t   - 21t t t   - 14t t t   - 22t t   - 33t t   -    |
|         6 8 10      3 9 10      5 9 10      6 9 10      3 10      5 10      |
|      -----------------------------------------------------------------------|
|           2        2         2           2           2 2           2        |
|      22t t   - 8t t  ) + (25t t t   - 35t t t   - 55t t   + 16t t t   +     |
|         6 10     9 10        6 8 10      6 9 10      6 10      3 9 10       |
|      -----------------------------------------------------------------------|
|             2           2        2   2                                      |
|      24t t t   + 16t t t  ) + 40t t t                                       |
|         5 9 10      6 9 10       6 9 10                                     |
|                                                                             |
|o22 : A                                                                      |
+-----------------------------------------------------------------------------+
|i23 : assert (aOmega === cotangentBundle abstractVariety X)                  |
+-----------------------------------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * abstractSheaf(NormalToricVariety,ToricDivisor),
    --
    make the corresponding abstract sheaf
  * abstractVariety(NormalToricVariety)
    -- make the
    corresponding abstract variety

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

  * abstractSheaf(NormalToricVariety,AbstractVariety,CoherentSheaf),
    --
    make the corresponding abstract sheaf
  * "abstractSheaf(NormalToricVariety,CoherentSheaf)"
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:207:0.

abstractSheaf(NormalToricVariety,AbstractVariety,ToricDivisor) -- make the corresponding abstract sheaf
*******************************************************************************************************

  * Function: abstractSheaf (Schubert2),
  * Usage:
        abstractVariety (X, B, D)
  * Inputs:
      * X, a normal toric variety, that is complete
        and simplicial
      * B, an abstract variety (Schubert2), the base
        variety, when omitted the default base variety of dimension 0 (Schubert2),
        is used
      * D, a toric divisor, on X
  * Optional inputs (Macaulay2Doc),:
      * Rank (Schubert2),
        => ..., default value null, unused
      * ChernCharacter (Schubert2),
        => ..., default value null, unused
      * ChernClass (Schubert2),
        => ..., default value null, unused
      * Name (Schubert2),
        => ..., default value null, unused
  * Outputs:
      * an abstract sheaf (Schubert2),

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

This method converts a ToricDivisor, on a
NormalToricVariety, into an AbstractSheaf (Schubert2),
over the corresponding AbstractVariety (Schubert2),
as defined in the Schubert2,
package.

Since many routines from the Schubert2, package have been
overloaded so that they apply directly to toric divisors, this method is
primarily of interest to developers.

+------------------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 3;                                |
+------------------------------------------------------------------+
|i2 : D1 = abstractSheaf (PP2, PP2_0);                             |
+------------------------------------------------------------------+
|i3 : assert (rank D1 === 1 and variety D1 === abstractVariety PP2)|
+------------------------------------------------------------------+
|i4 : chern D1                                                     |
|                                                                  |
|o4 = 1 + t                                                        |
|          3                                                       |
|                                                                  |
|                     QQ[][t ..t ]                                 |
|                           0   3                                  |
|o4 : -------------------------------------------                  |
|     (t t t t , - t  + t , - t  + t , - t  + t )                  |
|       0 1 2 3     0    1     0    2     0    3                   |
+------------------------------------------------------------------+
|i5 : ch D1                                                        |
|                                                                  |
|              1 2   1 3                                           |
|o5 = 1 + t  + -t  + -t                                            |
|          3   2 3   6 3                                           |
|                                                                  |
|                     QQ[][t ..t ]                                 |
|                           0   3                                  |
|o5 : -------------------------------------------                  |
|     (t t t t , - t  + t , - t  + t , - t  + t )                  |
|       0 1 2 3     0    1     0    2     0    3                   |
+------------------------------------------------------------------+
|i6 : D2 = abstractSheaf (PP2, PP2_1);                             |
+------------------------------------------------------------------+
|i7 : assert (D2 === D1)                                           |
+------------------------------------------------------------------+
+-------------------------------------------------------------------+
|i8 : FF2 = hirzebruchSurface 2                                     |
|                                                                   |
|o8 = FF2                                                           |
|                                                                   |
|o8 : NormalToricVariety                                            |
+-------------------------------------------------------------------+
|i9 : D3 = abstractSheaf (FF2, 2*FF2_2 + FF2_3)                     |
|                                                                   |
|o9 = D3                                                            |
|                                                                   |
|o9 : an abstract sheaf of rank 1 on a variety                      |
+-------------------------------------------------------------------+
|i10 : assert (rank D3 === 1 and variety D3 === abstractVariety FF2)|
+-------------------------------------------------------------------+
|i11 : chern D3                                                     |
|                                                                   |
|o11 = 1 + (2t  + t )                                               |
|             2    3                                                |
|                                                                   |
|                  QQ[][t ..t ]                                     |
|                        0   3                                      |
|o11 : ------------------------------------                         |
|      (t t , t t , t  - t , t  + 2t  - t )                         |
|        0 2   1 3   0    2   1     2    3                          |
+-------------------------------------------------------------------+
|i12 : D4 = abstractSheaf (FF2, 4*FF2_0 + FF2_1)                    |
|                                                                   |
|o12 = D3                                                           |
|                                                                   |
|o12 : an abstract sheaf of rank 1 on a variety                     |
+-------------------------------------------------------------------+
|i13 : assert (D4 === D3)                                           |
+-------------------------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * abstractSheaf(NormalToricVariety,CoherentSheaf),
    --
    make the corresponding abstract sheaf
  * abstractVariety(NormalToricVariety)
    -- make the
    corresponding abstract variety

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

  * abstractSheaf(NormalToricVariety,AbstractVariety,ToricDivisor),
    --
    make the corresponding abstract sheaf
  * "abstractSheaf(NormalToricVariety,ToricDivisor)"
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:265:0.

abstractVariety(NormalToricVariety,AbstractVariety) -- make the corresponding abstract variety
**********************************************************************************************

  * Function: abstractVariety (Schubert2),
  * Usage:
        abstractVariety (X, B)
  * Inputs:
      * X, a normal toric variety, that is complete
        and simplicial
      * B, an abstract variety (Schubert2), the base
        variety, when omitted the default base variety of dimension 0 (Schubert2),
        is used
  * Optional inputs (Macaulay2Doc),:
      * ReturnType (Schubert2), => ...,
        default value AbstractVariety, unused
      * DefaultIntegral (Schubert2), =>
        ..., default value true, unused
  * Outputs:
      * an abstract variety (Schubert2), determined by
        the dimension, of X and its
        rational Chow ring,

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

This method converts a NormalToricVariety, into an
AbstractVariety (Schubert2), as defined in the
Schubert2, package.

Since many routines from the Schubert2, package have been
overloaded so that they apply directly to normal toric varieties, this method
is primarily of interest to developers.

Projective space can be constructed as an AbstractVariety in a few equivalent,
but not identical, ways.

+-----------------------------------------------------+
|i1 : tPP2 = toricProjectiveSpace 2;                  |
+-----------------------------------------------------+
|i2 : aPP2 = abstractVariety tPP2                     |
|                                                     |
|o2 = aPP2                                            |
|                                                     |
|o2 : an abstract variety of dimension 2              |
+-----------------------------------------------------+
|i3 : assert (dim tPP2 === dim aPP2)                  |
+-----------------------------------------------------+
|i4 : intersectionRing aPP2                           |
|                                                     |
|              QQ[][t ..t ]                           |
|                    0   2                            |
|o4 = ------------------------------                  |
|     (t t t , - t  + t , - t  + t )                  |
|       0 1 2     0    1     0    2                   |
|                                                     |
|o4 : QuotientRing                                    |
+-----------------------------------------------------+
|i5 : intersectionRing tPP2                           |
|                                                     |
|              QQ[][t ..t ]                           |
|                    0   2                            |
|o5 = ------------------------------                  |
|     (t t t , - t  + t , - t  + t )                  |
|       0 1 2     0    1     0    2                   |
|                                                     |
|o5 : QuotientRing                                    |
+-----------------------------------------------------+
|i6 : intersectionRing abstractVariety (tPP2, base()) |
|                                                     |
|              QQ[][t ..t ]                           |
|                    0   2                            |
|o6 = ------------------------------                  |
|     (t t t , - t  + t , - t  + t )                  |
|       0 1 2     0    1     0    2                   |
|                                                     |
|o6 : QuotientRing                                    |
+-----------------------------------------------------+
|i7 : intersectionRing abstractVariety (tPP2, base(a))|
|                                                     |
|              QQ[a][t ..t ]                          |
|                     0   2                           |
|o7 = ------------------------------                  |
|     (t t t , - t  + t , - t  + t )                  |
|       0 1 2     0    1     0    2                   |
|                                                     |
|o7 : QuotientRing                                    |
+-----------------------------------------------------+
|i8 : PP2 = toricProjectiveSpace 2                    |
|                                                     |
|o8 = PP2                                             |
|                                                     |
|o8 : NormalToricVariety                              |
+-----------------------------------------------------+
|i9 : intersectionRing PP2                            |
|                                                     |
|              QQ[][t ..t ]                           |
|                    0   2                            |
|o9 = ------------------------------                  |
|     (t t t , - t  + t , - t  + t )                  |
|       0 1 2     0    1     0    2                   |
|                                                     |
|o9 : QuotientRing                                    |
+-----------------------------------------------------+
|i10 : minimalPresentation intersectionRing PP2       |
|                                                     |
|      QQ[t ]                                         |
|          2                                          |
|o10 = ------                                         |
|         3                                           |
|        t                                            |
|         2                                           |
|                                                     |
|o10 : QuotientRing                                   |
+-----------------------------------------------------+
|i11 : minimalPresentation intersectionRing tPP2      |
|                                                     |
|      QQ[t ]                                         |
|          2                                          |
|o11 = ------                                         |
|         3                                           |
|        t                                            |
|         2                                           |
|                                                     |
|o11 : QuotientRing                                   |
+-----------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * intersectionRing(NormalToricVariety) -- make the rational
    Chow ring
  * abstractSheaf(NormalToricVariety,CoherentSheaf),
    --
    make the corresponding abstract sheaf
  * base (Schubert2) -- make an abstract variety from nothing,
    equipped with some parameters and some bundles

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

  * "abstractVariety(NormalToricVariety)"
  * abstractVariety(NormalToricVariety,AbstractVariety)
    -- make the
    corresponding abstract variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:132:0.

affineSpace(ZZ) -- make an affine space as a normal toric variety
*****************************************************************

  * Function: affineSpace,
  * Usage:
        affineSpace d
  * Inputs:
      * d, an integer (Macaulay2Doc), a positive integer
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        that specifies the coefficient ring of the total coordinate ring,
      * Variable => a symbol (Macaulay2Doc), default value x,
        that specifies the base name (Macaulay2Doc), for the
        indexed variables in the total coordinate ring
  * Outputs:
      * a normal toric variety, that is affine
        $d$-space

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

Affine $d$-space is a smooth normal toric variety.  The rays are generated by
the standard basis $e_1, e_2, \dots, e_d$ of $\ZZ^d$, and the maximal cone in
the fan correspond to the $d$-element subsets of $\{ 0, 1, \dots, d-1 \}$.

The examples illustrate the affine line and affine $3$-space.

+-----------------------------------------------------------------------+
|i1 : AA1 = affineSpace 1;                                              |
+-----------------------------------------------------------------------+
|i2 : rays AA1                                                          |
|                                                                       |
|o2 = {{1}}                                                             |
|                                                                       |
|o2 : List                                                              |
+-----------------------------------------------------------------------+
|i3 : max AA1                                                           |
|                                                                       |
|o3 = {{0}}                                                             |
|                                                                       |
|o3 : List                                                              |
+-----------------------------------------------------------------------+
|i4 : dim AA1                                                           |
|                                                                       |
|o4 = 1                                                                 |
+-----------------------------------------------------------------------+
|i5 : assert (isWellDefined AA1 and not isComplete AA1 and isSmooth AA1)|
+-----------------------------------------------------------------------+
+------------------------------------------------------------------------+
|i6 : AA3 = affineSpace (3, CoefficientRing => ZZ/32003, Variable => y); |
+------------------------------------------------------------------------+
|i7 : rays AA3                                                           |
|                                                                        |
|o7 = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}}                                  |
|                                                                        |
|o7 : List                                                               |
+------------------------------------------------------------------------+
|i8 : max AA3                                                            |
|                                                                        |
|o8 = {{0, 1, 2}}                                                        |
|                                                                        |
|o8 : List                                                               |
+------------------------------------------------------------------------+
|i9 : dim AA3                                                            |
|                                                                        |
|o9 = 3                                                                  |
+------------------------------------------------------------------------+
|i10 : ring AA3                                                          |
|                                                                        |
|        ZZ                                                              |
|o10 = -----[y ..y ]                                                     |
|      32003  0   2                                                      |
|                                                                        |
|o10 : PolynomialRing                                                    |
+------------------------------------------------------------------------+
|i11 : assert (isWellDefined AA3 and not isComplete AA3 and isSmooth AA3)|
+------------------------------------------------------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth
  * isComplete(NormalToricVariety),
    -- whether a toric variety is complete
  * makeSmooth(NormalToricVariety),
    -- make a birational smooth toric variety

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

  * affineSpace(ZZ) -- make an affine space as a
    normal toric variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:586:0.

cartesianProduct(Sequence) -- make the Cartesian product of normal toric varieties
**********************************************************************************

  * Function: cartesianProduct,
  * Usage:
        cartesianProduct Seq
  * Inputs:
      * Seq, a sequence (Macaulay2Doc), all of whose elements
        are normal toric varieties; a single normal toric variety is treated as
        a sequence with just one element
  * Outputs:
      * a normal toric variety, the product of
        elements

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

The Cartesian product of varieties $X_0, X_1, X_2, \dots$, all defined over the
same ground field $k$, is the fiber product $X_0 \times_k X_1 \times_k X_2
\times_k \dots$.  For normal toric varieties, the fan of the product is given
by the Cartesian product of the underlying fans of the factors.

+----------------------------------------------------------------------+
|i1 : X = toricProjectiveSpace 1;                                      |
+----------------------------------------------------------------------+
|i2 : Y = toricProjectiveSpace 2;                                      |
+----------------------------------------------------------------------+
|i3 : Z = toricProjectiveSpace 3;                                      |
+----------------------------------------------------------------------+
|i4 : Seq = (X, Y, Z);                                                 |
+----------------------------------------------------------------------+
|i5 : P = cartesianProduct Seq;                                        |
+----------------------------------------------------------------------+
|i6 : dim P                                                            |
|                                                                      |
|o6 = 6                                                                |
+----------------------------------------------------------------------+
|i7 : assert (dim P == 1+2+3)                                          |
+----------------------------------------------------------------------+
|i8 : factors = components P                                           |
|                                                                      |
|o8 = {X, Y, Z}                                                        |
|                                                                      |
|o8 : List                                                             |
+----------------------------------------------------------------------+
|i9 : # factors                                                        |
|                                                                      |
|o9 = 3                                                                |
+----------------------------------------------------------------------+
|i10 : assert (factors#0 === X and factors#1 === Y and factors#2 === Z)|
+----------------------------------------------------------------------+

This general method for constructing products is invoked by all of the other
product constructors.

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties
  * NormalToricVariety ^** ZZ -- make the
    Cartesian power of a normal toric variety
  * normalToricVariety -- make a
    normal toric variety

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

  * "cartesianProduct(NormalToricVariety)"
  * cartesianProduct(Sequence) -- make
    the Cartesian product of normal toric varieties
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1004:0.

cartierDivisorGroup(NormalToricVariety) -- compute the group of torus-invariant Cartier divisors
************************************************************************************************

  * Function: cartierDivisorGroup,
  * Usage:
        cartierDivisorGroup X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a module (Macaulay2Doc), a finitely generated abelian
        group

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

The group of torus-invariant Cartier divisors on $X$ is the subgroup of all
locally principal torus-invariant Weil divisors. On a normal toric variety, the
group of torus-invariant Cartier divisors can be computed as an inverse limit.
More precisely, if $M$ denotes the lattice of characters on $X$ and the maximal
cones in the fan of $X$ are $sigma_0, sigma_1, \dots, sigma_{r-1}$, then we
have $CDiv(X) = ker( \oplus_{i} M/M(sigma_i{}) \to{} \oplus_{i<j} M/M(sigma_i
\cap sigma_j{})$.  For more information, see Theorem 4.2.8 in
Cox-Little-Schenck's Toric Varieties.

When $X$ is smooth, every torus-invariant Weil divisor is Cartier.

+-----------------------------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                                           |
+-----------------------------------------------------------------------------+
|i2 : cartierDivisorGroup PP2                                                 |
|                                                                             |
|       3                                                                     |
|o2 = ZZ                                                                      |
|                                                                             |
|o2 : ZZ-module, free                                                         |
+-----------------------------------------------------------------------------+
|i3 : assert (isSmooth PP2 and weilDivisorGroup PP2 === cartierDivisorGroup   |
|-----------------------------------------------------------------------------|
|PP2)                                                                         |
+-----------------------------------------------------------------------------+
|i4 : assert (id_(cartierDivisorGroup PP2) == fromCDivToWDiv PP2)             |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i5 : FF7 = hirzebruchSurface 7;                                              |
+-----------------------------------------------------------------------------+
|i6 : cartierDivisorGroup FF7                                                 |
|                                                                             |
|       4                                                                     |
|o6 = ZZ                                                                      |
|                                                                             |
|o6 : ZZ-module, free                                                         |
+-----------------------------------------------------------------------------+
|i7 : assert (isSmooth FF7 and weilDivisorGroup FF7 === cartierDivisorGroup   |
|-----------------------------------------------------------------------------|
|FF7)                                                                         |
+-----------------------------------------------------------------------------+
|i8 : assert (id_(cartierDivisorGroup FF7) == fromCDivToWDiv FF7)             |
+-----------------------------------------------------------------------------+

On a simplicial toric variety, every torus-invariant Weil divisor is
$\QQ$-Cartier; every torus-invariant Weil divisor has a positive integer
multiple that is Cartier.

+---------------------------------------------------------------------+
|i9 : U = normalToricVariety ({{4,-1},{0,1}},{{0,1}});                |
+---------------------------------------------------------------------+
|i10 : assert (isSimplicial U and not isSmooth U and not isComplete U)|
+---------------------------------------------------------------------+
|i11 : cartierDivisorGroup U                                          |
|                                                                     |
|        2                                                            |
|o11 = ZZ                                                             |
|                                                                     |
|o11 : ZZ-module, free                                                |
+---------------------------------------------------------------------+
|i12 : weilDivisorGroup U                                             |
|                                                                     |
|        2                                                            |
|o12 = ZZ                                                             |
|                                                                     |
|o12 : ZZ-module, free                                                |
+---------------------------------------------------------------------+
|i13 : prune coker fromCDivToWDiv U                                   |
|                                                                     |
|o13 = cokernel | 4 |                                                 |
|                                                                     |
|                               1                                     |
|o13 : ZZ-module, quotient of ZZ                                      |
+---------------------------------------------------------------------+
|i14 : assert ( (coker fromCDivToWDiv U) ** QQ == 0)                  |
+---------------------------------------------------------------------+
+-----------------------------------------------------------------+
|i15 : X = weightedProjectiveSpace {1,2,2,3,4};                   |
+-----------------------------------------------------------------+
|i16 : assert (isSimplicial X and not isSmooth X and isComplete X)|
+-----------------------------------------------------------------+
|i17 : cartierDivisorGroup X                                      |
|                                                                 |
|        5                                                        |
|o17 = ZZ                                                         |
|                                                                 |
|o17 : ZZ-module, free                                            |
+-----------------------------------------------------------------+
|i18 : weilDivisorGroup X                                         |
|                                                                 |
|        5                                                        |
|o18 = ZZ                                                         |
|                                                                 |
|o18 : ZZ-module, free                                            |
+-----------------------------------------------------------------+
|i19 : prune coker fromCDivToWDiv X                               |
|                                                                 |
|o19 = cokernel | 12 |                                            |
|                                                                 |
|                               1                                 |
|o19 : ZZ-module, quotient of ZZ                                  |
+-----------------------------------------------------------------+
|i20 : assert (rank coker fromCDivToWDiv X === 0)                 |
+-----------------------------------------------------------------+

In general, the Cartier divisors are only a subgroup of the Weil divisors.

+-----------------------------------------------------------------------------+
|i21 : Q = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{1,1,-1}},{{0,1,2,3}});                            |
+-----------------------------------------------------------------------------+
|i22 : assert (not isSimplicial Q and not isComplete Q)                       |
+-----------------------------------------------------------------------------+
|i23 : cartierDivisorGroup Q                                                  |
|                                                                             |
|        3                                                                    |
|o23 = ZZ                                                                     |
|                                                                             |
|o23 : ZZ-module, free                                                        |
+-----------------------------------------------------------------------------+
|i24 : weilDivisorGroup Q                                                     |
|                                                                             |
|        4                                                                    |
|o24 = ZZ                                                                     |
|                                                                             |
|o24 : ZZ-module, free                                                        |
+-----------------------------------------------------------------------------+
|i25 : prune coker fromCDivToWDiv Q                                           |
|                                                                             |
|        1                                                                    |
|o25 = ZZ                                                                     |
|                                                                             |
|o25 : ZZ-module, free                                                        |
+-----------------------------------------------------------------------------+
|i26 : assert (rank coker fromCDivToWDiv Q === 1)                             |
+-----------------------------------------------------------------------------+
+------------------------------------------------------+
|i27 : Y = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));|
+------------------------------------------------------+
|i28 : assert (not isSimplicial Y and isComplete Y)    |
+------------------------------------------------------+
|i29 : cartierDivisorGroup Y                           |
|                                                      |
|        4                                             |
|o29 = ZZ                                              |
|                                                      |
|o29 : ZZ-module, free                                 |
+------------------------------------------------------+
|i30 : weilDivisorGroup Y                              |
|                                                      |
|        8                                             |
|o30 = ZZ                                              |
|                                                      |
|o30 : ZZ-module, free                                 |
+------------------------------------------------------+
|i31 : prune cokernel fromCDivToWDiv Y                 |
|                                                      |
|o31 = cokernel | 2 0 0 |                              |
|               | 0 2 0 |                              |
|               | 0 0 2 |                              |
|               | 0 0 0 |                              |
|               | 0 0 0 |                              |
|               | 0 0 0 |                              |
|               | 0 0 0 |                              |
|                                                      |
|                               7                      |
|o31 : ZZ-module, quotient of ZZ                       |
+------------------------------------------------------+
|i32 : assert (rank coker fromCDivToWDiv Y === 4)      |
+------------------------------------------------------+

To avoid duplicate computations, the attribute is cached in the normal toric
variety.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * fromCDivToWDiv(NormalToricVariety)
    -- get the map from Cartier
    divisors to Weil divisors
  * fromCDivToPic(NormalToricVariety)
    -- get the map from Cartier divisors
    to the Picard group
  * isCartier(ToricDivisor) -- whether a
    torus-invariant Weil divisor is Cartier
  * cartierDivisorGroup(ToricMap), --
    make the induced map between groups of Cartier divisors.

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

  * cartierDivisorGroup(NormalToricVariety)
    -- compute the group of
    torus-invariant Cartier divisors
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:322:0.

cartierDivisorGroup(ToricMap) -- make the induced map between groups of Cartier divisors.
*****************************************************************************************

  * Function: cartierDivisorGroup,
  * Usage:
        cartierDivisorGroup f
  * Inputs:
      * f, a toric map,
  * Outputs:
      * a matrix (Macaulay2Doc), representing the map of abelian
        groups between the corresponding groups of torus-invariant Cartier
        divisors

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

Given a toric map $f : X \to Y$, this method returns the induced map of abelian
groups from the group of torus-invariant Cartier divisors on $Y$ to the group
of torus-invariant Cartier divisors on $X$. In other words, see
cartierDivisorGroup, is a
contravariant functor on the category of normal toric varieties.

We illustrate this method on the projection from the first Hirzebruch surface,
to the projective line.

+-----------------------------------------------------------------------+
|i1 : X = hirzebruchSurface 1;                                          |
+-----------------------------------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;                                       |
+-----------------------------------------------------------------------+
|i3 : f = map(Y, X, matrix {{1, 0}})                                    |
|                                                                       |
|o3 = | 1 0 |                                                           |
|                                                                       |
|o3 : ToricMap Y <--- X                                                 |
+-----------------------------------------------------------------------+
|i4 : f' = cartierDivisorGroup f                                        |
|                                                                       |
|o4 = | 0 1 |                                                           |
|     | 0 0 |                                                           |
|     | 1 0 |                                                           |
|     | 0 0 |                                                           |
|                                                                       |
|              4       2                                                |
|o4 : Matrix ZZ  <-- ZZ                                                 |
+-----------------------------------------------------------------------+
|i5 : assert (isWellDefined f and source f' == cartierDivisorGroup Y and|
|         target f' == cartierDivisorGroup X)                           |
+-----------------------------------------------------------------------+

The induced map between the Picard groups is compatible with the induced map
between the groups of torus-invariant Cartier divisors.

+-----------------------------------------------------------+
|i6 : f'' = picardGroup f                                   |
|                                                           |
|o6 = | 1 |                                                 |
|     | 0 |                                                 |
|                                                           |
|              2       1                                    |
|o6 : Matrix ZZ  <-- ZZ                                     |
+-----------------------------------------------------------+
|i7 : assert(f'' * fromCDivToPic Y == fromCDivToPic X  * f')|
+-----------------------------------------------------------+

Neither the source nor the target of the toric map needs to be smooth.

+---------------------------------------------------------------------------+
|i8 : W = weightedProjectiveSpace {1, 1, 2};                                |
+---------------------------------------------------------------------------+
|i9 : Z = toricBlowup({0, 1, 4}, (W ** toricProjectiveSpace 1), {0, -2, 1});|
+---------------------------------------------------------------------------+
|i10 : assert (not isSmooth W and not isSmooth Z)                           |
+---------------------------------------------------------------------------+
|i11 : g = map(W, Z, matrix{{1,0,0},{0,1,0}})                               |
|                                                                           |
|o11 = | 1 0 0 |                                                            |
|      | 0 1 0 |                                                            |
|                                                                           |
|o11 : ToricMap W <--- Z                                                    |
+---------------------------------------------------------------------------+
|i12 : g' = picardGroup g                                                   |
|                                                                           |
|o12 = | 0  |                                                               |
|      | -1 |                                                               |
|      | 0  |                                                               |
|                                                                           |
|               3       1                                                   |
|o12 : Matrix ZZ  <-- ZZ                                                    |
+---------------------------------------------------------------------------+
|i13 : assert (isWellDefined g and source g' == picardGroup W and           |
|          target g' == picardGroup Z)                                      |
+---------------------------------------------------------------------------+
|i14 : g'' = cartierDivisorGroup g                                          |
|                                                                           |
|o14 = | 0 0  0 |                                                           |
|      | 0 0  0 |                                                           |
|      | 1 0  0 |                                                           |
|      | 0 -1 0 |                                                           |
|      | 0 1  1 |                                                           |
|      | 0 0  0 |                                                           |
|                                                                           |
|               6       3                                                   |
|o14 : Matrix ZZ  <-- ZZ                                                    |
+---------------------------------------------------------------------------+
|i15 : assert(g' * fromCDivToPic W  == fromCDivToPic Z  * g'')              |
+---------------------------------------------------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * cartierDivisorGroup(NormalToricVariety)
    -- compute the group of
    torus-invariant Cartier divisors
  * picardGroup(ToricMap) -- make the induced
    map between Picard groups
  * pullback(ToricMap,ToricDivisor)
    -- make the pullback of a Cartier
    divisor under a toric map

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

  * cartierDivisorGroup(ToricMap), --
    make the induced map between groups of Cartier divisors.
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1390:0.

ch(ZZ,CoherentSheaf) -- compute the Chern character of a coherent sheaf
***********************************************************************

  * Function: ch (Schubert2),
  * Usage:
        ch (i, F)
  * Inputs:
      * i, an integer (Macaulay2Doc), that determines a component of
        the Chern character (optional)
      * F, a coherent sheaf (Varieties), on a complete
        simplicial normal toric variety
  * Outputs:
      * a ring element (Macaulay2Doc), in the intersection
        ring of the underlying variety

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

Given a locally-free sheaf $E$ of rank $r$ on a smooth variety such that its
Chern class formally factor as chern $E = \prod_{j=1}^r (1 + \alpha_j)$, we
define its Chern character to be ch $E := \sum_{j=1}^r exp(\alpha_j)$. The
$i$-th graded piece of this power series is symmetric in the $\alpha_j$ and,
hence, expressible as a polynomial in the elementary symmetric polynomials in
the $\alpha_j$; we set ch $(i, E)$ to be this polynomial. Because the Chern
character is additive on exact sequences of vector bundles and every coherent
sheaf can be resolved by locally-free sheaves, we can extend this definition to
all coherent sheaves.

The first few components of the Chern character are easily related to other
invariants.

+-----------------------------------------------------------------------------+
|i1 : X0 = kleinschmidt(4, {1,2,3});                                          |
+-----------------------------------------------------------------------------+
|i2 : E0 = cotangentSheaf X0                                                  |
|                                                                             |
|o2 = cokernel {2, 0}  | x_2x_3 2x_1x_3 0     0                               |
|              {-4, 2} | x_4    0       0     x_1                             |
|              {-4, 2} | -x_5   0       0     0                               |
|              {-3, 2} | 0      x_4     x_2   0                               |
|              {-3, 2} | 0      -x_5    0     0                               |
|              {-2, 2} | 0      0       -2x_3 -x_3                            |
|              {-2, 2} | 0      0       0     0                               |
|              {-6, 3} | 0      0       -x_5  -x_5                            |
|              {-2, 2} | 0      0       0     0                               |
|              {-2, 2} | 0      0       0     0                               |
|              {-1, 2} | 0      0       0     0                               |
|              {-5, 3} | 0      0       0     0                               |
|              {-1, 2} | 0      0       0     0                               |
|              {0, 2}  | 0      0       0     0                               |
|              {-4, 3} | 0      0       0     0                               |
|              {0, 2}  | 0      0       0     0                               |
|              {-3, 3} | 0      0       0     0                               |
|                                                                             |
|                                           1                                 |
|o2 : coherent sheaf on X0, quotient of OO    (-2,                            |
|                                         X0                                  |
|-----------------------------------------------------------------------------|
|3x_0x_3 x_1x_2 0     0    0     0                                            |
|0       0      0     0    0     2x_0                                         |
|0       0      0     x_1  0     0                                            |
|0       0      0     0    0     0                                            |
|0       0      x_2   0    0     0                                            |
|0       x_4    0     0    0     0                                            |
|x_4     0      0     0    2x_2  0                                            |
|0       0      -x_4  -x_4 0     0                                            |
|-x_5    0      0     0    0     0                                            |
|0       -x_5   -2x_3 -x_3 0     0                                            |
|0       0      0     0    -3x_3 -x_3                                         |
|0       0      0     0    -x_5  -x_5                                         |
|0       0      0     0    0     0                                            |
|0       0      0     0    0     0                                            |
|0       0      0     0    0     0                                            |
|0       0      0     0    0     0                                            |
|0       0      0     0    0     0                                            |
|                                                                             |
|          2                2                                                 |
|0) ++ OO    (4, -2) ++ OO    (3, -2)                                         |
|        X0               X0                                                  |
|-----------------------------------------------------------------------------|
|2x_0x_2 0     0    0     0     x_0x_1 0     0     0     0    0     0    0    |
|0       0     0    0     0     0      0     0     0     0    0     0    0    |
|0       0     2x_0 0     0     0      0     0     0     0    0     0    0    |
|0       0     0    0     x_0   0      0     0     0     0    0     0    0    |
|0       0     0    0     0     0      0     x_0   0     0    0     0    0    |
|0       0     0    0     0     0      0     0     0     x_0  0     0    0    |
|0       0     0    x_1   0     0      0     0     0     0    0     0    0    |
|0       0     0    0     0     0      0     0     0     0    0     0    x_0  |
|0       2x_2  0    0     0     0      x_1   0     0     0    0     0    0    |
|0       0     0    0     0     0      0     0     0     0    0     x_0  0    |
|x_4     0     0    0     0     0      0     0     x_1   0    0     0    0    |
|0       -x_4  -x_4 0     0     0      0     0     0     0    0     0    0    |
|-x_5    -3x_3 -x_3 0     0     0      0     0     0     0    x_1   0    0    |
|0       0     0    -3x_3 -2x_3 x_4    0     0     -2x_2 -x_2 0     0    0    |
|0       0     0    -x_5  -x_5  0      -x_4  -x_4  0     0    0     0    -x_2 |
|0       0     0    0     0     -x_5   -3x_3 -2x_3 0     0    -2x_2 -x_2 0    |
|0       0     0    0     0     0      0     0     -x_5  -x_5 -x_4  -x_4 2x_3 |
|                                                                             |
|       2                1                2                1                1 |
|++ OO    (2, -2) ++ OO    (6, -3) ++ OO    (2, -2) ++ OO    (1, -2) ++ OO    |
|     X0               X0               X0               X0               X0  |
|-----------------------------------------------------------------------------|
|0     |                                                                      |
|0     |                                                                      |
|0     |                                                                      |
|0     |                                                                      |
|0     |                                                                      |
|0     |                                                                      |
|0     |                                                                      |
|0     |                                                                      |
|0     |                                                                      |
|0     |                                                                      |
|0     |                                                                      |
|x_1   |                                                                      |
|0     |                                                                      |
|0     |                                                                      |
|-2x_2 |                                                                      |
|0     |                                                                      |
|3x_3  |                                                                      |
|                                                                             |
|               1                1                1                1          |
|(5, -3) ++ OO    (1, -2) ++ OO    (0, -2) ++ OO    (4, -3) ++ OO    (0, -2)  |
|             X0               X0               X0               X0           |
|-----------------------------------------------------------------------------|
|       1                                                                     |
|++ OO    (3, -3)                                                             |
|     X0                                                                      |
+-----------------------------------------------------------------------------+
|i3 : A0 = intersectionRing X0;                                               |
+-----------------------------------------------------------------------------+
|i4 : ch E0                                                                   |
|                                                                             |
|                            2               2 3     2                        |
|o4 = 4 + (- 4t  - 8t ) + (2t  + 6t t ) + (- -t  - 3t t )                     |
|              3     5       3     3 5       3 3     3 5                      |
|                                                                             |
|o4 : A0                                                                      |
+-----------------------------------------------------------------------------+
|i5 : assert (ch (0, E0) == rank E0 )                                         |
+-----------------------------------------------------------------------------+
|i6 : assert (ch (1, E0) === chern (1, E0))                                   |
+-----------------------------------------------------------------------------+
|i7 : assert (ch (2, E0) === (1/2)*((chern (1, E0))^2 - 2 * chern (2, E0)))   |
+-----------------------------------------------------------------------------+

On a complete smooth normal toric variety, the Chern class of the cotangent
bundle factors as a product over the irreducible torus-invariant divisors, so
we can express the Chern character as a sum.

+-----------------------------------------------------------------------------+
|i8 : X1 = smoothFanoToricVariety (4, 100);                                   |
+-----------------------------------------------------------------------------+
|i9 : E1 = dual cotangentSheaf X1                                             |
|                                                                             |
|o9 = image {0, -2, 0, 0, 0}  | 0         0         0                         |
|           {0, -2, 0, 0, 0}  | 0         0         0                         |
|           {0, -2, 0, 0, 0}  | 0         0         0                         |
|           {-2, 0, 0, 0, -2} | -x_1x_6   x_2x_7    0                         |
|           {0, 1, -2, 0, 0}  | x_0x_5x_8 0         x_2x_5x_7                 |
|           {0, 1, 0, -2, 0}  | 0         x_0x_5x_8 x_1x_5x_6                 |
|           {0, 1, -2, 0, 0}  | x_0x_3x_8 0         x_2x_3x_7                 |
|           {0, 1, 0, -2, 0}  | 0         x_0x_3x_8 x_1x_3x_6                 |
|           {0, 1, -2, 0, 0}  | x_0x_4x_8 0         x_2x_4x_7                 |
|           {0, 1, 0, -2, 0}  | 0         x_0x_4x_8 x_1x_4x_6                 |
|                                                                             |
|                                           3                                 |
|o9 : coherent sheaf on X1, subsheaf of OO    (0, 2, 0, 0, 0)                 |
|                                         X1                                  |
|-----------------------------------------------------------------------------|
|-x_3          x_5           0             |                                  |
|-x_4          0             x_5           |                                  |
|0             -x_4          x_3           |                                  |
|0             0             0             |                                  |
|2x_0x_2x_7x_8 0             0             |                                  |
|2x_0x_1x_6x_8 0             0             |                                  |
|0             2x_0x_2x_7x_8 0             |                                  |
|0             2x_0x_1x_6x_8 0             |                                  |
|0             0             2x_0x_2x_7x_8 |                                  |
|0             0             2x_0x_1x_6x_8 |                                  |
|                                                                             |
|       1                        1                         1                  |
|++ OO    (2, 0, 0, 0, 2) ++ OO    (0, -1, 2, 0, 0) ++ OO    (0, -1, 0, 2, 0) |
|     X1                       X1                        X1                   |
|-----------------------------------------------------------------------------|
|       1                         1                         1                 |
|++ OO    (0, -1, 2, 0, 0) ++ OO    (0, -1, 0, 2, 0) ++ OO    (0, -1, 2, 0, 0)|
|     X1                        X1                        X1                  |
|-----------------------------------------------------------------------------|
|       1                                                                     |
|++ OO    (0, -1, 0, 2, 0)                                                    |
|     X1                                                                      |
+-----------------------------------------------------------------------------+
|i10 : A1 = intersectionRing X1;                                              |
+-----------------------------------------------------------------------------+
|i11 : f1 = ch E1                                                             |
|                                                                             |
|                                                7 2   3 2   1 2              |
|o11 = 4 + (t  + t  + 2t  + t  + 2t ) + (2t t  + -t  + -t  + -t  - t t ) + (- |
|            2    5     6    7     8       2 5   2 5   2 6   2 7    7 8       |
|      -----------------------------------------------------------------------|
|          2   1 3   1 3   1   2   1 3     5 4                                |
|      2t t  - -t  + -t  + -t t  + -t ) + --t                                 |
|        2 5   3 6   6 7   2 7 8   3 8    36 8                                |
|                                                                             |
|o11 : A1                                                                     |
+-----------------------------------------------------------------------------+
|i12 : n = # rays X1                                                          |
|                                                                             |
|o12 = 9                                                                      |
+-----------------------------------------------------------------------------+
|i13 : assert (f1 === (sum(n, i -> ch OO (X1_i)) - (n - dim X1)))             |
+-----------------------------------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * chern(CoherentSheaf) (missing documentation)
  * intersectionRing(NormalToricVariety) -- make the rational
    Chow ring

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

  * "ch(CoherentSheaf)"
  * ch(ZZ,CoherentSheaf) -- compute the
    Chern character of a coherent sheaf
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:446:0.

chern(ZZ,CoherentSheaf) -- compute the Chern class of a coherent sheaf
**********************************************************************

  * Function: chern (Schubert2),
  * Usage:
        chern (i, F)
  * Inputs:
      * i, an integer (Macaulay2Doc), that determines a component of
        the Chern class (optional)
      * F, a coherent sheaf (Varieties), on a complete
        simplicial normal toric variety
  * Outputs:
      * a ring element (Macaulay2Doc), in the intersection
        ring of the underlying variety

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

The total Chern class of a coherent sheaf F on a variety X is defined
axiomatically by an element chern F in the Chow ring, of X
such that the following three conditions hold:

  * For any morphism f : X -> Y, we have chern f^*(F) == f^*(chern F).
  * For each exact sequence 0 -> F' -> F -> F'' -> 0, we have chern F == (chern
    F') * (chern F'').
  * For any divisor D on X, we have chern OO_X (D) == 1 + [D] where [D] denotes
    the divisor class in picardGroup X and we identify the Picard group of X
    with the graded component of the intersection ring having codimension 1.

The i-th component of chern F is chern (i, F), so we obtain chern F == chern
(0, F) + chern (1, F) + ... + chern (dim X, F).

The total Chern class for the tangent bundle on projective space is
particularly simple; the coefficient of i-th component is a binomial
coefficient.

+-------------------------------------------------------------------------+
|i1 : d = 3;                                                              |
+-------------------------------------------------------------------------+
|i2 : PPd = toricProjectiveSpace d;                                       |
+-------------------------------------------------------------------------+
|i3 : A0 = intersectionRing PPd;                                          |
+-------------------------------------------------------------------------+
|i4 : TP = dual cotangentSheaf PPd                                        |
|                                                                         |
|o4 = image {-2} | 0    x_0  x_1 0   |                                    |
|           {-2} | x_1  -x_2 0   0   |                                    |
|           {-2} | x_0  0    x_2 0   |                                    |
|           {-2} | -x_3 0    0   x_2 |                                    |
|           {-2} | 0    -x_3 0   x_1 |                                    |
|           {-2} | 0    0    x_3 x_0 |                                    |
|                                                                         |
|                                             6                           |
|o4 : coherent sheaf on PPd, subsheaf of OO    (2)                        |
|                                          PPd                            |
+-------------------------------------------------------------------------+
|i5 : f0 = chern TP                                                       |
|                                                                         |
|                 2     3                                                 |
|o5 = 1 + 4t  + 6t  + 4t                                                  |
|           3     3     3                                                 |
|                                                                         |
|o5 : A0                                                                  |
+-------------------------------------------------------------------------+
|i6 : assert (A0 === ring f0)                                             |
+-------------------------------------------------------------------------+
|i7 : assert (f0 === (1+A0_0)^(d+1))                                      |
+-------------------------------------------------------------------------+
|i8 : assert all(d, i -> leadCoefficient chern (i, TP) == binomial(d+1,i))|
+-------------------------------------------------------------------------+
|i9 : assert (chern TP === sum (d+1, i -> chern (i, TP)))                 |
+-------------------------------------------------------------------------+

On a complete smooth normal toric variety, the total Chern class of the
cotangent sheaf is a product over the torus-invariant divisors of the total
Chern classes of the inverse of the corresponding line bundles.

+-----------------------------------------------------------------------------+
|i10 : X = smoothFanoToricVariety (4, 50);                                    |
+-----------------------------------------------------------------------------+
|i11 : A = intersectionRing X;                                                |
+-----------------------------------------------------------------------------+
|i12 : Omega = cotangentSheaf X                                               |
|                                                                             |
|o12 = cokernel {2, 0, 0, 0} | 0      x_0x_4x_7 x_0x_3x_6x_7 0                |
|               {0, 0, 2, 0} | x_3x_4 0         0            x_0x_2x_3x_7     |
|               {0, 2, 0, 0} | x_5    0         0            0                |
|               {0, 2, 0, 0} | -x_6   0         0            0                |
|               {0, 0, 0, 2} | 0      x_1       0            0                |
|               {0, 0, 0, 2} | 0      -x_2      0            0                |
|               {0, 0, 0, 2} | 0      0         x_1          x_5              |
|               {0, 0, 0, 2} | 0      0         -x_2         0                |
|               {0, 0, 0, 2} | 0      0         0            -x_6             |
|               {0, 0, 0, 2} | 0      0         0            0                |
|                                                                             |
|                                          1                     1            |
|o12 : coherent sheaf on X, quotient of OO   (-2, 0, 0, 0) ++ OO   (0, 0,     |
|                                         X                     X             |
|-----------------------------------------------------------------------------|
|0            x_0x_3x_5x_7 0         0         0         0         |          |
|x_0x_1x_3x_7 0            0         0         0         0         |          |
|0            0            x_0x_2x_7 x_0x_1x_7 0         0         |          |
|0            0            0         0         x_0x_2x_7 x_0x_1x_7 |          |
|0            0            x_3x_6    0         x_3x_5    0         |          |
|0            0            0         x_3x_6    0         x_3x_5    |          |
|0            0            -x_4      0         0         0         |          |
|x_5          0            0         -x_4      0         0         |          |
|0            x_1          0         0         -x_4      0         |          |
|-x_6         -x_2         0         0         0         -x_4      |          |
|                                                                             |
|             2                     6                                         |
|-2, 0) ++ OO   (0, -2, 0, 0) ++ OO   (0, 0, 0, -2)                           |
|            X                     X                                          |
+-----------------------------------------------------------------------------+
|i13 : f1 = chern Omega                                                       |
|                                                                             |
|                                                            2                |
|o13 = 1 + (- t  - t  - t  - 2t ) + (t t  + t t  + 2t t  + 4t ) + (2t t t  -  |
|              2    4    6     7      2 6    4 6     6 7     7       2 4 6    |
|      -----------------------------------------------------------------------|
|          2     3    16 4                                                    |
|      4t t  - 4t ) + --t                                                     |
|        6 7     7     3 7                                                    |
|                                                                             |
|o13 : A                                                                      |
+-----------------------------------------------------------------------------+
|i14 : assert (f1 ===  product (# rays X, i -> chern OO (-X_i)))              |
+-----------------------------------------------------------------------------+
|i15 : f3 = chern (2, Omega)                                                  |
|                                                                             |
|                              2                                              |
|o15 = t t  + t t  + 2t t  + 4t                                               |
|       2 6    4 6     6 7     7                                              |
|                                                                             |
|o15 : A                                                                      |
+-----------------------------------------------------------------------------+
|i16 : assert (f3 == sum (orbits (X, 2), s -> product (s, i -> A_i)))         |
+-----------------------------------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * intersectionRing(NormalToricVariety) -- make the rational
    Chow ring

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

  * "chern(CoherentSheaf)"
  * chern(ZZ,CoherentSheaf) -- compute
    the Chern class of a coherent sheaf
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:337:0.

chi(CoherentSheaf) -- compute the Euler characteristic of a coherent sheaf
**************************************************************************

  * Function: chi (Macaulay2Doc),
  * Usage:
        chi F
  * Inputs:
      * F, a coherent sheaf (Varieties), on a complete
        simplicial normal toric variety
  * Outputs:
      * a ring element (Macaulay2Doc), in the coefficient
        ring of intersection ring of the underlying variety

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

By definition, the Euler characteristic of coherent sheaf $F$ on a variety $X$
is $\sum_i (-1)^i$ dim $HH^i (X, F)$.  However, this methods uses the
Hirzebruch-Riemann-Roch theorem to calculate the Euler characteristic.

For a nef line bundle on a normal toric variety, the Euler characteristic
equals the number of lattice points in the corresponding polytope.

+----------------------------------------------------------------+
|i1 : X0 = hirzebruchSurface 2;                                  |
+----------------------------------------------------------------+
|i2 : degrees ring X0                                            |
|                                                                |
|o2 = {{1, 0}, {-2, 1}, {1, 0}, {0, 1}}                          |
|                                                                |
|o2 : List                                                       |
+----------------------------------------------------------------+
|i3 : chi OO X0_2                                                |
|                                                                |
|o3 = 2                                                          |
|                                                                |
|o3 : QQ[]                                                       |
+----------------------------------------------------------------+
|i4 : latticePoints X0_2                                         |
|                                                                |
|o4 = | 0 1 |                                                    |
|     | 0 0 |                                                    |
|                                                                |
|              2       2                                         |
|o4 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+
|i5 : assert all ({{1,0},{0,1},{1,1},{2,1},{1,2}}, p -> (        |
|             D := p#0 * X0_2 + p#1 * X0_3;                      |
|             isNef D and chi OO D == rank source latticePoints D|
|             )                                                  |
|         )                                                      |
+----------------------------------------------------------------+
|i6 : chi OO (2 * X0_1)                                          |
|                                                                |
|o6 = -3                                                         |
|                                                                |
|o6 : QQ[]                                                       |
+----------------------------------------------------------------+
|i7 : assert not isNef (2 * X0_1)                                |
+----------------------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * todd(CoherentSheaf) (missing documentation)
  * hilbertPolynomial(NormalToricVariety,CoherentSheaf)
    -- compute the
    multivariate Hilbert polynomial
  * intersectionRing(NormalToricVariety) -- make the rational
    Chow ring

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

  * chi(CoherentSheaf) -- compute the Euler
    characteristic of a coherent sheaf
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:545:0.

Chow ring -- make the rational Chow ring
****************************************

  * Usage:
        intersectionRing (X, B)
        intersectionRing X
  * Inputs:
      * X, a normal toric variety, that is complete
        and simplicial
      * B, an abstract variety (Schubert2), the base
        variety, when omitted the default base variety of dimension 0 (Schubert2),
        is used
  * Outputs:
      * a ring (Macaulay2Doc), the rational Chow ring of X over B

The rational Chow ring of a variety $X$ is an associative commutative ring
graded by codimension.  The $k$-th graded component of this ring is the
rational vector space spanned by the rational equivalence classes of
subvarieties in $X$ having codimension $k$.  For generically transverse
subvarieties $Y$ and $Z$ in $X$, the product satisfies $[Y][Z] = [Y \cap Z]$.

For a complete simplicial normal toric variety, the rational Chow ring has an
explicit presentation.  Specifically, it is the quotient of the polynomial ring
with variables indexed by the set of rays in the underlying fan by the sum of
two ideals.  The first ideal is the Stanley-Reisner ideal of the fan
(equivalently the Alexander dual of the irrelevant ideal)
and the second ideal is generated by linear
forms that encode the rays(NormalToricVariety),
in the fan.  In this context, the rational Chow
ring is isomorphic to the rational cohomology of $X$.

The rational Chow ring of projective space is generated by the rational
equivalence class of a hyperplane.

+-----------------------------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;                                     |
+-----------------------------------------------------------------------+
|i2 : A0 = intersectionRing PP3                                         |
|                                                                       |
|o2 = A0                                                                |
|                                                                       |
|o2 : QuotientRing                                                      |
+-----------------------------------------------------------------------+
|i3 : assert (# rays PP3 === numgens A0)                                |
+-----------------------------------------------------------------------+
|i4 : ideal A0                                                          |
|                                                                       |
|o4 = ideal (t t t t , - t  + t , - t  + t , - t  + t )                 |
|             0 1 2 3     0    1     0    2     0    3                  |
|                                                                       |
|o4 : Ideal of QQ[][t ..t ]                                             |
|                    0   3                                              |
+-----------------------------------------------------------------------+
|i5 : dual monomialIdeal PP3 + ideal ((vars ring PP3) * matrix rays PP3)|
|                                                                       |
|o5 = ideal (x x x x , - x  + x , - x  + x , - x  + x )                 |
|             0 1 2 3     0    1     0    2     0    3                  |
|                                                                       |
|o5 : Ideal of QQ[x ..x ]                                               |
|                  0   3                                                |
+-----------------------------------------------------------------------+
|i6 : minimalPresentation A0                                            |
|                                                                       |
|     QQ[t ]                                                            |
|         3                                                             |
|o6 = ------                                                            |
|        4                                                              |
|       t                                                               |
|        3                                                              |
|                                                                       |
|o6 : QuotientRing                                                      |
+-----------------------------------------------------------------------+
|i7 : for i to dim PP3 list hilbertFunction (i, A0)                     |
|                                                                       |
|o7 = {1, 1, 1, 1}                                                      |
|                                                                       |
|o7 : List                                                              |
+-----------------------------------------------------------------------+

The rational Chow ring for the product of two projective spaces is the tensor
product of the rational Chow rings of the factors.

+-----------------------------------------------------------------------------+
|i8 : X = toricProjectiveSpace (2) ** toricProjectiveSpace (3);               |
+-----------------------------------------------------------------------------+
|i9 : A1 = intersectionRing X                                                 |
|                                                                             |
|o9 = A1                                                                      |
|                                                                             |
|o9 : QuotientRing                                                            |
+-----------------------------------------------------------------------------+
|i10 : assert (# rays X === numgens A1)                                       |
+-----------------------------------------------------------------------------+
|i11 : ideal A1                                                               |
|                                                                             |
|o11 = ideal (t t t , t t t t , - t  + t , - t  + t , - t  + t , - t  + t , - |
|              0 1 2   3 4 5 6     0    1     0    2     3    4     3    5    |
|      -----------------------------------------------------------------------|
|      t  + t )                                                               |
|       3    6                                                                |
|                                                                             |
|o11 : Ideal of QQ[][t ..t ]                                                  |
|                     0   6                                                   |
+-----------------------------------------------------------------------------+
|i12 : minimalPresentation A1                                                 |
|                                                                             |
|      QQ[t , t ]                                                             |
|          2   6                                                              |
|o12 = ----------                                                             |
|         3   4                                                               |
|       (t , t )                                                              |
|         2   6                                                               |
|                                                                             |
|o12 : QuotientRing                                                           |
+-----------------------------------------------------------------------------+
|i13 : for i to dim X list hilbertFunction (i, A1)                            |
|                                                                             |
|o13 = {1, 2, 3, 3, 2, 1}                                                     |
|                                                                             |
|o13 : List                                                                   |
+-----------------------------------------------------------------------------+

We end with a slightly larger example.

+-----------------------------------------------------------------------------+
|i14 : Y = time smoothFanoToricVariety(5,100);                                |
| -- used 0.271351s (cpu); 0.27135s (thread); 0s (gc)                         |
+-----------------------------------------------------------------------------+
|i15 : A2 = intersectionRing Y;                                               |
+-----------------------------------------------------------------------------+
|i16 : assert (# rays Y === numgens A2)                                       |
+-----------------------------------------------------------------------------+
|i17 : ideal A2                                                               |
|                                                                             |
|o17 = ideal (t t , t t , t t , t t , t t , t t , t t , t t , t t t  ,        |
|              2 3   2 5   4 5   3 6   4 6   1 7   7 9   8 9   0 1 10         |
|      -----------------------------------------------------------------------|
|      t t t  , - t  + t  , - t  - t  + t  , t  - t  - t  + t , t  - t  - t , |
|       0 8 10     0    10     1    8    10   2    3    4    6   4    5    6  |
|      -----------------------------------------------------------------------|
|      t  + t  - t  - 2t  )                                                   |
|       7    8    9     10                                                    |
|                                                                             |
|o17 : Ideal of QQ[][t ..t  ]                                                 |
|                     0   10                                                  |
+-----------------------------------------------------------------------------+
|i18 : minimalPresentation A2                                                 |
|                                                                             |
|                                                              QQ[t , t ..t , |
|                                                                  3   5   6  |
|o18 = -----------------------------------------------------------------------|
|        2                 2   2                       2   2                  |
|      (t  + t t , t t  + t , t  + t t , t t , t t  + t , t  - t t  - 3t t   +|
|        3    3 5   3 5    5   5    5 6   3 6   5 6    6   8    8 9     8 10  |
|                                                                             |
|o18 : QuotientRing                                                           |
|-----------------------------------------------------------------------------|
|t ..t  ]                                                                     |
| 8   10                                                                      |
|----------------------------------------------------------------             |
|           2             2                      2     3      2               |
| t t   + 2t  , - t t  + t  + 2t t  , t t , - t t   + t  , t t  )             |
|  9 10     10     8 9    9     9 10   8 9     8 10    10   8 10              |
+-----------------------------------------------------------------------------+
|i19 : for i to dim Y list time hilbertFunction (i, A2)                       |
| -- used 0.00172131s (cpu); 0.00172021s (thread); 0s (gc)                    |
| -- used 0.000146588s (cpu); 0.000146689s (thread); 0s (gc)                  |
| -- used 8.0079e-05s (cpu); 8.0129e-05s (thread); 0s (gc)                    |
| -- used 7.9889e-05s (cpu); 8.005e-05s (thread); 0s (gc)                     |
| -- used 9.5031e-05s (cpu); 9.5262e-05s (thread); 0s (gc)                    |
| -- used 7.8998e-05s (cpu); 7.9138e-05s (thread); 0s (gc)                    |
|                                                                             |
|o19 = {1, 6, 13, 13, 6, 1}                                                   |
|                                                                             |
|o19 : List                                                                   |
+-----------------------------------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * abstractVariety(NormalToricVariety)
    -- make the
    corresponding abstract variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:77:0.

classGroup(NormalToricVariety) -- make the class group
******************************************************

  * Function: classGroup,
  * Usage:
        classGroup X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a module (Macaulay2Doc), a finitely generated abelian
        group

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

The class group of a variety is the group of Weil divisors divided by the
subgroup of principal divisors.  For a normal toric variety, the class group
has a presentation defined by the map from the group of torus-characters to
group of torus-invariant Weil divisors induced by minimal nonzero lattice
points on the rays of the associated fan.  For more information, see Theorem
4.1.3 in Cox-Little-Schenck's Toric Varieties.

The following examples illustrate some possible class groups.

+-------------------------------------------------------------+
|i1 : classGroup toricProjectiveSpace 1                       |
|                                                             |
|       1                                                     |
|o1 = ZZ                                                      |
|                                                             |
|o1 : ZZ-module, free                                         |
+-------------------------------------------------------------+
|i2 : classGroup hirzebruchSurface 7                          |
|                                                             |
|       2                                                     |
|o2 = ZZ                                                      |
|                                                             |
|o2 : ZZ-module, free                                         |
+-------------------------------------------------------------+
|i3 : classGroup affineSpace 3                                |
|                                                             |
|o3 = 0                                                       |
|                                                             |
|o3 : ZZ-module                                               |
+-------------------------------------------------------------+
|i4 : classGroup normalToricVariety ({{4,-1},{0,1}},{{0,1}})  |
|                                                             |
|o4 = cokernel | 4 |                                          |
|                                                             |
|                              1                              |
|o4 : ZZ-module, quotient of ZZ                               |
+-------------------------------------------------------------+
|i5 : classGroup normalToricVariety ( id_(ZZ^3) | - id_(ZZ^3))|
|                                                             |
|o5 = cokernel | 2 0 |                                        |
|              | 0 2 |                                        |
|              | 0 0 |                                        |
|              | 0 0 |                                        |
|              | 0 0 |                                        |
|              | 0 0 |                                        |
|              | 0 0 |                                        |
|                                                             |
|                              7                              |
|o5 : ZZ-module, quotient of ZZ                               |
+-------------------------------------------------------------+

The total coordinate ring, of a toric
variety is graded by its class group.

+----------------------------------------+
|i6 : degrees ring toricProjectiveSpace 1|
|                                        |
|o6 = {{1}, {1}}                         |
|                                        |
|o6 : List                               |
+----------------------------------------+
|i7 : degrees ring hirzebruchSurface 7   |
|                                        |
|o7 = {{1, 0}, {-7, 1}, {1, 0}, {0, 1}}  |
|                                        |
|o7 : List                               |
+----------------------------------------+
|i8 : degrees ring affineSpace 3         |
|                                        |
|o8 = {{}, {}, {}}                       |
|                                        |
|o8 : List                               |
+----------------------------------------+

To avoid duplicate computations, the attribute is cached in the normal toric
variety.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * weilDivisorGroup(NormalToricVariety)
    -- make the group of
    torus-invariant Weil divisors
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
  * fromPicToCl(NormalToricVariety),
    -- get the map from Picard group to class group
  * fromWDivToCl(NormalToricVariety)
    -- get the map from the group of Weil
    divisors to the class group
  * classGroup(ToricMap) -- make the induced
    map between class groups

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

  * classGroup(NormalToricVariety),
    -- make the class group
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:115:0.

classGroup(ToricMap) -- make the induced map between class groups
*****************************************************************

  * Function: classGroup,
  * Usage:
        classGroup f
  * Inputs:
      * f, a toric map, with a smooth target
  * Outputs:
      * a matrix (Macaulay2Doc), representing the map of abelian
        groups between the corresponding class groups

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

Given a toric map $f : X \to Y$ where $Y$ a smooth toric variety, this method
returns the induced map of abelian groups from the class group of $Y$ to the
class group of $X$.  For arbitrary normal toric varieties, the
classGroup, is not a functor.  However,
see classGroup, is a contravariant
functor on the category of smooth,
normal toric varieties.

We illustrate this method on the projection from the first Hirzebruch surface,
to the projective line.

+--------------------------------------------------------------+
|i1 : X = hirzebruchSurface 1;                                 |
+--------------------------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;                              |
+--------------------------------------------------------------+
|i3 : f = map(Y, X, matrix {{1, 0}})                           |
|                                                              |
|o3 = | 1 0 |                                                  |
|                                                              |
|o3 : ToricMap Y <--- X                                        |
+--------------------------------------------------------------+
|i4 : f' = classGroup f                                        |
|                                                              |
|o4 = | 1 |                                                    |
|     | 0 |                                                    |
|                                                              |
|              2       1                                       |
|o4 : Matrix ZZ  <-- ZZ                                        |
+--------------------------------------------------------------+
|i5 : assert (isWellDefined f and source f' == classGroup Y and|
|         target f' == classGroup X)                           |
+--------------------------------------------------------------+

The induced map between the class groups is compatible with the induced map
between the groups of torus-invariant Weil divisors.

+----------------------------------------------------------+
|i6 : f'' = weilDivisorGroup f                             |
|                                                          |
|o6 = | 0 1 |                                              |
|     | 0 0 |                                              |
|     | 1 0 |                                              |
|     | 0 0 |                                              |
|                                                          |
|              4       2                                   |
|o6 : Matrix ZZ  <-- ZZ                                    |
+----------------------------------------------------------+
|i7 : assert(f' * fromWDivToCl Y  == fromWDivToCl X  * f'')|
+----------------------------------------------------------+

The source of the toric map need not be smooth.

+---------------------------------------------------------------+
|i8 : Z = toricBlowup({0, 1}, X, {1,2});                        |
+---------------------------------------------------------------+
|i9 : assert (isWellDefined Z and not isSmooth Z)               |
+---------------------------------------------------------------+
|i10 : g = map(Y, Z, matrix{{1, 0}})                            |
|                                                               |
|o10 = | 1 0 |                                                  |
|                                                               |
|o10 : ToricMap Y <--- Z                                        |
+---------------------------------------------------------------+
|i11 : g' = classGroup g                                        |
|                                                               |
|o11 = | 1 |                                                    |
|      | 0 |                                                    |
|      | 0 |                                                    |
|                                                               |
|               3       1                                       |
|o11 : Matrix ZZ  <-- ZZ                                        |
+---------------------------------------------------------------+
|i12 : g'' = weilDivisorGroup g                                 |
|                                                               |
|o12 = | 0 1 |                                                  |
|      | 0 0 |                                                  |
|      | 1 0 |                                                  |
|      | 0 0 |                                                  |
|      | 0 1 |                                                  |
|                                                               |
|               5       2                                       |
|o12 : Matrix ZZ  <-- ZZ                                        |
+---------------------------------------------------------------+
|i13 : assert(g' * fromWDivToCl Y == fromWDivToCl Z  * g'')     |
+---------------------------------------------------------------+
|i14 : assert (isWellDefined g and source g' == classGroup Y and|
|          target g' == classGroup Z)                           |
+---------------------------------------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * classGroup(NormalToricVariety),
    -- make the class group
  * weilDivisorGroup(ToricMap) -- make
    the induced map between groups of Weil divisors
  * picardGroup(ToricMap) -- make the induced
    map between Picard groups
  * pullback(ToricMap,ToricDivisor)
    -- make the pullback of a Cartier
    divisor under a toric map

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

  * classGroup(ToricMap) -- make the induced
    map between class groups
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1272:0.

components(NormalToricVariety) -- list the factors in a product
***************************************************************

  * Function: components (Macaulay2Doc),
  * Usage:
        components X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a list (Macaulay2Doc), of the factors from which the
        product was form or just \{X\} if X was not formed by a Cartesian
        product

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

The Cartesian product of varieties $X_0, X_1, X_2, ...$, all defined over the
same ground field $k$, is the fiber product $X_0 \times_k X_1 \times_k X_2
\times_k ...$.  For normal toric varieties, the fan of the product is given by
the Cartesian product of the underlying fans of the factors.

+--------------------------------+
|i1 : X = toricProjectiveSpace 1;|
+--------------------------------+
|i2 : Y = toricProjectiveSpace 2;|
+--------------------------------+
|i3 : Z = toricProjectiveSpace 3;|
+--------------------------------+
|i4 : Seq = (X, Y, Z);           |
+--------------------------------+
|i5 : P = cartesianProduct Seq;  |
+--------------------------------+
|i6 : dim P                      |
|                                |
|o6 = 6                          |
+--------------------------------+
|i7 : assert (dim P == 1+2+3)    |
+--------------------------------+

The factors are cached and can be accessed with components (Macaulay2Doc).

+----------------------------------------------------------------------+
|i8 : factors = components P                                           |
|                                                                      |
|o8 = {X, Y, Z}                                                        |
|                                                                      |
|o8 : List                                                             |
+----------------------------------------------------------------------+
|i9 : # factors                                                        |
|                                                                      |
|o9 = 3                                                                |
+----------------------------------------------------------------------+
|i10 : assert (factors#0 === X and factors#1 === Y and factors#2 === Z)|
+----------------------------------------------------------------------+

See also
========

  * cartesianProduct(Sequence) -- make
    the Cartesian product of normal toric varieties
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties
  * components (Macaulay2Doc) -- list the components of a
    direct sum

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

  * components(NormalToricVariety),
    -- list the factors in a product
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:959:0.

cotangentSheaf(NormalToricVariety) -- make the sheaf of Zariski 1-forms
***********************************************************************

  * Function: cotangentSheaf (Varieties),
  * Usage:
        cotangentSheaf X
  * Inputs:
      * X, a normal toric variety,
  * Optional inputs (Macaulay2Doc),:
      * MinimalGenerators (Varieties), => a Boolean value (Macaulay2Doc),
        default value true, that specifies
        whether to apply minimalPresentation (Macaulay2Doc),
        to the result before returning it
      * Strategy (Varieties), => ..., default value null,
  * Outputs:
      * a coherent sheaf (Varieties), the sheaf of Zariski
        1-forms on X

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

For a normal variety, the sheaf of Zariski 1-forms is defined to be the double
dual of the cotangent bundle or equivalently the extension of the sheaf of
1-forms on the smooth locus to the entire variety (the complement of the smooth
locus has codimension at least two because the variety is normal).  By
construction, this sheaf is reflexive with rank equal to the dimension of the
variety.  When the underlying variety is smooth, this is simple the sheaf of
1-forms or the cotangent bundle.  For more information, see Theorem 8.1.5 in
Cox-Little-Schenck's Toric Varieties.

On a non-degenerate normal toric variety, the sheaf of Zariski 1-forms is
associated to the kernel of a map from the character lattice tensor the total
coordinate ring to the direct sum over the rays of the quotient of the
total coordinate ring, by the ideal generated by
the corresponding variable.

+-----------------------------------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;                                           |
+-----------------------------------------------------------------------------+
|i2 : OmegaPP3 = cotangentSheaf PP3                                           |
|                                                                             |
|o2 = cokernel {2} | x_2  0    0    x_3  |                                    |
|              {2} | x_0  x_3  0    0    |                                    |
|              {2} | -x_1 0    x_3  0    |                                    |
|              {2} | 0    x_1  x_0  0    |                                    |
|              {2} | 0    -x_2 0    x_0  |                                    |
|              {2} | 0    0    -x_2 -x_1 |                                    |
|                                                                             |
|                                             6                               |
|o2 : coherent sheaf on PP3, quotient of OO    (-2)                           |
|                                          PP3                                |
+-----------------------------------------------------------------------------+
|i3 : assert (prune cotangentSheaf PP3 === cotangentSheaf (PP3,               |
|-----------------------------------------------------------------------------|
|MinimalGenerators => true))                                                  |
+-----------------------------------------------------------------------------+
|i4 : L = prune exteriorPower (3, OmegaPP3)                                   |
|                                                                             |
|          1                                                                  |
|o4 = OO    (-4)                                                              |
|       PP3                                                                   |
|                                                                             |
|o4 : coherent sheaf on PP3, free of rank 1                                   |
+-----------------------------------------------------------------------------+
|i5 : assert (L === OO toricDivisor PP3)                                      |
+-----------------------------------------------------------------------------+
|i6 : assert (L === prune cotangentSheaf (dim PP3, PP3))                      |
+-----------------------------------------------------------------------------+
+------------------------------------------------------------------+
|i7 : X = hirzebruchSurface 2;                                     |
+------------------------------------------------------------------+
|i8 : OmegaX = cotangentSheaf X                                    |
|                                                                  |
|o8 = cokernel {2, 0}  | 2x_1x_3 |                                 |
|              {-1, 2} | x_0     |                                 |
|              {-1, 2} | -x_2    |                                 |
|                                                                  |
|                                         1               2        |
|o8 : coherent sheaf on X, quotient of OO   (-2, 0) ++ OO   (1, -2)|
|                                        X               X         |
+------------------------------------------------------------------+
|i9 : L = prune exteriorPower(dim X, OmegaX)                       |
|                                                                  |
|        1                                                         |
|o9 = OO   (0, -2)                                                 |
|       X                                                          |
|                                                                  |
|o9 : coherent sheaf on X, free of rank 1                          |
+------------------------------------------------------------------+
|i10 : assert (L === OO toricDivisor X)                            |
+------------------------------------------------------------------+
|i11 : assert (L === prune cotangentSheaf(dim X, X))               |
+------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i12 : Y = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{0,-1,-1},{-1,0,-1},{-2,-1,0}},                    |
|-----------------------------------------------------------------------------|
|{{0,1,2},{0,1,3},{1,3,4},{1,2,4},{2,4,5},{0,2,5},{0,3,5},{3,4,5}});          |
+-----------------------------------------------------------------------------+
|i13 : assert (not isSmooth Y and not isProjective Y)                         |
+-----------------------------------------------------------------------------+
|i14 : OmegaY = cotangentSheaf Y                                              |
|                                                                             |
|o14 = cokernel {2, 0, 2} | x_2x_4  2x_0x_4 0       0    0                    |
|               {2, 2, 0} | -x_1x_5 0       x_0x_5  0    0                    |
|               {0, 2, 3} | 0       -x_1x_3 -x_2x_3 0    3x_1x_2              |
|               {2, 2, 2} | x_3     0       0       3x_0 0                    |
|               {2, 2, 3} | 0       -x_5    0       0    0                    |
|               {2, 2, 3} | 0       0       -x_4    0    0                    |
|               {2, 2, 4} | 0       0       0       -x_4 2x_4                 |
|               {2, 3, 3} | 0       0       0       -x_5 -x_5                 |
|               {3, 2, 3} | 0       0       0       0    0                    |
|                                                                             |
|                                          1                   1              |
|o14 : coherent sheaf on Y, quotient of OO   (-2, 0, -2) ++ OO                |
|                                         Y                   Y               |
|-----------------------------------------------------------------------------|
|0     3x_0x_2 0     0       |                                                |
|0     0       0     3x_0x_1 |                                                |
|0     0       0     0       |                                                |
|0     0       0     0       |                                                |
|0     0       3x_2  0       |                                                |
|3x_1  0       0     0       |                                                |
|-2x_3 x_3     0     0       |                                                |
|0     0       x_3   -x_3    |                                                |
|-x_5  -x_5    -2x_4 -x_4    |                                                |
|                                                                             |
|                  1                   1                    2                 |
|(-2, -2, 0) ++ OO   (0, -2, -3) ++ OO   (-2, -2, -2) ++ OO   (-2, -2, -3) ++ |
|                 Y                   Y                    Y                  |
|-----------------------------------------------------------------------------|
|   1                    1                    1                               |
|OO   (-2, -2, -4) ++ OO   (-2, -3, -3) ++ OO   (-3, -2, -3)                  |
|  Y                    Y                    Y                                |
+-----------------------------------------------------------------------------+
|i15 : prune exteriorPower(dim Y, OmegaY)                                     |
|                                                                             |
|         1                                                                   |
|o15 = OO   (-3, -3, -4)                                                      |
|        Y                                                                    |
|                                                                             |
|o15 : coherent sheaf on Y, free of rank 1                                    |
+-----------------------------------------------------------------------------+
|i16 : assert (prune exteriorPower(dim Y, OmegaY) === OO toricDivisor Y)      |
+-----------------------------------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * sheaf(NormalToricVariety,Module)
    -- make a coherent sheaf

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

  * "cotangentSheaf(List,NormalToricVariety)"
  * cotangentSheaf(NormalToricVariety)
    -- make the sheaf of Zariski
    1-forms
  * "cotangentSheaf(ZZ,NormalToricVariety)"
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/SheavesDocumentation.m2:397:0.

ctop(CoherentSheaf) -- compute the top Chern class of a coherent sheaf
**********************************************************************

  * Function: ctop (Schubert2),
  * Usage:
        ctop F
  * Inputs:
      * F, a coherent sheaf (Varieties), on a complete
        simplicial normal toric variety
  * Outputs:
      * a ring element (Macaulay2Doc), in the intersection
        ring of the underlying variety

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

For a coherent sheaf F on a variety X, the top Chern class is chern (dim X, F).

On projective space, the coefficient of the top Chern class of the tangent
bundle is the 1 plus dimension of the variety.

+-----------------------------------------------------------------------------+
|i1 : X0 = toricProjectiveSpace 5;                                            |
+-----------------------------------------------------------------------------+
|i2 : A0 = intersectionRing X0;                                               |
+-----------------------------------------------------------------------------+
|i3 : ctop dual cotangentSheaf X0                                             |
|                                                                             |
|       5                                                                     |
|o3 = 6t                                                                      |
|       5                                                                     |
|                                                                             |
|o3 : A0                                                                      |
+-----------------------------------------------------------------------------+
|i4 : assert all (5, d -> (leadCoefficient ctop dual cotangentSheaf           |
|-----------------------------------------------------------------------------|
|toricProjectiveSpace (d+1)) == d+2)                                          |
+-----------------------------------------------------------------------------+
|i5 : assert all (5, d -> (                                                   |
|             F := dual cotangentSheaf toricProjectiveSpace (d+1);            |
|             chern (d+1, F) === ctop F                                       |
|             )                                                               |
|         )                                                                   |
+-----------------------------------------------------------------------------+

On a complete smooth normal toric variety, the top Chern class is a sum of the
classes corresponding to maximal cones in the underlying fan.

+-----------------------------------------------------------------------------+
|i6 : X1 = smoothFanoToricVariety (4, 50);                                    |
+-----------------------------------------------------------------------------+
|i7 : A1 = intersectionRing X1;                                               |
+-----------------------------------------------------------------------------+
|i8 : E1 = cotangentSheaf X1                                                  |
|                                                                             |
|o8 = cokernel {2, 0, 0, 0} | 0      x_0x_4x_7 x_0x_3x_6x_7 0                 |
|              {0, 0, 2, 0} | x_3x_4 0         0            x_0x_2x_3x_7      |
|              {0, 2, 0, 0} | x_5    0         0            0                 |
|              {0, 2, 0, 0} | -x_6   0         0            0                 |
|              {0, 0, 0, 2} | 0      x_1       0            0                 |
|              {0, 0, 0, 2} | 0      -x_2      0            0                 |
|              {0, 0, 0, 2} | 0      0         x_1          x_5               |
|              {0, 0, 0, 2} | 0      0         -x_2         0                 |
|              {0, 0, 0, 2} | 0      0         0            -x_6              |
|              {0, 0, 0, 2} | 0      0         0            0                 |
|                                                                             |
|                                           1                      1          |
|o8 : coherent sheaf on X1, quotient of OO    (-2, 0, 0, 0) ++ OO    (0,      |
|                                         X1                     X1           |
|-----------------------------------------------------------------------------|
|0            x_0x_3x_5x_7 0         0         0         0         |          |
|x_0x_1x_3x_7 0            0         0         0         0         |          |
|0            0            x_0x_2x_7 x_0x_1x_7 0         0         |          |
|0            0            0         0         x_0x_2x_7 x_0x_1x_7 |          |
|0            0            x_3x_6    0         x_3x_5    0         |          |
|0            0            0         x_3x_6    0         x_3x_5    |          |
|0            0            -x_4      0         0         0         |          |
|x_5          0            0         -x_4      0         0         |          |
|0            x_1          0         0         -x_4      0         |          |
|-x_6         -x_2         0         0         0         -x_4      |          |
|                                                                             |
|                 2                      6                                    |
|0, -2, 0) ++ OO    (0, -2, 0, 0) ++ OO    (0, 0, 0, -2)                      |
|               X1                     X1                                     |
+-----------------------------------------------------------------------------+
|i9 : f1 = ctop E1                                                            |
|                                                                             |
|     16 4                                                                    |
|o9 = --t                                                                     |
|      3 7                                                                    |
|                                                                             |
|o9 : A1                                                                      |
+-----------------------------------------------------------------------------+
|i10 : assert (f1 === sum(max X1, s -> product(s, i -> -A1_i)))               |
+-----------------------------------------------------------------------------+
|i11 : assert (f1 === chern (dim X1, E1))                                     |
+-----------------------------------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * chern(CoherentSheaf) (missing documentation)
  * intersectionRing(NormalToricVariety) -- make the rational
    Chow ring

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

  * ctop(CoherentSheaf) -- compute the top
    Chern class of a coherent sheaf
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:385:0.

degree(ToricDivisor) -- make the degree of the associated rank-one reflexive sheaf
**********************************************************************************

  * Function: degree (Macaulay2Doc),
  * Usage:
        degree D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a list (Macaulay2Doc), of integers (Macaulay2Doc),
        corresponding to the degree of the rank-one reflexive sheaf

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

This function returns the List (Macaulay2Doc), representing an
element of the Picard group corresponding to the associated rank-one reflexive
sheaf.

Here are two simple examples.

+------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;        |
+------------------------------------------+
|i2 : D1 = PP2_0                           |
|                                          |
|o2 = PP2                                  |
|        0                                 |
|                                          |
|o2 : ToricDivisor on PP2                  |
+------------------------------------------+
|i3 : degree D1                            |
|                                          |
|o3 = {1}                                  |
|                                          |
|o3 : List                                 |
+------------------------------------------+
|i4 : OO D1                                |
|                                          |
|          1                               |
|o4 = OO    (1)                            |
|       PP2                                |
|                                          |
|o4 : coherent sheaf on PP2, free of rank 1|
+------------------------------------------+
|i5 : D2 = 3*PP2_1                         |
|                                          |
|o5 = 3*PP2                                |
|          1                               |
|                                          |
|o5 : ToricDivisor on PP2                  |
+------------------------------------------+
|i6 : degree D2                            |
|                                          |
|o6 = {3}                                  |
|                                          |
|o6 : List                                 |
+------------------------------------------+
|i7 : OO D2                                |
|                                          |
|          1                               |
|o7 = OO    (3)                            |
|       PP2                                |
|                                          |
|o7 : coherent sheaf on PP2, free of rank 1|
+------------------------------------------+
+-------------------------------------------+
|i8 : FF2 = hirzebruchSurface 2;            |
+-------------------------------------------+
|i9 : D3 = -1*FF2_2 + 3*FF2_3               |
|                                           |
|o9 = - FF2  + 3*FF2                        |
|          2        3                       |
|                                           |
|o9 : ToricDivisor on FF2                   |
+-------------------------------------------+
|i10 : degree D3                            |
|                                           |
|o10 = {-1, 3}                              |
|                                           |
|o10 : List                                 |
+-------------------------------------------+
|i11 : OO D3                                |
|                                           |
|           1                               |
|o11 = OO     (-1, 3)                       |
|        FF2                                |
|                                           |
|o11 : coherent sheaf on FF2, free of rank 1|
+-------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * OO ToricDivisor -- make the associated rank-one
    reflexive sheaf
  * picardGroup(NormalToricVariety),
    -- make the Picard group

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

  * degree(ToricDivisor) -- make the degree of
    the associated rank-one reflexive sheaf
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:967:0.

diagonalToricMap -- make a diagonal map into a Cartesian product
****************************************************************

  * Usage:
        diagonalToricMap X
        diagonalToricMap(X,m)
        diagonalToricMap(X,m,A)
  * Inputs:
      * X, a normal toric variety,
      * m, an integer (Macaulay2Doc), that is positive
      * A, an array (Macaulay2Doc), whose entries index factors in
        the m-ary product of X
  * Outputs:
      * a toric map, that is a diagonal map from X into the
        m-ary Cartesian product of X with itself; the optional argument A
        indexes factors in the product

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

Given a positive integer m and a normal toric variety X, the diagonal morphism
is the toric map from X to the m-ary Cartesian product of X such that it
composes to the identity with the i-th projection map,
for all i in A, and compose to the zero map with the i-th projection
maps for all i not in A.

The most important example arises when m = 2.  For this case, one may omit both
m and A.

+-----------------------------------------------------------------------------+
|i1 : X = hirzebruchSurface 1;                                                |
+-----------------------------------------------------------------------------+
|i2 : delta = diagonalToricMap X                                              |
|                                                                             |
|o2 = | 1 0 |                                                                 |
|     | 0 1 |                                                                 |
|     | 1 0 |                                                                 |
|     | 0 1 |                                                                 |
|                                                                             |
|o2 : ToricMap normalToricVariety ({{1, 0, 0, 0}, {0, 1, 0, 0}, {-1, 1, 0, 0},|
|-----------------------------------------------------------------------------|
|{0, -1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {0, 0, -1, 1}, {0, 0, 0, -1}},    |
|-----------------------------------------------------------------------------|
|{{0, 1, 4, 5}, {0, 1, 4, 7}, {0, 1, 5, 6}, {0, 1, 6, 7}, {0, 3, 4, 5}, {0, 3,|
|-----------------------------------------------------------------------------|
|4, 7}, {0, 3, 5, 6}, {0, 3, 6, 7}, {1, 2, 4, 5}, {1, 2, 4, 7}, {1, 2, 5, 6}, |
|-----------------------------------------------------------------------------|
|{1, 2, 6, 7}, {2, 3, 4, 5}, {2, 3, 4, 7}, {2, 3, 5, 6}, {2, 3, 6, 7}}) <--- X|
+-----------------------------------------------------------------------------+
|i3 : assert (isWellDefined delta and source delta === X and target delta === |
|-----------------------------------------------------------------------------|
|X ^** 2)                                                                     |
+-----------------------------------------------------------------------------+
|i4 : S = ring target delta;                                                  |
+-----------------------------------------------------------------------------+
|i5 : I = ideal delta                                                         |
|                                                                             |
|o5 = ideal (x x  - x x , x x x  - x x x , x x x  - x x x )                   |
|             2 4    0 6   3 5 6    1 2 7   3 4 5    0 1 7                    |
|                                                                             |
|o5 : Ideal of S                                                              |
+-----------------------------------------------------------------------------+
|i6 : assert (codim I === dim X)                                              |
+-----------------------------------------------------------------------------+
|i7 : X2 = target delta;                                                      |
+-----------------------------------------------------------------------------+
|i8 : assert (X2^[0] * delta == id_X and X2^[1] * delta == id_X)              |
+-----------------------------------------------------------------------------+
|i9 : assert (delta == diagonalToricMap(X,2) and delta ==                     |
|-----------------------------------------------------------------------------|
|diagonalToricMap(X,2,[0,1]))                                                 |
+-----------------------------------------------------------------------------+

We may also recover the canonical inclusions.

+--------------------------------------------------+
|i10 : X2 = target delta;                          |
+--------------------------------------------------+
|i11 : assert (X2_[0] == diagonalToricMap(X,2,[0]))|
+--------------------------------------------------+
|i12 : assert (X2_[1] == diagonalToricMap(X,2,[1]))|
+--------------------------------------------------+

When there are more than to factors, a diagonal can map to any subset of the
factors.  By omitting A, we obtain the large diagonal.

+-----------------------------------------------------------------------------+
|i13 : m = 3;                                                                 |
+-----------------------------------------------------------------------------+
|i14 : largeD = diagonalToricMap(X, m)                                        |
|                                                                             |
|o14 = | 1 0 |                                                                |
|      | 0 1 |                                                                |
|      | 1 0 |                                                                |
|      | 0 1 |                                                                |
|      | 1 0 |                                                                |
|      | 0 1 |                                                                |
|                                                                             |
|o14 : ToricMap normalToricVariety ({{1, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0},  |
|-----------------------------------------------------------------------------|
|{-1, 1, 0, 0, 0, 0}, {0, -1, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0,|
|-----------------------------------------------------------------------------|
|0}, {0, 0, -1, 1, 0, 0}, {0, 0, 0, -1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0,  |
|-----------------------------------------------------------------------------|
|0, 0, 1}, {0, 0, 0, 0, -1, 1}, {0, 0, 0, 0, 0, -1}}, {{0, 1, 4, 5, 8, 9}, {0,|
|-----------------------------------------------------------------------------|
|1, 4, 5, 8, 11}, {0, 1, 4, 5, 9, 10}, {0, 1, 4, 5, 10, 11}, {0, 1, 4, 7, 8,  |
|-----------------------------------------------------------------------------|
|9}, {0, 1, 4, 7, 8, 11}, {0, 1, 4, 7, 9, 10}, {0, 1, 4, 7, 10, 11}, {0, 1, 5,|
|-----------------------------------------------------------------------------|
|6, 8, 9}, {0, 1, 5, 6, 8, 11}, {0, 1, 5, 6, 9, 10}, {0, 1, 5, 6, 10, 11}, {0,|
|-----------------------------------------------------------------------------|
|1, 6, 7, 8, 9}, {0, 1, 6, 7, 8, 11}, {0, 1, 6, 7, 9, 10}, {0, 1, 6, 7, 10,   |
|-----------------------------------------------------------------------------|
|11}, {0, 3, 4, 5, 8, 9}, {0, 3, 4, 5, 8, 11}, {0, 3, 4, 5, 9, 10}, {0, 3, 4, |
|-----------------------------------------------------------------------------|
|5, 10, 11}, {0, 3, 4, 7, 8, 9}, {0, 3, 4, 7, 8, 11}, {0, 3, 4, 7, 9, 10}, {0,|
|-----------------------------------------------------------------------------|
|3, 4, 7, 10, 11}, {0, 3, 5, 6, 8, 9}, {0, 3, 5, 6, 8, 11}, {0, 3, 5, 6, 9,   |
|-----------------------------------------------------------------------------|
|10}, {0, 3, 5, 6, 10, 11}, {0, 3, 6, 7, 8, 9}, {0, 3, 6, 7, 8, 11}, {0, 3, 6,|
|-----------------------------------------------------------------------------|
|7, 9, 10}, {0, 3, 6, 7, 10, 11}, {1, 2, 4, 5, 8, 9}, {1, 2, 4, 5, 8, 11}, {1,|
|-----------------------------------------------------------------------------|
|2, 4, 5, 9, 10}, {1, 2, 4, 5, 10, 11}, {1, 2, 4, 7, 8, 9}, {1, 2, 4, 7, 8,   |
|-----------------------------------------------------------------------------|
|11}, {1, 2, 4, 7, 9, 10}, {1, 2, 4, 7, 10, 11}, {1, 2, 5, 6, 8, 9}, {1, 2, 5,|
|-----------------------------------------------------------------------------|
|6, 8, 11}, {1, 2, 5, 6, 9, 10}, {1, 2, 5, 6, 10, 11}, {1, 2, 6, 7, 8, 9}, {1,|
|-----------------------------------------------------------------------------|
|2, 6, 7, 8, 11}, {1, 2, 6, 7, 9, 10}, {1, 2, 6, 7, 10, 11}, {2, 3, 4, 5, 8,  |
|-----------------------------------------------------------------------------|
|9}, {2, 3, 4, 5, 8, 11}, {2, 3, 4, 5, 9, 10}, {2, 3, 4, 5, 10, 11}, {2, 3, 4,|
|-----------------------------------------------------------------------------|
|7, 8, 9}, {2, 3, 4, 7, 8, 11}, {2, 3, 4, 7, 9, 10}, {2, 3, 4, 7, 10, 11}, {2,|
|-----------------------------------------------------------------------------|
|3, 5, 6, 8, 9}, {2, 3, 5, 6, 8, 11}, {2, 3, 5, 6, 9, 10}, {2, 3, 5, 6, 10,   |
|-----------------------------------------------------------------------------|
|11}, {2, 3, 6, 7, 8, 9}, {2, 3, 6, 7, 8, 11}, {2, 3, 6, 7, 9, 10}, {2, 3, 6, |
|-----------------------------------------------------------------------------|
|7, 10, 11}}) <--- X                                                          |
+-----------------------------------------------------------------------------+
|i15 : assert (isWellDefined largeD and source largeD === X and target largeD |
|-----------------------------------------------------------------------------|
|=== X ^** m)                                                                 |
+-----------------------------------------------------------------------------+
|i16 : assert (codim ideal largeD === (m-1) * dim X)                          |
+-----------------------------------------------------------------------------+
|i17 : assert (largeD == diagonalToricMap(X, m, [0,1,2]))                     |
+-----------------------------------------------------------------------------+

By using the array to specify a proper subset of the factors, we obtain a small
diagonal.

+-----------------------------------------------------------------------------+
|i18 : smallD = diagonalToricMap (X, 3, [0,2])                                |
|                                                                             |
|o18 = | 1 0 |                                                                |
|      | 0 1 |                                                                |
|      | 0 0 |                                                                |
|      | 0 0 |                                                                |
|      | 1 0 |                                                                |
|      | 0 1 |                                                                |
|                                                                             |
|o18 : ToricMap normalToricVariety ({{1, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0},  |
|-----------------------------------------------------------------------------|
|{-1, 1, 0, 0, 0, 0}, {0, -1, 0, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, {0, 0, 0, 1, 0,|
|-----------------------------------------------------------------------------|
|0}, {0, 0, -1, 1, 0, 0}, {0, 0, 0, -1, 0, 0}, {0, 0, 0, 0, 1, 0}, {0, 0, 0,  |
|-----------------------------------------------------------------------------|
|0, 0, 1}, {0, 0, 0, 0, -1, 1}, {0, 0, 0, 0, 0, -1}}, {{0, 1, 4, 5, 8, 9}, {0,|
|-----------------------------------------------------------------------------|
|1, 4, 5, 8, 11}, {0, 1, 4, 5, 9, 10}, {0, 1, 4, 5, 10, 11}, {0, 1, 4, 7, 8,  |
|-----------------------------------------------------------------------------|
|9}, {0, 1, 4, 7, 8, 11}, {0, 1, 4, 7, 9, 10}, {0, 1, 4, 7, 10, 11}, {0, 1, 5,|
|-----------------------------------------------------------------------------|
|6, 8, 9}, {0, 1, 5, 6, 8, 11}, {0, 1, 5, 6, 9, 10}, {0, 1, 5, 6, 10, 11}, {0,|
|-----------------------------------------------------------------------------|
|1, 6, 7, 8, 9}, {0, 1, 6, 7, 8, 11}, {0, 1, 6, 7, 9, 10}, {0, 1, 6, 7, 10,   |
|-----------------------------------------------------------------------------|
|11}, {0, 3, 4, 5, 8, 9}, {0, 3, 4, 5, 8, 11}, {0, 3, 4, 5, 9, 10}, {0, 3, 4, |
|-----------------------------------------------------------------------------|
|5, 10, 11}, {0, 3, 4, 7, 8, 9}, {0, 3, 4, 7, 8, 11}, {0, 3, 4, 7, 9, 10}, {0,|
|-----------------------------------------------------------------------------|
|3, 4, 7, 10, 11}, {0, 3, 5, 6, 8, 9}, {0, 3, 5, 6, 8, 11}, {0, 3, 5, 6, 9,   |
|-----------------------------------------------------------------------------|
|10}, {0, 3, 5, 6, 10, 11}, {0, 3, 6, 7, 8, 9}, {0, 3, 6, 7, 8, 11}, {0, 3, 6,|
|-----------------------------------------------------------------------------|
|7, 9, 10}, {0, 3, 6, 7, 10, 11}, {1, 2, 4, 5, 8, 9}, {1, 2, 4, 5, 8, 11}, {1,|
|-----------------------------------------------------------------------------|
|2, 4, 5, 9, 10}, {1, 2, 4, 5, 10, 11}, {1, 2, 4, 7, 8, 9}, {1, 2, 4, 7, 8,   |
|-----------------------------------------------------------------------------|
|11}, {1, 2, 4, 7, 9, 10}, {1, 2, 4, 7, 10, 11}, {1, 2, 5, 6, 8, 9}, {1, 2, 5,|
|-----------------------------------------------------------------------------|
|6, 8, 11}, {1, 2, 5, 6, 9, 10}, {1, 2, 5, 6, 10, 11}, {1, 2, 6, 7, 8, 9}, {1,|
|-----------------------------------------------------------------------------|
|2, 6, 7, 8, 11}, {1, 2, 6, 7, 9, 10}, {1, 2, 6, 7, 10, 11}, {2, 3, 4, 5, 8,  |
|-----------------------------------------------------------------------------|
|9}, {2, 3, 4, 5, 8, 11}, {2, 3, 4, 5, 9, 10}, {2, 3, 4, 5, 10, 11}, {2, 3, 4,|
|-----------------------------------------------------------------------------|
|7, 8, 9}, {2, 3, 4, 7, 8, 11}, {2, 3, 4, 7, 9, 10}, {2, 3, 4, 7, 10, 11}, {2,|
|-----------------------------------------------------------------------------|
|3, 5, 6, 8, 9}, {2, 3, 5, 6, 8, 11}, {2, 3, 5, 6, 9, 10}, {2, 3, 5, 6, 10,   |
|-----------------------------------------------------------------------------|
|11}, {2, 3, 6, 7, 8, 9}, {2, 3, 6, 7, 8, 11}, {2, 3, 6, 7, 9, 10}, {2, 3, 6, |
|-----------------------------------------------------------------------------|
|7, 10, 11}}) <--- X                                                          |
+-----------------------------------------------------------------------------+
|i19 : assert (isWellDefined smallD and source smallD === X and target smallD |
|-----------------------------------------------------------------------------|
|=== X ^** m)                                                                 |
+-----------------------------------------------------------------------------+
|i20 : assert (codim ideal smallD === (m-1) * dim X)                          |
+-----------------------------------------------------------------------------+
|i21 : X3 = target smallD;                                                    |
+-----------------------------------------------------------------------------+
|i22 : assert (X3^[0] * smallD == id_X and X3^[1] * smallD == map(X,X,0) and  |
|          X3^[2] * smallD == id_X)                                           |
+-----------------------------------------------------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * NormalToricVariety ^ Array -- make a
    canonical projection map
  * NormalToricVariety ^ Array -- make a
    canonical projection map
  * NormalToricVariety ^** ZZ -- make the
    Cartesian power of a normal toric variety

Ways to use diagonalToricMap:
=============================

  * "diagonalToricMap(NormalToricVariety)"
  * "diagonalToricMap(NormalToricVariety,ZZ)"
  * "diagonalToricMap(NormalToricVariety,ZZ,Array)"

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

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

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

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:914:0.

dim(NormalToricVariety) -- get the dimension of a normal toric variety
**********************************************************************

  * Function: dim (Macaulay2Doc),
  * Usage:
        dim X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * an integer (Macaulay2Doc), the dimension of the normal toric
        variety

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

The dimension of a normal toric variety equals the dimension of its dense
algebraic torus.  In this package, the fan associated to a normal
$d$-dimensional toric variety lies in the rational vector space $\QQ^d$ with
underlying lattice $N = \ZZ^d$.  Hence, the dimension simply equals the number
of entries in a minimal nonzero lattice point on a ray.

The following examples illustrate normal toric varieties of various dimensions.

+--------------------------------------------------------+
|i1 : dim toricProjectiveSpace 1                         |
|                                                        |
|o1 = 1                                                  |
+--------------------------------------------------------+
|i2 : dim affineSpace 2                                  |
|                                                        |
|o2 = 2                                                  |
+--------------------------------------------------------+
|i3 : dim toricProjectiveSpace 5                         |
|                                                        |
|o3 = 5                                                  |
+--------------------------------------------------------+
|i4 : dim hirzebruchSurface 7                            |
|                                                        |
|o4 = 2                                                  |
+--------------------------------------------------------+
|i5 : dim weightedProjectiveSpace {1,2,2,3,4}            |
|                                                        |
|o5 = 4                                                  |
+--------------------------------------------------------+
|i6 : X = normalToricVariety ({{4,-1,0},{0,1,0}},{{0,1}})|
|                                                        |
|o6 = X                                                  |
|                                                        |
|o6 : NormalToricVariety                                 |
+--------------------------------------------------------+
|i7 : dim X                                              |
|                                                        |
|o7 = 3                                                  |
+--------------------------------------------------------+
|i8 : isDegenerate X                                     |
|                                                        |
|o8 = true                                               |
+--------------------------------------------------------+

In this package, number of entries in any ray equals the dimension of both the
underlying lattice and the normal toric variety, so this method does
essentially no computation.

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * rays(NormalToricVariety) -- get the
    rays of the associated fan

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

  * dim(NormalToricVariety) -- get the
    dimension of a normal toric variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1544:0.

divisor arithmetic -- perform arithmetic on toric divisors
**********************************************************

  * Usage:
        D1 + D2
        D1 - D2
        - D2
        m * D1
  * Inputs:
      * D1, a toric divisor,
      * D2, a toric divisor,
      * m, an integer (Macaulay2Doc),
  * Outputs:
      * a toric divisor, that is obtained via the specific
        operation

The set of torus-invariant Weil divisors forms an abelian group under addition.
The basic operations arising from this structure, including addition,
subtraction, negation, and scalar multiplication by integers, are available.

We illustrate a few of the possibilities on one variety.

+--------------------------------------------------------------------+
|i1 : X = normalToricVariety(id_(ZZ^3) | -id_(ZZ^3));                |
+--------------------------------------------------------------------+
|i2 : # rays X                                                       |
|                                                                    |
|o2 = 8                                                              |
+--------------------------------------------------------------------+
|i3 : D = toricDivisor({2,-7,3,0,7,5,8,-8}, X)                       |
|                                                                    |
|o3 = 2*X  - 7*X  + 3*X  + 7*X  + 5*X  + 8*X  - 8*X                  |
|        0      1      2      4      5      6      7                 |
|                                                                    |
|o3 : ToricDivisor on X                                              |
+--------------------------------------------------------------------+
|i4 : K = toricDivisor X                                             |
|                                                                    |
|o4 = - X  - X  - X  - X  - X  - X  - X  - X                         |
|        0    1    2    3    4    5    6    7                        |
|                                                                    |
|o4 : ToricDivisor on X                                              |
+--------------------------------------------------------------------+
|i5 : D + K                                                          |
|                                                                    |
|o5 = X  - 8*X  + 2*X  - X  + 6*X  + 4*X  + 7*X  - 9*X               |
|      0      1      2    3      4      5      6      7              |
|                                                                    |
|o5 : ToricDivisor on X                                              |
+--------------------------------------------------------------------+
|i6 : assert(D + K == K + D)                                         |
+--------------------------------------------------------------------+
|i7 : D - K                                                          |
|                                                                    |
|o7 = 3*X  - 6*X  + 4*X  + X  + 8*X  + 6*X  + 9*X  - 7*X             |
|        0      1      2    3      4      5      6      7            |
|                                                                    |
|o7 : ToricDivisor on X                                              |
+--------------------------------------------------------------------+
|i8 : assert(D - K == -(K-D))                                        |
+--------------------------------------------------------------------+
|i9 : - K                                                            |
|                                                                    |
|o9 = X  + X  + X  + X  + X  + X  + X  + X                           |
|      0    1    2    3    4    5    6    7                          |
|                                                                    |
|o9 : ToricDivisor on X                                              |
+--------------------------------------------------------------------+
|i10 : assert(-K == (-1)*K)                                          |
+--------------------------------------------------------------------+
|i11 : 7*D                                                           |
|                                                                    |
|o11 = 14*X  - 49*X  + 21*X  + 49*X  + 35*X  + 56*X  - 56*X          |
|          0       1       2       4       5       6       7         |
|                                                                    |
|o11 : ToricDivisor on X                                             |
+--------------------------------------------------------------------+
|i12 : assert(7*D == (3+4)*D)                                        |
+--------------------------------------------------------------------+
|i13 : assert(7*D == 3*D + 4*D)                                      |
+--------------------------------------------------------------------+
|i14 : -3*D + 7*K                                                    |
|                                                                    |
|o14 = - 13*X  + 14*X  - 16*X  - 7*X  - 28*X  - 22*X  - 31*X  + 17*X |
|            0       1       2      3       4       5       6       7|
|                                                                    |
|o14 : ToricDivisor on X                                             |
+--------------------------------------------------------------------+
|i15 : assert(-3*D+7*K == (-2*D+8*K) + (-D-K))                       |
+--------------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * ToricDivisor == ToricDivisor, --
    equality of toric divisors
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1492:0.

entries(ToricDivisor) -- get the list of coefficients
*****************************************************

  * Function: entries (Macaulay2Doc),
  * Usage:
        entries D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a list (Macaulay2Doc), of integers (Macaulay2Doc),
        that are the coefficients of the corresponding irreducible
        torus-invariant divisors

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

This function returns the List (Macaulay2Doc), whose $i$-th entry is
the coefficient of $i$-th irreducible torus-invariant divisor.  The indexing of
the irreducible torus-invariant divisors is inherited from the indexing of the
rays in the associated fan.  This list can be viewed as an element of the group
of torus-invariant Weil divisors.

Here are two simple examples.

+---------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                       |
+---------------------------------------------------------+
|i2 : D1 = 2*PP2_0 - 7*PP2_1 + 3*PP2_2                    |
|                                                         |
|o2 = 2*PP2  - 7*PP2  + 3*PP2                             |
|          0        1        2                            |
|                                                         |
|o2 : ToricDivisor on PP2                                 |
+---------------------------------------------------------+
|i3 : entries D1                                          |
|                                                         |
|o3 = {2, -7, 3}                                          |
|                                                         |
|o3 : List                                                |
+---------------------------------------------------------+
|i4 : assert( D1 == toricDivisor(entries D1, variety D1) )|
+---------------------------------------------------------+
|i5 : assert all(entries toricDivisor PP2, i -> i === -1) |
+---------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i6 : D2 = toricDivisor convexHull (id_(ZZ^3) | - id_(ZZ^3))                  |
|                                                                             |
|o6 = D  + D  + D  + D  + D  + D  + D  + D                                    |
|      0    1    2    3    4    5    6    7                                   |
|                                                                             |
|o6 : ToricDivisor on normalToricVariety ({{1, 1, 1}, {-1, 1, 1}, {1, -1, 1}, |
|-----------------------------------------------------------------------------|
|{-1, -1, 1}, {1, 1, -1}, {-1, 1, -1}, {1, -1, -1}, {-1, -1, -1}}, {{0, 1, 2, |
|-----------------------------------------------------------------------------|
|3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, {2, 3, 6, 7}, {4, 5, 6, 7}})   |
+-----------------------------------------------------------------------------+
|i7 : entries D2                                                              |
|                                                                             |
|o7 = {1, 1, 1, 1, 1, 1, 1, 1}                                                |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : assert all(entries D2, i -> i === 1)                                    |
+-----------------------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * toricDivisor(List,NormalToricVariety)
    -- make a torus-invariant Weil
    divisor
  * toricDivisor(Polyhedron) -- make the
    toric divisor associated to a polyhedron

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

  * entries(ToricDivisor) -- get the list of
    coefficients
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:852:0.

expression(NormalToricVariety) -- get the expression used to format for printing
********************************************************************************

  * Function: expression (Macaulay2Doc),
  * Usage:
        expression X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * an expression (Macaulay2Doc), used to format X for
        printing

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

This function is primarily called by << (Macaulay2Doc),
to format printing.  It displays the minimal nonzero lattice points on
each ray and the subsets of rays which determine the maximal cones in the fan.

+-----------------------------------------------------------------------------+
|i1 : toricProjectiveSpace 3                                                  |
|                                                                             |
|o1 = normalToricVariety ({{-1, -1, -1}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}},    |
|                                                                             |
|o1 : NormalToricVariety                                                      |
|-----------------------------------------------------------------------------|
|{{0, 1, 2}, {0, 1, 3}, {0, 2, 3}, {1, 2, 3}})                                |
+-----------------------------------------------------------------------------+
|i2 : expression toricProjectiveSpace 3                                       |
|                                                                             |
|o2 = normalToricVariety ({{-1, -1, -1}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}},    |
|                                                                             |
|o2 : Expression of class Adjacent                                            |
|-----------------------------------------------------------------------------|
|{{0, 1, 2}, {0, 1, 3}, {0, 2, 3}, {1, 2, 3}})                                |
+-----------------------------------------------------------------------------+
|i3 : rays toricProjectiveSpace 3                                             |
|                                                                             |
|o3 = {{-1, -1, -1}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}                         |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : max toricProjectiveSpace 3                                              |
|                                                                             |
|o4 = {{0, 1, 2}, {0, 1, 3}, {0, 2, 3}, {1, 2, 3}}                            |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i5 : hirzebruchSurface 7                                                     |
|                                                                             |
|o5 = normalToricVariety ({{1, 0}, {0, 1}, {-1, 7}, {0, -1}}, {{0, 1}, {0, 3},|
|                                                                             |
|o5 : NormalToricVariety                                                      |
|-----------------------------------------------------------------------------|
|{1, 2}, {2, 3}})                                                             |
+-----------------------------------------------------------------------------+
|i6 : expression hirzebruchSurface 7                                          |
|                                                                             |
|o6 = normalToricVariety ({{1, 0}, {0, 1}, {-1, 7}, {0, -1}}, {{0, 1}, {0, 3},|
|                                                                             |
|o6 : Expression of class Adjacent                                            |
|-----------------------------------------------------------------------------|
|{1, 2}, {2, 3}})                                                             |
+-----------------------------------------------------------------------------+
|i7 : rays hirzebruchSurface 7                                                |
|                                                                             |
|o7 = {{1, 0}, {0, 1}, {-1, 7}, {0, -1}}                                      |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : max hirzebruchSurface 7                                                 |
|                                                                             |
|o8 = {{0, 1}, {0, 3}, {1, 2}, {2, 3}}                                        |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+

After assignment to a global variable Macaulay2 knows the toric variety's name,
and this name is used when printing.

+---------------------------------+
|i9 : PP2 = toricProjectiveSpace 3|
|                                 |
|o9 = PP2                         |
|                                 |
|o9 : NormalToricVariety          |
+---------------------------------+
|i10 : expression PP2             |
|                                 |
|o10 = PP2                        |
|                                 |
|o10 : Expression of class Holder |
+---------------------------------+
|i11 : FF7 = hirzebruchSurface 7  |
|                                 |
|o11 = FF7                        |
|                                 |
|o11 : NormalToricVariety         |
+---------------------------------+
|i12 : expression FF7             |
|                                 |
|o12 = FF7                        |
|                                 |
|o12 : Expression of class Holder |
+---------------------------------+

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan

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

  * expression(NormalToricVariety),
    -- get the expression used to format for printing
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:211:0.

expression(ToricDivisor) -- get the expression used to format for printing
**************************************************************************

  * Function: expression (Macaulay2Doc),
  * Usage:
        expression D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * an expression (Macaulay2Doc), used to format D for
        printing

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

This method is the primary function called upon by << (Macaulay2Doc),
to format for printing.  It assumes that D is well-defined.

When the underlying normal toric variety has not been assigned a global
variable, the $i$-th irreducible torus-invariant Weil divisor is displayed as
$D_i$.  However, if the underlying normal toric variety has been assigned a
global variable $X$, the $i$-th irreducible torus-invariant Weil divisor is
displayed as $X_i$. In either case, an arbitrary torus-invariant Weil divisor
is displayed as an integral linear combination of these expressions.

+-----------------------------------------------------------------------------+
|i1 : toricDivisor({2,-7,3}, toricProjectiveSpace 2)                          |
|                                                                             |
|o1 = 2*D  - 7*D  + 3*D                                                       |
|        0      1      2                                                      |
|                                                                             |
|o1 : ToricDivisor on normalToricVariety ({{-1, -1}, {1, 0}, {0, 1}}, {{0, 1},|
|-----------------------------------------------------------------------------|
|{0, 2}, {1, 2}})                                                             |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i2 : toricDivisor convexHull (id_(ZZ^3) | - id_(ZZ^3))                       |
|                                                                             |
|o2 = D  + D  + D  + D  + D  + D  + D  + D                                    |
|      0    1    2    3    4    5    6    7                                   |
|                                                                             |
|o2 : ToricDivisor on normalToricVariety ({{1, 1, 1}, {-1, 1, 1}, {1, -1, 1}, |
|-----------------------------------------------------------------------------|
|{-1, -1, 1}, {1, 1, -1}, {-1, 1, -1}, {1, -1, -1}, {-1, -1, -1}}, {{0, 1, 2, |
|-----------------------------------------------------------------------------|
|3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, {2, 3, 6, 7}, {4, 5, 6, 7}})   |
+-----------------------------------------------------------------------------+
+-------------------------------------------+
|i3 : PP2 = toricProjectiveSpace 2;         |
+-------------------------------------------+
|i4 : D1 = toricDivisor({2,-7,3}, PP2)      |
|                                           |
|o4 = 2*PP2  - 7*PP2  + 3*PP2               |
|          0        1        2              |
|                                           |
|o4 : ToricDivisor on PP2                   |
+-------------------------------------------+
|i5 : D2 = 2 * PP2_0 - 7 * PP2_1 + 3 * PP2_2|
|                                           |
|o5 = 2*PP2  - 7*PP2  + 3*PP2               |
|          0        1        2              |
|                                           |
|o5 : ToricDivisor on PP2                   |
+-------------------------------------------+
|i6 : assert(D1 == D1)                      |
+-------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * isWellDefined(ToricDivisor), --
    whether a toric divisor is well-defined
  * NormalToricVariety _ ZZ -- make an
    irreducible torus-invariant divisor

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

  * expression(ToricDivisor) -- get the
    expression used to format for printing
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:771:0.

fan(NormalToricVariety) -- make the 'Polyhedra' fan associated to the normal toric variety
******************************************************************************************

  * Function: fan (Polyhedra),
  * Usage:
        fan X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * an instance of the type Fan (Polyhedra), the underlying fan
        of the normal toric variety

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

This methods returns the Polyhedra, fan associated to a
normal toric variety.

+-----------------------------------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;                                           |
+-----------------------------------------------------------------------------+
|i2 : F1 = fan PP3                                                            |
|                                                                             |
|o2 = F1                                                                      |
|                                                                             |
|o2 : Fan                                                                     |
+-----------------------------------------------------------------------------+
|i3 : rays F1                                                                 |
|                                                                             |
|o3 = | 1 0 -1 0 |                                                            |
|     | 0 1 -1 0 |                                                            |
|     | 0 0 -1 1 |                                                            |
|                                                                             |
|              3       4                                                      |
|o3 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i4 : maxCones F1                                                             |
|                                                                             |
|o4 = {{0, 1, 2}, {0, 2, 3}, {1, 2, 3}, {0, 1, 3}}                            |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+
|i5 : assert (set rays PP3 === set rays normalToricVariety F1 and max PP3 === |
|-----------------------------------------------------------------------------|
|max normalToricVariety F1)                                                   |
+-----------------------------------------------------------------------------+
+-------------------------------------+
|i6 : F2 = fan hirzebruchSurface 3;   |
+-------------------------------------+
|i7 : rays F2                         |
|                                     |
|o7 = | 1 0  0 -1 |                   |
|     | 0 -1 1 3  |                   |
|                                     |
|              2       4              |
|o7 : Matrix ZZ  <-- ZZ               |
+-------------------------------------+
|i8 : maxCones F2                     |
|                                     |
|o8 = {{0, 2}, {0, 1}, {2, 3}, {1, 3}}|
|                                     |
|o8 : List                            |
+-------------------------------------+

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * normalToricVariety(Fan) -- make a
    normal toric variety from a 'Polyhedra' fan

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

  * fan(NormalToricVariety) -- make the
    'Polyhedra' fan associated to the normal toric variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1338:0.

finding attributes and properties -- information about accessing features of a normal toric variety
***************************************************************************************************

Having made a NormalToricVariety, one can access its
basic invariants or test for some elementary properties by using the following
methods:

Determining attributes and properties of normal toric varieties
===============================================================

  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan
  * expression(NormalToricVariety),
    -- get the expression used to format for printing
  * dim(NormalToricVariety) -- get the
    dimension of a normal toric variety
  * orbits(NormalToricVariety,ZZ),
    -- get a list of the torus orbits (a.k.a. cones in the fan) of a given
    dimension
  * isDegenerate(NormalToricVariety)
    -- whether a toric variety is
    degenerate
  * isSimplicial(NormalToricVariety)
    -- whether a normal toric variety is
    simplicial
  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth
  * isComplete(NormalToricVariety),
    -- whether a toric variety is complete
  * isProjective(NormalToricVariety)
    -- whether a toric variety is
    projective
  * isFano(NormalToricVariety), --
    whether a normal toric variety is Fano
  * fan(NormalToricVariety) -- make the
    'Polyhedra' fan associated to the normal toric variety

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * resolving singularities -- information
    about find a smooth proper birational surjection
  * working with toric maps -- information
    about toric maps and the induced operations
  * working with divisors -- information about
    toric divisors and their related groups
  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1377:0.

fromCDivToPic(NormalToricVariety) -- get the map from Cartier divisors to the Picard group
******************************************************************************************

  * Function: fromCDivToPic,
  * Usage:
        fromCDivToPic X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a matrix (Macaulay2Doc), representing the surjective map
        from the group of torus-invariant Cartier divisors to the Picard group

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

The Picard group, of a variety is
the group of Cartier divisors,
divided by the subgroup of
principal divisors.  For a normal toric variety , the Picard group has a
presentation defined by the map from the group of torus-characters to the group
of torus-invariant Cartier divisors.  Hence, there is a surjective map from the
group of torus-invariant Cartier divisors to the Picard group.  This function
returns a matrix representing this map with respect to the chosen bases.  For
more information, see Theorem 4.2.1 in Cox-Little-Schenck's Toric Varieties.

On a smooth, normal toric variety, the
map from the torus-invariant Cartier divisors to the Picard group is the same
as the map from the Weil divisors,
to the class group.

+----------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                  |
+----------------------------------------------------+
|i2 : assert (isSmooth PP2 and isProjective PP2)     |
+----------------------------------------------------+
|i3 : fromCDivToPic PP2                              |
|                                                    |
|o3 = | 1 1 1 |                                      |
|                                                    |
|              1       3                             |
|o3 : Matrix ZZ  <-- ZZ                              |
+----------------------------------------------------+
|i4 : assert (fromCDivToPic PP2 === fromWDivToCl PP2)|
+----------------------------------------------------+
+--------------------------------------------------------+
|i5 : X = smoothFanoToricVariety (4,20);                 |
+--------------------------------------------------------+
|i6 : assert (isSmooth X and isProjective X and isFano X)|
+--------------------------------------------------------+
|i7 : fromCDivToPic X                                    |
|                                                        |
|o7 = | 1 1 1 -1 0 0  0 |                                |
|     | 0 0 0 1  1 -1 0 |                                |
|     | 0 0 0 0  0 1  1 |                                |
|                                                        |
|              3       7                                 |
|o7 : Matrix ZZ  <-- ZZ                                  |
+--------------------------------------------------------+
|i8 : assert (fromCDivToPic X === fromWDivToCl X)        |
+--------------------------------------------------------+
+-------------------------------------------------------+
|i9 : U = normalToricVariety ({{4,-1},{0,1}},{{0},{1}});|
+-------------------------------------------------------+
|i10 : assert (isSmooth U and not isComplete U)         |
+-------------------------------------------------------+
|i11 : fromCDivToPic U                                  |
|                                                       |
|o11 = | -1 -1 |                                        |
|                                                       |
|o11 : Matrix                                           |
+-------------------------------------------------------+
|i12 : assert (fromCDivToPic U === fromWDivToCl U)      |
+-------------------------------------------------------+

In general, there is a commutative diagram relating the map from the group of
torus-invariant Cartier divisors to the Picard group and the map from the group
of torus-invariant Weil divisors to the class group.

+-----------------------------------------------------------------------------+
|i13 : Q = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{1,1,-1}},{{0,1,2,3}});                            |
+-----------------------------------------------------------------------------+
|i14 : assert (not isSimplicial Q and not isComplete Q)                       |
+-----------------------------------------------------------------------------+
|i15 : fromCDivToPic Q                                                        |
|                                                                             |
|o15 = 0                                                                      |
|                                                                             |
|                     3                                                       |
|o15 : Matrix 0 <-- ZZ                                                        |
+-----------------------------------------------------------------------------+
|i16 : assert (fromWDivToCl Q * fromCDivToWDiv Q == fromPicToCl Q *           |
|-----------------------------------------------------------------------------|
|fromCDivToPic Q)                                                             |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i17 : Y = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));                       |
+-----------------------------------------------------------------------------+
|i18 : assert (not isSimplicial Y and isProjective Y)                         |
+-----------------------------------------------------------------------------+
|i19 : fromCDivToPic Y                                                        |
|                                                                             |
|o19 = | 0 0 0 1 |                                                            |
|                                                                             |
|               1       4                                                     |
|o19 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i20 : fromPicToCl Y                                                          |
|                                                                             |
|o20 = | 0 |                                                                  |
|      | 0 |                                                                  |
|      | 0 |                                                                  |
|      | 2 |                                                                  |
|      | 2 |                                                                  |
|      | 2 |                                                                  |
|      | 2 |                                                                  |
|                                                                             |
|o20 : Matrix                                                                 |
+-----------------------------------------------------------------------------+
|i21 : fromPicToCl Y * fromCDivToPic Y                                        |
|                                                                             |
|o21 = | 0 0 0 0 |                                                            |
|      | 0 0 0 0 |                                                            |
|      | 0 0 0 0 |                                                            |
|      | 0 0 0 2 |                                                            |
|      | 0 0 0 2 |                                                            |
|      | 0 0 0 2 |                                                            |
|      | 0 0 0 2 |                                                            |
|                                                                             |
|o21 : Matrix                                                                 |
+-----------------------------------------------------------------------------+
|i22 : fromCDivToWDiv Y                                                       |
|                                                                             |
|o22 = | 1  1  1  1 |                                                         |
|      | -1 1  1  1 |                                                         |
|      | 1  -1 1  1 |                                                         |
|      | -1 -1 1  1 |                                                         |
|      | 1  1  -1 1 |                                                         |
|      | -1 1  -1 1 |                                                         |
|      | 1  -1 -1 1 |                                                         |
|      | -1 -1 -1 1 |                                                         |
|                                                                             |
|               8       4                                                     |
|o22 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i23 : fromWDivToCl Y                                                         |
|                                                                             |
|o23 = | 1  0  1  0 0 0 0 0 |                                                 |
|      | 1  1  0  0 0 0 0 0 |                                                 |
|      | 1  -1 -1 1 0 0 0 0 |                                                 |
|      | -1 1  1  0 1 0 0 0 |                                                 |
|      | 0  0  1  0 0 1 0 0 |                                                 |
|      | 0  1  0  0 0 0 1 0 |                                                 |
|      | 1  0  0  0 0 0 0 1 |                                                 |
|                                                                             |
|o23 : Matrix                                                                 |
+-----------------------------------------------------------------------------+
|i24 : assert (fromWDivToCl Y * fromCDivToWDiv Y == fromPicToCl Y *           |
|-----------------------------------------------------------------------------|
|fromCDivToPic Y)                                                             |
+-----------------------------------------------------------------------------+

This map is computed and cached when the Picard group is first constructed.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * cartierDivisorGroup(NormalToricVariety)
    -- compute the group of
    torus-invariant Cartier divisors
  * picardGroup(NormalToricVariety),
    -- make the Picard group
  * fromWDivToCl(NormalToricVariety)
    -- get the map from the group of Weil
    divisors to the class group

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

  * fromCDivToPic(NormalToricVariety)
    -- get the map from Cartier divisors
    to the Picard group
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:623:0.

fromCDivToWDiv(NormalToricVariety) -- get the map from Cartier divisors to Weil divisors
****************************************************************************************

  * Function: fromCDivToWDiv,
  * Usage:
        fromCDivToWDiv X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a matrix (Macaulay2Doc), representing the inclusion map
        from the group of torus-invariant Cartier divisors to the group of
        torus-invariant Weil divisors

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

The group of torus-invariant Cartier divisors,
is the subgroup of all locally
principal torus-invariant Weil divisors.
This function produces the
inclusion map with respect to the chosen bases for the two finitely-generated
abelian groups.  For more information, see Theorem 4.2.1 in
Cox-Little-Schenck's Toric Varieties.

On a smooth normal toric variety, every torus-invariant Weil divisor is
Cartier, so the inclusion map is simply the identity map.

+--------------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                            |
+--------------------------------------------------------------+
|i2 : assert (isSmooth PP2 and isProjective PP2)               |
+--------------------------------------------------------------+
|i3 : fromCDivToWDiv PP2                                       |
|                                                              |
|o3 = | 1 0 0 |                                                |
|     | 0 1 0 |                                                |
|     | 0 0 1 |                                                |
|                                                              |
|              3       3                                       |
|o3 : Matrix ZZ  <-- ZZ                                        |
+--------------------------------------------------------------+
|i4 : assert (fromCDivToWDiv PP2 === id_(weilDivisorGroup PP2))|
+--------------------------------------------------------------+
+----------------------------------------------------------+
|i5 : X = smoothFanoToricVariety (4,20);                   |
+----------------------------------------------------------+
|i6 : assert (isSmooth X and isProjective X and isFano X)  |
+----------------------------------------------------------+
|i7 : fromCDivToWDiv X                                     |
|                                                          |
|o7 = | 1 0 0 0 0 0 0 |                                    |
|     | 0 1 0 0 0 0 0 |                                    |
|     | 0 0 1 0 0 0 0 |                                    |
|     | 0 0 0 1 0 0 0 |                                    |
|     | 0 0 0 0 1 0 0 |                                    |
|     | 0 0 0 0 0 1 0 |                                    |
|     | 0 0 0 0 0 0 1 |                                    |
|                                                          |
|              7       7                                   |
|o7 : Matrix ZZ  <-- ZZ                                    |
+----------------------------------------------------------+
|i8 : assert (fromCDivToWDiv X === id_(weilDivisorGroup X))|
+----------------------------------------------------------+
+-----------------------------------------------------------+
|i9 : U = normalToricVariety ({{4,-1},{0,1}},{{0},{1}});    |
+-----------------------------------------------------------+
|i10 : assert (isSmooth U and not isComplete U)             |
+-----------------------------------------------------------+
|i11 : fromCDivToWDiv U                                     |
|                                                           |
|o11 = | 1 0 |                                              |
|      | 0 1 |                                              |
|                                                           |
|               2       2                                   |
|o11 : Matrix ZZ  <-- ZZ                                    |
+-----------------------------------------------------------+
|i12 : assert (fromCDivToWDiv U === id_(weilDivisorGroup U))|
+-----------------------------------------------------------+

On a simplicial (Polyhedra), normal toric variety, every
torus-invariant Weil divisor is $\QQ$-Cartier; every torus-invariant Weil
divisor has a positive integer multiple that is Cartier.

+------------------------------------------------------+
|i13 : C = normalToricVariety ({{4,-1},{0,1}},{{0,1}});|
+------------------------------------------------------+
|i14 : fromCDivToWDiv C                                |
|                                                      |
|o14 = | 4 -1 |                                        |
|      | 0 1  |                                        |
|                                                      |
|               2       2                              |
|o14 : Matrix ZZ  <-- ZZ                               |
+------------------------------------------------------+
|i15 : prune cokernel fromCDivToWDiv C                 |
|                                                      |
|o15 = cokernel | 4 |                                  |
|                                                      |
|                               1                      |
|o15 : ZZ-module, quotient of ZZ                       |
+------------------------------------------------------+
|i16 : assert (rank cokernel fromCDivToWDiv C === 0)   |
+------------------------------------------------------+

In general, the Cartier divisors are only a subgroup of the Weil divisors.

+-----------------------------------------------------------------------------+
|i17 : Q = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{1,1,-1}},{{0,1,2,3}});                            |
+-----------------------------------------------------------------------------+
|i18 : assert (not isSimplicial Q and not isComplete Q)                       |
+-----------------------------------------------------------------------------+
|i19 : fromCDivToWDiv Q                                                       |
|                                                                             |
|o19 = | 1 0 0  |                                                             |
|      | 0 1 0  |                                                             |
|      | 0 0 1  |                                                             |
|      | 1 1 -1 |                                                             |
|                                                                             |
|               4       3                                                     |
|o19 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i20 : prune coker fromCDivToWDiv Q                                           |
|                                                                             |
|        1                                                                    |
|o20 = ZZ                                                                     |
|                                                                             |
|o20 : ZZ-module, free                                                        |
+-----------------------------------------------------------------------------+
|i21 : assert (rank coker fromCDivToWDiv Q === 1)                             |
+-----------------------------------------------------------------------------+
+------------------------------------------------------+
|i22 : Y = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));|
+------------------------------------------------------+
|i23 : assert (not isSimplicial Y and isComplete Y)    |
+------------------------------------------------------+
|i24 : fromCDivToWDiv Y                                |
|                                                      |
|o24 = | 1  1  1  1 |                                  |
|      | -1 1  1  1 |                                  |
|      | 1  -1 1  1 |                                  |
|      | -1 -1 1  1 |                                  |
|      | 1  1  -1 1 |                                  |
|      | -1 1  -1 1 |                                  |
|      | 1  -1 -1 1 |                                  |
|      | -1 -1 -1 1 |                                  |
|                                                      |
|               8       4                              |
|o24 : Matrix ZZ  <-- ZZ                               |
+------------------------------------------------------+
|i25 : prune cokernel fromCDivToWDiv Y                 |
|                                                      |
|o25 = cokernel | 2 0 0 |                              |
|               | 0 2 0 |                              |
|               | 0 0 2 |                              |
|               | 0 0 0 |                              |
|               | 0 0 0 |                              |
|               | 0 0 0 |                              |
|               | 0 0 0 |                              |
|                                                      |
|                               7                      |
|o25 : ZZ-module, quotient of ZZ                       |
+------------------------------------------------------+
|i26 : assert (rank coker fromCDivToWDiv Y === 4)      |
+------------------------------------------------------+

This map is computed and cached when the Cartier divisor group is first
constructed.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * weilDivisorGroup(NormalToricVariety)
    -- make the group of
    torus-invariant Weil divisors
  * cartierDivisorGroup(NormalToricVariety)
    -- compute the group of
    torus-invariant Cartier divisors
  * isCartier(ToricDivisor) -- whether a
    torus-invariant Weil divisor is Cartier

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

  * fromCDivToWDiv(NormalToricVariety)
    -- get the map from Cartier
    divisors to Weil divisors
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:400:0.

fromPicToCl(NormalToricVariety) -- get the map from Picard group to class group
*******************************************************************************

  * Function: fromPicToCl,
  * Usage:
        fromPicToCl X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a matrix (Macaulay2Doc), representing the inclusion map
        from the Picard group to the class group

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

The Picard group, of a normal toric
variety is a subgroup of the class group.
This function returns a matrix
representing this map with respect to the chosen bases.

On a smooth, normal toric variety, the
Picard group is isomorphic to the class group, so the inclusion map is the
identity.

+-----------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;                   |
+-----------------------------------------------------+
|i2 : assert (isSmooth PP3 and isProjective PP3)      |
+-----------------------------------------------------+
|i3 : fromPicToCl PP3                                 |
|                                                     |
|o3 = | 1 |                                           |
|                                                     |
|              1       1                              |
|o3 : Matrix ZZ  <-- ZZ                               |
+-----------------------------------------------------+
|i4 : assert (fromPicToCl PP3 === id_(classGroup PP3))|
+-----------------------------------------------------+
+--------------------------------------------------------+
|i5 : X = smoothFanoToricVariety (4,90);                 |
+--------------------------------------------------------+
|i6 : assert (isSmooth X and isProjective X and isFano X)|
+--------------------------------------------------------+
|i7 : fromPicToCl X                                      |
|                                                        |
|o7 = | 1 0 0 0 0 |                                      |
|     | 0 1 0 0 0 |                                      |
|     | 0 0 1 0 0 |                                      |
|     | 0 0 0 1 0 |                                      |
|     | 0 0 0 0 1 |                                      |
|                                                        |
|              5       5                                 |
|o7 : Matrix ZZ  <-- ZZ                                  |
+--------------------------------------------------------+
|i8 : assert (fromPicToCl X === id_(classGroup X))       |
+--------------------------------------------------------+
+----------------------------------------------------------------+
|i9 : U = normalToricVariety ({{4,-1},{0,1}},{{0},{1}});         |
+----------------------------------------------------------------+
|i10 : assert (isSmooth U and not isComplete U and # max U =!= 1)|
+----------------------------------------------------------------+
|i11 : fromPicToCl U                                             |
|                                                                |
|o11 = | 1 |                                                     |
|                                                                |
|o11 : Matrix                                                    |
+----------------------------------------------------------------+
|i12 : assert (fromPicToCl U === id_(classGroup U))              |
+----------------------------------------------------------------+

For weighted projective space, the
inclusion corresponds to $l \ZZ$ in $\ZZ$ where $l = lcm(q_0, q_1, \dots, q_d
{})$.

+----------------------------------------------------------------------+
|i13 : P123 = weightedProjectiveSpace {1,2,3};                         |
+----------------------------------------------------------------------+
|i14 : assert (isSimplicial P123 and isProjective P123)                |
+----------------------------------------------------------------------+
|i15 : fromPicToCl P123                                                |
|                                                                      |
|o15 = | 6 |                                                           |
|                                                                      |
|               1       1                                              |
|o15 : Matrix ZZ  <-- ZZ                                               |
+----------------------------------------------------------------------+
|i16 : assert (fromPicToCl P123 === lcm (1,2,3) * id_(classGroup P123))|
+----------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i17 : P12234 = weightedProjectiveSpace {1,2,2,3,4};                          |
+-----------------------------------------------------------------------------+
|i18 : assert (isSimplicial P12234 and isProjective P12234)                   |
+-----------------------------------------------------------------------------+
|i19 : fromPicToCl P12234                                                     |
|                                                                             |
|o19 = | 12 |                                                                 |
|                                                                             |
|               1       1                                                     |
|o19 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i20 : assert (fromPicToCl P12234 === lcm (1,2,2,3,4) * id_(classGroup        |
|-----------------------------------------------------------------------------|
|P12234))                                                                     |
+-----------------------------------------------------------------------------+

The following examples illustrate some other possibilities.

+-----------------------------------------------------------------------------+
|i21 : Q = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{1,1,-1}},{{0,1,2,3}});                            |
+-----------------------------------------------------------------------------+
|i22 : assert (not isSimplicial Q and not isComplete Q and # max Q === 1)     |
+-----------------------------------------------------------------------------+
|i23 : fromPicToCl Q                                                          |
|                                                                             |
|o23 = 0                                                                      |
|                                                                             |
|               1                                                             |
|o23 : Matrix ZZ  <-- 0                                                       |
+-----------------------------------------------------------------------------+
|i24 : assert (fromPicToCl Q == 0)                                            |
+-----------------------------------------------------------------------------+
+------------------------------------------------------+
|i25 : Y = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));|
+------------------------------------------------------+
|i26 : assert (not isSimplicial Y and isProjective Y)  |
+------------------------------------------------------+
|i27 : fromPicToCl Y                                   |
|                                                      |
|o27 = | 0 |                                           |
|      | 0 |                                           |
|      | 0 |                                           |
|      | 2 |                                           |
|      | 2 |                                           |
|      | 2 |                                           |
|      | 2 |                                           |
|                                                      |
|o27 : Matrix                                          |
+------------------------------------------------------+

This map is computed and cached when the Picard group is first constructed.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * picardGroup(NormalToricVariety),
    -- make the Picard group
  * classGroup(NormalToricVariety),
    -- make the class group
  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth

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

  * fromPicToCl(NormalToricVariety),
    -- get the map from Picard group to class group
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:547:0.

fromWDivToCl(NormalToricVariety) -- get the map from the group of Weil divisors to the class group
**************************************************************************************************

  * Function: fromWDivToCl,
  * Usage:
        fromWDivToCl X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a matrix (Macaulay2Doc), defining the surjection from the
        torus-invariant Weil divisors to the class group

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

For a normal toric variety, the class group has a presentation defined by the
map from the group of torus-characters to group of torus-invariant Weil
divisors induced by minimal nonzero lattice points on the rays of the
associated fan.  Hence, there is a surjective map from the group of
torus-invariant Weil divisors to the class group.  This method returns a matrix
representing this map.  Since the ordering on the rays of the toric variety
determines a basis for the group of torus-invariant Weil divisors, this matrix
is determined by a choice of basis for the class group.  For more information,
see Theorem 4.1.3 in Cox-Little-Schenck's Toric Varieties.

The examples illustrate some of the possible maps from the group of torus-invariant Weil divisors,
to the
class group.

+-----------------------------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                                           |
+-----------------------------------------------------------------------------+
|i2 : A1 = fromWDivToCl PP2                                                   |
|                                                                             |
|o2 = | 1 1 1 |                                                               |
|                                                                             |
|              1       3                                                      |
|o2 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i3 : assert ( (target A1, source A1) === (classGroup PP2, weilDivisorGroup   |
|-----------------------------------------------------------------------------|
|PP2) )                                                                       |
+-----------------------------------------------------------------------------+
|i4 : assert ( A1 * matrix rays PP2 == 0)                                     |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i5 : X = weightedProjectiveSpace {1,2,2,3,4};                                |
+-----------------------------------------------------------------------------+
|i6 : A2 = fromWDivToCl X                                                     |
|                                                                             |
|o6 = | 1 2 2 3 4 |                                                           |
|                                                                             |
|              1       5                                                      |
|o6 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i7 : assert ( (target A2, source A2) === (classGroup X, weilDivisorGroup X) )|
+-----------------------------------------------------------------------------+
|i8 : assert ( A2 * matrix rays X == 0)                                       |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i9 : Y = normalToricVariety ( id_(ZZ^3) | - id_(ZZ^3));                      |
+-----------------------------------------------------------------------------+
|i10 : A3 = fromWDivToCl Y                                                    |
|                                                                             |
|o10 = | 1  0  1  0 0 0 0 0 |                                                 |
|      | 1  1  0  0 0 0 0 0 |                                                 |
|      | 1  -1 -1 1 0 0 0 0 |                                                 |
|      | -1 1  1  0 1 0 0 0 |                                                 |
|      | 0  0  1  0 0 1 0 0 |                                                 |
|      | 0  1  0  0 0 0 1 0 |                                                 |
|      | 1  0  0  0 0 0 0 1 |                                                 |
|                                                                             |
|o10 : Matrix                                                                 |
+-----------------------------------------------------------------------------+
|i11 : classGroup Y                                                           |
|                                                                             |
|o11 = cokernel | 2 0 |                                                       |
|               | 0 2 |                                                       |
|               | 0 0 |                                                       |
|               | 0 0 |                                                       |
|               | 0 0 |                                                       |
|               | 0 0 |                                                       |
|               | 0 0 |                                                       |
|                                                                             |
|                               7                                             |
|o11 : ZZ-module, quotient of ZZ                                              |
+-----------------------------------------------------------------------------+
|i12 : assert ( (target A3, source A3) === (classGroup Y, weilDivisorGroup Y) |
|-----------------------------------------------------------------------------|
|)                                                                            |
+-----------------------------------------------------------------------------+
|i13 : assert ( A3 * matrix rays Y == 0)                                      |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i14 : U = normalToricVariety ({{4,-1},{0,1}},{{0,1}});                       |
+-----------------------------------------------------------------------------+
|i15 : A4 = fromWDivToCl U                                                    |
|                                                                             |
|o15 = | -1 -1 |                                                              |
|                                                                             |
|o15 : Matrix                                                                 |
+-----------------------------------------------------------------------------+
|i16 : classGroup U                                                           |
|                                                                             |
|o16 = cokernel | 4 |                                                         |
|                                                                             |
|                               1                                             |
|o16 : ZZ-module, quotient of ZZ                                              |
+-----------------------------------------------------------------------------+
|i17 : assert ( (target A4, source A4) === (classGroup U, weilDivisorGroup U) |
|-----------------------------------------------------------------------------|
|)                                                                            |
+-----------------------------------------------------------------------------+
|i18 : assert ( A4 * matrix rays U == 0)                                      |
+-----------------------------------------------------------------------------+

This matrix also induces the grading on the total coordinate ring of toric
variety.

+----------------------------------------------------------------------+
|i19 : assert ( transpose matrix degrees ring PP2 === fromWDivToCl PP2)|
+----------------------------------------------------------------------+
|i20 : assert ( transpose matrix degrees ring X === fromWDivToCl X)    |
+----------------------------------------------------------------------+

The optional argument WeilToClass,
for the constructor normalToricVariety,
allows one to specify a basis of the class
group.

This map is computed and cached when the class group is first constructed.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * making normal toric varieties, --
    information about the basic constructors
  * weilDivisorGroup(NormalToricVariety)
    -- make the group of
    torus-invariant Weil divisors
  * classGroup(NormalToricVariety),
    -- make the class group
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)

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

  * fromWDivToCl(NormalToricVariety)
    -- get the map from the group of Weil
    divisors to the class group
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:190:0.

HH^ZZ(NormalToricVariety,CoherentSheaf) -- compute the cohomology of a coherent sheaf
*************************************************************************************

  * Function: cohomology (Macaulay2Doc),
  * Usage:
        HH^i (X, F)
  * Inputs:
      * i, an integer (Macaulay2Doc),
      * X, a normal toric variety,
      * F, a coherent sheaf (Varieties), on X
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), => ..., default value 0,
  * Outputs:
      * a module (Macaulay2Doc), the i-th cohomology group of F

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

The cohomology functor $HH^i (X,-)$ from the category of sheaves of abelian
groups to the category of abelian groups is the right derived functor of the
global sections functor.

As a simple example, we compute the dimensions of the cohomology groups for
some line bundles on the projective plane.

+-----------------------------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                                           |
+-----------------------------------------------------------------------------+
|i2 : HH^0 (PP2, OO_PP2(1))                                                   |
|                                                                             |
|       3                                                                     |
|o2 = QQ                                                                      |
|                                                                             |
|o2 : QQ-module, free                                                         |
+-----------------------------------------------------------------------------+
|i3 : matrix table (reverse toList (0..2), toList (-10..5),  (i,j) -> rank    |
|                                                                             |
|o3 = | 55 45 36 28 21 15 10 6 3 1 0 0 0 0  0  0  |                           |
|     | 0  0  0  0  0  0  0  0 0 0 0 0 0 0  0  0  |                           |
|     | 0  0  0  0  0  0  0  0 0 0 1 3 6 10 15 21 |                           |
|                                                                             |
|              3       16                                                     |
|o3 : Matrix ZZ  <-- ZZ                                                       |
|-----------------------------------------------------------------------------|
|HH^i (PP2, OO_PP2(j-i)))                                                     |
+-----------------------------------------------------------------------------+

For a second example, we compute the dimensions of the cohomology groups for
some line bundles on a Hirzebruch surface.

+-----------------------------------------------------------------------------+
|i4 : FF2 = hirzebruchSurface 2;                                              |
+-----------------------------------------------------------------------------+
|i5 : HH^0 (FF2, OO_FF2(1,1))                                                 |
|                                                                             |
|       6                                                                     |
|o5 = QQ                                                                      |
|                                                                             |
|o5 : QQ-module, free                                                         |
+-----------------------------------------------------------------------------+
|i6 : matrix table (reverse toList (-7..7), toList (-7..7),  (i,j) -> rank    |
|                                                                             |
|o6 = | 20 25 30 36 42 49 56 64 72 80 88 96 104 112 120 |                     |
|     | 12 16 20 25 30 36 42 49 56 63 70 77 84  91  98  |                     |
|     | 6  9  12 16 20 25 30 36 42 48 54 60 66  72  78  |                     |
|     | 2  4  6  9  12 16 20 25 30 35 40 45 50  55  60  |                     |
|     | 0  1  2  4  6  9  12 16 20 24 28 32 36  40  44  |                     |
|     | 0  0  0  1  2  4  6  9  12 15 18 21 24  27  30  |                     |
|     | 0  0  0  0  0  1  2  4  6  8  10 12 14  16  18  |                     |
|     | 0  0  0  0  0  0  0  1  2  3  4  5  6   7   8   |                     |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0   0   0   |                     |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0   0   0   |                     |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0   0   0   |                     |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0   0   0   |                     |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0   0   0   |                     |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0   0   0   |                     |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0   0   0   |                     |
|                                                                             |
|              15       15                                                    |
|o6 : Matrix ZZ   <-- ZZ                                                      |
|-----------------------------------------------------------------------------|
|HH^0 (FF2, OO_FF2(j,i)))                                                     |
+-----------------------------------------------------------------------------+
|i7 : matrix table (reverse toList (-7..7), toList (-7..7),  (i,j) -> rank    |
|                                                                             |
|o7 = | 12 9 6 4 2 1 0 0 0 0 0 0 0 0 0  |                                     |
|     | 12 9 6 4 2 1 0 0 0 0 0 0 0 0 0  |                                     |
|     | 12 9 6 4 2 1 0 0 0 0 0 0 0 0 0  |                                     |
|     | 12 9 6 4 2 1 0 0 0 0 0 0 0 0 0  |                                     |
|     | 12 9 6 4 2 1 0 0 0 0 0 0 0 0 0  |                                     |
|     | 12 9 6 4 2 1 0 0 0 0 0 0 0 0 0  |                                     |
|     | 10 8 6 4 2 1 0 0 0 0 0 0 0 0 0  |                                     |
|     | 6  5 4 3 2 1 0 0 0 0 0 0 0 0 0  |                                     |
|     | 0  0 0 0 0 0 0 0 0 0 0 0 0 0 0  |                                     |
|     | 0  0 0 0 0 0 0 0 0 1 2 3 4 5 6  |                                     |
|     | 0  0 0 0 0 0 0 0 0 1 2 4 6 8 10 |                                     |
|     | 0  0 0 0 0 0 0 0 0 1 2 4 6 9 12 |                                     |
|     | 0  0 0 0 0 0 0 0 0 1 2 4 6 9 12 |                                     |
|     | 0  0 0 0 0 0 0 0 0 1 2 4 6 9 12 |                                     |
|     | 0  0 0 0 0 0 0 0 0 1 2 4 6 9 12 |                                     |
|                                                                             |
|              15       15                                                    |
|o7 : Matrix ZZ   <-- ZZ                                                      |
|-----------------------------------------------------------------------------|
|HH^1 (FF2, OO_FF2(j,i)))                                                     |
+-----------------------------------------------------------------------------+
|i8 : matrix table (reverse toList (-7..7), toList (-7..7),  (i,j) -> rank    |
|                                                                             |
|o8 = | 0  0  0  0  0  0  0  0  0  0  0  0  0  0 0 |                          |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0  0 0 |                          |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0  0 0 |                          |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0  0 0 |                          |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0  0 0 |                          |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0  0 0 |                          |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0  0 0 |                          |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0  0 0 |                          |
|     | 0  0  0  0  0  0  0  0  0  0  0  0  0  0 0 |                          |
|     | 8  7  6  5  4  3  2  1  0  0  0  0  0  0 0 |                          |
|     | 18 16 14 12 10 8  6  4  2  1  0  0  0  0 0 |                          |
|     | 30 27 24 21 18 15 12 9  6  4  2  1  0  0 0 |                          |
|     | 44 40 36 32 28 24 20 16 12 9  6  4  2  1 0 |                          |
|     | 60 55 50 45 40 35 30 25 20 16 12 9  6  4 2 |                          |
|     | 78 72 66 60 54 48 42 36 30 25 20 16 12 9 6 |                          |
|                                                                             |
|              15       15                                                    |
|o8 : Matrix ZZ   <-- ZZ                                                      |
|-----------------------------------------------------------------------------|
|HH^2 (FF2, OO_FF2(j,i)))                                                     |
+-----------------------------------------------------------------------------+

When F is free, the algorithm based on [Diane Maclagan and Gregory G. Smith,
Multigraded Castelnuovo-Mumford regularity (see
http://arxiv.org/abs/math.AC/0305214 ), J. Reine Angew. Math. 571 (2004),
179-212].  The general case uses the methods described in [David Eisenbud,
Mircea Mustata, and Mike Stillman, Cohomology on toric varieties and local
cohomology with monomial supports (see http://arxiv.org/abs/math.AG/0001159 ),
J. Symbolic Comput. 29 (2000), 583-600].

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * sheaf(NormalToricVariety,Module)
    -- make a coherent sheaf
  * sheaf(NormalToricVariety,Ring),
    -- make a coherent sheaf of rings

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

  * HH^ZZ(NormalToricVariety,CoherentSheaf)
    -- compute the cohomology of
    a coherent sheaf
  * "HH^ZZ(NormalToricVariety,SheafOfRings)"
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/SheavesDocumentation.m2:450:0.

hilbertPolynomial(NormalToricVariety) -- compute the multivariate Hilbert polynomial
************************************************************************************

  * Function: hilbertPolynomial (Macaulay2Doc),
  * Usage:
        hilbertPolynomial X
  * Inputs:
      * X, a normal toric variety, that is smooth
        and complete
  * Optional inputs (Macaulay2Doc),:
      * Projective (Macaulay2Doc),
        => ..., default value true, unused
  * Outputs:
      * a ring element (Macaulay2Doc), the Hilbert
        polynomial of X

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

The Hilbert polynomial of a smooth projective toric variety $X$ is the Euler
characteristic of $OO_X(i_0,i_1,...,i_r)$ where $r$ is the rank of the Picard
group of $X$ and $i_0,i_1,...,i_r$ are formal variables.  The Hilbert
polynomial agrees with the Hilbert function when evaluated at any point in the
nef cone.

On projective space, one recovers the standard Hilbert polynomial.

+-----------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                         |
+-----------------------------------------------------------+
|i2 : h0 = hilbertPolynomial PP2                            |
|                                                           |
|     1 2   3                                               |
|o2 = -i  + -i  + 1                                         |
|     2 0   2 0                                             |
|                                                           |
|o2 : QQ[i ]                                                |
|         0                                                 |
+-----------------------------------------------------------+
|i3 : factor h0                                             |
|                                                           |
|                      1                                    |
|o3 = (i  + 1)(i  + 2)(-)                                   |
|       0       0      2                                    |
|                                                           |
|o3 : Expression of class Product                           |
+-----------------------------------------------------------+
|i4 : h1 = hilbertPolynomial (ring PP2, Projective => false)|
|                                                           |
|     1 2   3                                               |
|o4 = -i  + -i + 1                                          |
|     2     2                                               |
|                                                           |
|o4 : QQ[i]                                                 |
+-----------------------------------------------------------+
|i5 : assert (h0 === sub(h1, (ring h1)_0 => (ring h0)_0))   |
+-----------------------------------------------------------+
|i6 : PP3 = toricProjectiveSpace 3;                         |
+-----------------------------------------------------------+
|i7 : h2 = hilbertPolynomial PP3                            |
|                                                           |
|     1 3    2   11                                         |
|o7 = -i  + i  + --i  + 1                                   |
|     6 0    0    6 0                                       |
|                                                           |
|o7 : QQ[i ]                                                |
|         0                                                 |
+-----------------------------------------------------------+
|i8 : factor h2                                             |
|                                                           |
|                              1                            |
|o8 = (i  + 1)(i  + 2)(i  + 3)(-)                           |
|       0       0       0      6                            |
|                                                           |
|o8 : Expression of class Product                           |
+-----------------------------------------------------------+
|i9 : h3 = hilbertPolynomial (ring PP3, Projective => false)|
|                                                           |
|     1 3    2   11                                         |
|o9 = -i  + i  + --i + 1                                    |
|     6           6                                         |
|                                                           |
|o9 : QQ[i]                                                 |
+-----------------------------------------------------------+
|i10 : assert (h2 === sub(h3, (ring h3)_0 => (ring h2)_0))  |
+-----------------------------------------------------------+

The Hilbert polynomial of a product of normal toric varieties is simply the
product of the Hilbert polynomials of the factors.

+-----------------------------------------------------------------------------+
|i11 : X = toricProjectiveSpace (2) ** toricProjectiveSpace (3);              |
+-----------------------------------------------------------------------------+
|i12 : h3 = hilbertPolynomial X                                               |
|                                                                             |
|       1 2 3   1 2 2   1   3   11 2     3   2   1 3   1 2   11        2   3  |
|o12 = --i i  + -i i  + -i i  + --i i  + -i i  + -i  + -i  + --i i  + i  + -i |
|      12 0 1   2 0 1   4 0 1   12 0 1   2 0 1   6 1   2 0    4 0 1    1   2 0|
|      -----------------------------------------------------------------------|
|        11                                                                   |
|      + --i  + 1                                                             |
|         6 1                                                                 |
|                                                                             |
|o12 : QQ[i ..i ]                                                             |
|          0   1                                                              |
+-----------------------------------------------------------------------------+
|i13 : factor h3                                                              |
|                                                                             |
|                                                1                            |
|o13 = (i  + 1)(i  + 2)(i  + 3)(i  + 1)(i  + 2)(--)                           |
|        1       1       1       0       0      12                            |
|                                                                             |
|o13 : Expression of class Product                                            |
+-----------------------------------------------------------------------------+

Example 2.9 in [Diane Maclagan and Gregory G. Smith, Uniform bounds on
multigraded regularity (see http://arxiv.org/abs/math.AC/0305215 ), J.
Algebraic Geom. 14 (2005), 137-164] describes the Hilbert polynomials on a
Hirzebruch surface.

+----------------------------------------------------------------------+
|i14 : a = random (9)                                                  |
|                                                                      |
|o14 = 8                                                               |
+----------------------------------------------------------------------+
|i15 : FFa = hirzebruchSurface a;                                      |
+----------------------------------------------------------------------+
|i16 : h4 = hilbertPolynomial FFa                                      |
|                                                                      |
|               2                                                      |
|o16 = i i  + 4i  + i  + 5i  + 1                                       |
|       0 1     1    0     1                                           |
|                                                                      |
|o16 : QQ[i ..i ]                                                      |
|          0   1                                                       |
+----------------------------------------------------------------------+
|i17 : R = ring h4;                                                    |
+----------------------------------------------------------------------+
|i18 : assert (h4 == R_0 * R_1 + (a/2)*R_1^2 + R_0 + ((a+2)/2)*R_1 + 1)|
+----------------------------------------------------------------------+

The Hilbert polynomial is computed using the Hirzebruch-Riemann-Roch Theorem.
In particular, this method depends on the Schubert2,
package.

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * hilbertPolynomial(NormalToricVariety,CoherentSheaf)
    -- compute the
    multivariate Hilbert polynomial
  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth

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

  * hilbertPolynomial(NormalToricVariety)
    -- compute the multivariate
    Hilbert polynomial
  * "hilbertPolynomial(NormalToricVariety,Ring)"
  * "hilbertPolynomial(NormalToricVariety,SheafOfRings)"
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:612:0.

hilbertPolynomial(NormalToricVariety,CoherentSheaf) -- compute the multivariate Hilbert polynomial
**************************************************************************************************

  * Function: hilbertPolynomial (Macaulay2Doc),
  * Usage:
        hilbertPolynomial (X, F)
  * Inputs:
      * X, a normal toric variety, that is smooth
        and complete
      * F, a coherent sheaf (Varieties), on X
  * Optional inputs (Macaulay2Doc),:
      * Projective (Macaulay2Doc),
        => ..., default value true, unused
  * Outputs:
      * a ring element (Macaulay2Doc), the Hilbert
        polynomial of X

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

The Hilbert polynomial of a coherent sheaf $F$ on smooth normal toric variety
$X$ is the Euler characteristic of $F ** OO_X(i_0,i_1,...,i_r)$ where $r$ is
the rank of the Picard group of $X$ and $i_0,i_1,...,i_r$ are formal variables.
The Hilbert polynomial agrees with the Hilbert function when evaluated at any
point sufficiently far in the interior of in the nef cone.

For a graded module over the total coordinate ring of $X$, this method computes
the Hilbert polynomial of the corresponding coherent sheaf.  Given an ideal $I$
in the total coordinate ring, it computes the Hilbert polynomial of the
coherent sheaf associated to $S^1/I$.

The cotangent bundle on a smooth surface provides simple examples.

+---------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                       |
+---------------------------------------------------------+
|i2 : OmegaPP2 = cotangentSheaf PP2                       |
|                                                         |
|o2 = cokernel {2} | x_2  |                               |
|              {2} | x_0  |                               |
|              {2} | -x_1 |                               |
|                                                         |
|                                             3           |
|o2 : coherent sheaf on PP2, quotient of OO    (-2)       |
|                                          PP2            |
+---------------------------------------------------------+
|i3 : h0 = hilbertPolynomial (PP2, OmegaPP2)              |
|                                                         |
|      2                                                  |
|o3 = i  - 1                                              |
|      0                                                  |
|                                                         |
|o3 : QQ[i ]                                              |
|         0                                               |
+---------------------------------------------------------+
|i4 : for i to 10 list hilbertFunction(i, module OmegaPP2)|
|                                                         |
|o4 = {0, 0, 3, 8, 15, 24, 35, 48, 63, 80, 99}            |
|                                                         |
|o4 : List                                                |
+---------------------------------------------------------+
|i5 : R = ring h0;                                        |
+---------------------------------------------------------+
|i6 : for i to 10 list sub(h0, R_0 => i)                  |
|                                                         |
|o6 = {-1, 0, 3, 8, 15, 24, 35, 48, 63, 80, 99}           |
|                                                         |
|o6 : List                                                |
+---------------------------------------------------------+
+---------------------------------------------------------------------------+
|i7 : FF3 = hirzebruchSurface 3;                                            |
+---------------------------------------------------------------------------+
|i8 : OmegaFF3 = cotangentSheaf FF3                                         |
|                                                                           |
|o8 = cokernel {2, 0}  | 3x_1x_3 |                                          |
|              {-2, 2} | x_0     |                                          |
|              {-2, 2} | -x_2    |                                          |
|                                                                           |
|                                             1                 2           |
|o8 : coherent sheaf on FF3, quotient of OO     (-2, 0) ++ OO     (2, -2)   |
|                                          FF3               FF3            |
+---------------------------------------------------------------------------+
|i9 : h1 = hilbertPolynomial (FF3, OmegaFF3)                                |
|                                                                           |
|               2                                                           |
|o9 = 2i i  + 3i  - 2                                                       |
|       0 1     1                                                           |
|                                                                           |
|o9 : QQ[i ..i ]                                                            |
|         0   1                                                             |
+---------------------------------------------------------------------------+
|i10 : matrix table(5,5, (i,j) -> hilbertFunction({j,4-i}, module OmegaFF3))|
|                                                                           |
|o10 = | 47 54 62 70 78 |                                                   |
|      | 26 31 37 43 49 |                                                   |
|      | 11 14 18 22 26 |                                                   |
|      | 2  3  5  7  9  |                                                   |
|      | 0  0  1  2  3  |                                                   |
|                                                                           |
|               5       5                                                   |
|o10 : Matrix ZZ  <-- ZZ                                                    |
+---------------------------------------------------------------------------+
|i11 : R = ring h1;                                                         |
+---------------------------------------------------------------------------+
|i12 : matrix table(5,5, (i,j) -> sub(h1, {R_0 => j, R_1 => 4-i}))          |
|                                                                           |
|o12 = | 46 54 62 70 78 |                                                   |
|      | 25 31 37 43 49 |                                                   |
|      | 10 14 18 22 26 |                                                   |
|      | 1  3  5  7  9  |                                                   |
|      | -2 -2 -2 -2 -2 |                                                   |
|                                                                           |
|               5       5                                                   |
|o12 : Matrix QQ  <-- QQ                                                    |
+---------------------------------------------------------------------------+

Example 2.16 in Diane Maclagan and Gregory G. Smith's Uniform bounds on
multigraded regularity (see http://arxiv.org/abs/math.AC/0305215 ), J.
Algebraic Geom. 14 (2005), 137-164 shows that the Hilbert function for a set of
points agrees with the Hilbert polynomial precisedly on the multigraded
regularity.

+-----------------------------------------------------------------------------+
|i13 : X = toricProjectiveSpace (1) ** toricProjectiveSpace (1);              |
+-----------------------------------------------------------------------------+
|i14 : S = ring X;                                                            |
+-----------------------------------------------------------------------------+
|i15 : I = intersect (ideal (S_1-S_0, S_3-S_2), ideal (S_1-S_0, S_3-2*S_2), id|
|                                                                             |
|                4      3        2 2        3    4      3       2         2   |
|o15 = ideal (24x  - 50x x  + 35x x  - 10x x  + x , 2x x  - 2x x x  - 3x x x  |
|                2      2 3      2 3      2 3    3    1 2     0 2 3     1 2 3 |
|      -----------------------------------------------------------------------|
|              2        2      3       3        2         2            2      |
|      + 3x x x  + x x x  - x x , 24x x  - 50x x x  + 2x x x  + 33x x x  -    |
|          0 2 3    1 2 3    0 3     0 2      0 2 3     1 2 3      0 2 3      |
|      -----------------------------------------------------------------------|
|            2       3      3    2 2     2         2 2         2        2     |
|      3x x x  - 7x x  + x x , 2x x  - 3x x x  - 2x x  + 3x x x , 2x x x  -   |
|        1 2 3     0 3    1 3    1 2     1 2 3     0 3     0 1 3    0 1 2     |
|      -----------------------------------------------------------------------|
|        2        2            2     2 2      2                      2        |
|      2x x x  - x x x  + x x x , 24x x  - 50x x x  + 21x x x x  - 7x x x  +  |
|        0 2 3    1 2 3    0 1 3     0 2      0 2 3      0 1 2 3     1 2 3    |
|      -----------------------------------------------------------------------|
|         2 2         2    2 2    2           2      3       3       2        |
|      14x x  - 3x x x  + x x , 2x x x  - 3x x x  + x x  - 2x x  + 3x x x  -  |
|         0 3     0 1 3    1 3    0 1 2     0 1 2    1 2     0 3     0 1 3    |
|      -----------------------------------------------------------------------|
|         2       3          2        3        3        2            2        |
|      x x x , 24x x  - 42x x x  + 18x x  - 50x x  + 77x x x  - 28x x x  +    |
|       0 1 3     0 2      0 1 2      1 2      0 3      0 1 3      0 1 3      |
|      -----------------------------------------------------------------------|
|       3       4      3        2 2        3    4                             |
|      x x , 24x  - 50x x  + 35x x  - 10x x  + x )                            |
|       1 3     0      0 1      0 1      0 1    1                             |
|                                                                             |
|o15 : Ideal of S                                                             |
|-----------------------------------------------------------------------------|
|eal (S_1-2*S_0, S_3-S_2), ideal (S_1-2*S_0, S_3-2*S_2), ideal (S_1-3*S_0,    |
|-----------------------------------------------------------------------------|
|S_3-3*S_2), ideal (S_1-4*S_0, S_3-4*S_2))                                    |
+-----------------------------------------------------------------------------+
|i16 : assert (I == saturate (I, ideal X))                                    |
+-----------------------------------------------------------------------------+
|i17 : hilbertPolynomial (X, I)                                               |
|                                                                             |
|o17 = 6                                                                      |
|                                                                             |
|o17 : QQ[i ..i ]                                                             |
|          0   1                                                              |
+-----------------------------------------------------------------------------+
|i18 : matrix table(5,5, (i,j) -> hilbertFunction({j,4-i}, I))                |
|                                                                             |
|o18 = | 4 6 6 6 6 |                                                          |
|      | 4 6 6 6 6 |                                                          |
|      | 3 6 6 6 6 |                                                          |
|      | 2 4 6 6 6 |                                                          |
|      | 1 2 3 4 4 |                                                          |
|                                                                             |
|               5       5                                                     |
|o18 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * hilbertPolynomial(NormalToricVariety)
    -- compute the multivariate
    Hilbert polynomial
  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth

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

  * hilbertPolynomial(NormalToricVariety,CoherentSheaf)
    -- compute the
    multivariate Hilbert polynomial
  * "hilbertPolynomial(NormalToricVariety,Ideal)"
  * "hilbertPolynomial(NormalToricVariety,Module)"
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:682:0.

hirzebruchSurface(ZZ) -- make any Hirzebruch surface
****************************************************

  * Function: hirzebruchSurface,
  * Usage:
        hirzebruchSurface a
  * Inputs:
      * a, an integer (Macaulay2Doc), that determines which
        Hirzebruch surface
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        that specifies the coefficient ring of the total coordinate ring,
      * Variable => a symbol (Macaulay2Doc), default value x,
        that specifies the base name (Macaulay2Doc), for the
        indexed variables in the total coordinate ring
  * Outputs:
      * a normal toric variety, that is a Hirzebruch
        surface

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

The $a$-{th} Hirzebruch surface is a smooth projective normal toric variety.
It can be defined as the $\PP^1$-bundle over $X = \PP^1$ associated to the
sheaf ${\mathcal O}_X(0) \oplus {\mathcal O}_X(a)$.  It is also the quotient of
affine $4$-space by a rank two torus.

+---------------------------------------------------------------------+
|i1 : FF3 = hirzebruchSurface 3;                                      |
+---------------------------------------------------------------------+
|i2 : rays FF3                                                        |
|                                                                     |
|o2 = {{1, 0}, {0, 1}, {-1, 3}, {0, -1}}                              |
|                                                                     |
|o2 : List                                                            |
+---------------------------------------------------------------------+
|i3 : max FF3                                                         |
|                                                                     |
|o3 = {{0, 1}, {0, 3}, {1, 2}, {2, 3}}                                |
|                                                                     |
|o3 : List                                                            |
+---------------------------------------------------------------------+
|i4 : dim FF3                                                         |
|                                                                     |
|o4 = 2                                                               |
+---------------------------------------------------------------------+
|i5 : ring FF3                                                        |
|                                                                     |
|o5 = QQ[x ..x ]                                                      |
|         0   3                                                       |
|                                                                     |
|o5 : PolynomialRing                                                  |
+---------------------------------------------------------------------+
|i6 : degrees ring FF3                                                |
|                                                                     |
|o6 = {{1, 0}, {-3, 1}, {1, 0}, {0, 1}}                               |
|                                                                     |
|o6 : List                                                            |
+---------------------------------------------------------------------+
|i7 : ideal FF3                                                       |
|                                                                     |
|o7 = ideal (x x , x x , x x , x x )                                  |
|             2 3   1 2   0 3   0 1                                   |
|                                                                     |
|o7 : Ideal of QQ[x ..x ]                                             |
|                  0   3                                              |
+---------------------------------------------------------------------+
|i8 : assert (isWellDefined FF3 and isProjective FF3 and isSmooth FF3)|
+---------------------------------------------------------------------+

When $a = 0$, we obtain $\PP^1 \times \PP^1$.

+-----------------------------------------------------------------------------+
|i9 : FF0 = hirzebruchSurface (0, CoefficientRing => ZZ/32003, Variable => y);|
+-----------------------------------------------------------------------------+
|i10 : rays FF0                                                               |
|                                                                             |
|o10 = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}}                                     |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+
|i11 : max FF0                                                                |
|                                                                             |
|o11 = {{0, 1}, {0, 3}, {1, 2}, {2, 3}}                                       |
|                                                                             |
|o11 : List                                                                   |
+-----------------------------------------------------------------------------+
|i12 : ring FF0                                                               |
|                                                                             |
|        ZZ                                                                   |
|o12 = -----[y ..y ]                                                          |
|      32003  0   3                                                           |
|                                                                             |
|o12 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i13 : degrees ring FF0                                                       |
|                                                                             |
|o13 = {{1, 0}, {0, 1}, {1, 0}, {0, 1}}                                       |
|                                                                             |
|o13 : List                                                                   |
+-----------------------------------------------------------------------------+
|i14 : I = ideal FF0                                                          |
|                                                                             |
|o14 = ideal (y y , y y , y y , y y )                                         |
|              2 3   1 2   0 3   0 1                                          |
|                                                                             |
|                 ZZ                                                          |
|o14 : Ideal of -----[y ..y ]                                                 |
|               32003  0   3                                                  |
+-----------------------------------------------------------------------------+
|i15 : decompose I                                                            |
|                                                                             |
|o15 = {ideal (y , y ), ideal (y , y )}                                       |
|               2   0           3   1                                         |
|                                                                             |
|o15 : List                                                                   |
+-----------------------------------------------------------------------------+
|i16 : assert (isWellDefined FF0 and isProjective FF3 and isSmooth FF3)       |
+-----------------------------------------------------------------------------+

The map from the group of torus-invariant Weil divisors,
to the class group,
is chosen so that the positive orthant
corresponds to the cone of nef line bundles.

+------------------------+
|i17 : nefGenerators FF3 |
|                        |
|o17 = | 1 0 |           |
|      | 0 1 |           |
|                        |
|               2       2|
|o17 : Matrix ZZ  <-- ZZ |
+------------------------+
|i18 : nefGenerators FF0 |
|                        |
|o18 = | 1 0 |           |
|      | 0 1 |           |
|                        |
|               2       2|
|o18 : Matrix ZZ  <-- ZZ |
+------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
  * nefGenerators (missing documentation)

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

  * hirzebruchSurface(ZZ) -- make any
    Hirzebruch surface
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:840:0.

id _ NormalToricVariety -- make the identity map from a NormalToricVariety to itself
************************************************************************************

  * Scripted functor: id (Macaulay2Doc),
  * Usage:
        id_X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a toric map,

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

For the identity map on a normal toric variety, the underlying map of lattices
is given by the identity matrix. For more information on this correspondence,
see Theorem 3.3.4 in Cox-Little-Schenck's Toric Varieties.

+---------------------------------------------------------+
|i1 : X = hirzebruchSurface 2;                            |
+---------------------------------------------------------+
|i2 : f = id_X                                            |
|                                                         |
|o2 = | 1 0 |                                             |
|     | 0 1 |                                             |
|                                                         |
|o2 : ToricMap X <--- X                                   |
+---------------------------------------------------------+
|i3 : assert (isWellDefined f and source f === X and      |
|         target f === X and matrix f === id_(ZZ^(dim X)))|
+---------------------------------------------------------+

Identity maps also arise as edge cases of the canonical projections,
and inclusions,
associated to Cartesian products.

+-----------------------------------------------------+
|i4 : X2 = X ** X;                                    |
+-----------------------------------------------------+
|i5 : X2^[0,1]                                        |
|                                                     |
|o5 = | 1 0 0 0 |                                     |
|     | 0 1 0 0 |                                     |
|     | 0 0 1 0 |                                     |
|     | 0 0 0 1 |                                     |
|                                                     |
|o5 : ToricMap X2 <--- X2                             |
+-----------------------------------------------------+
|i6 : X2_[0,1]                                        |
|                                                     |
|o6 = | 1 0 0 0 |                                     |
|     | 0 1 0 0 |                                     |
|     | 0 0 1 0 |                                     |
|     | 0 0 0 1 |                                     |
|                                                     |
|o6 : ToricMap X2 <--- X2                             |
+-----------------------------------------------------+
|i7 : assert (X2^[0,1] == id_X2 and X2_[0,1] == id_X2)|
+-----------------------------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * map(NormalToricVariety,NormalToricVariety,ZZ)
    -- make a
    torus-equivariant map between normal toric varieties
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * id (Macaulay2Doc) -- identity map

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

  * id _ NormalToricVariety -- make the
    identity map from a NormalToricVariety to itself
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:478:0.

ideal(NormalToricVariety) -- make the irrelevant ideal
******************************************************

  * Function: ideal (Macaulay2Doc),
  * Usage:
        ideal X
        monomialIdeal X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * an ideal (Macaulay2Doc), that is homogeneous in the total
        coordinate ring of $X$

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

The irrelevant ideal is a reduced monomial ideal in the total coordinate ring,
that encodes the combinatorics of the fan.
For each maximal cone in the fan, it has a minimal generator, namely the
product of the variables not indexed by elements of the list corresponding to
the maximal cone.  For more information, see Subsection 5.3 in
Cox-Little-Schenck's Toric Varieties.

For projective space, the irrelevant ideal
is generated by the variables.

+--------------------------------------------------+
|i1 : PP4 = toricProjectiveSpace 4;                |
+--------------------------------------------------+
|i2 : B = ideal PP4                                |
|                                                  |
|o2 = ideal (x , x , x , x , x )                   |
|             4   3   2   1   0                    |
|                                                  |
|o2 : Ideal of QQ[x ..x ]                          |
|                  0   4                           |
+--------------------------------------------------+
|i3 : assert (isMonomialIdeal B and B == radical B)|
+--------------------------------------------------+
|i4 : monomialIdeal PP4                            |
|                                                  |
|o4 = monomialIdeal (x , x , x , x , x )           |
|                     0   1   2   3   4            |
|                                                  |
|o4 : MonomialIdeal of QQ[x ..x ]                  |
|                          0   4                   |
+--------------------------------------------------+
|i5 : assert (B == monomialIdeal PP4)              |
+--------------------------------------------------+

For an affine toric variety, the irrelevant ideal is the unit ideal.

+-----------------------------------------------------------------------------+
|i6 : C = normalToricVariety ({{1,0,0},{0,1,0},{0,0,1},{1,1,-1}},             |
|-----------------------------------------------------------------------------|
|{{0,1,2,3}});                                                                |
+-----------------------------------------------------------------------------+
|i7 : ideal C                                                                 |
|                                                                             |
|o7 = ideal 1                                                                 |
|                                                                             |
|o7 : Ideal of QQ[x ..x ]                                                     |
|                  0   3                                                      |
+-----------------------------------------------------------------------------+
|i8 : assert (monomialIdeal C == 1)                                           |
+-----------------------------------------------------------------------------+
|i9 : monomialIdeal affineSpace 3                                             |
|                                                                             |
|o9 = monomialIdeal 1                                                         |
|                                                                             |
|o9 : MonomialIdeal of QQ[x ..x ]                                             |
|                          0   2                                              |
+-----------------------------------------------------------------------------+
|i10 : assert (ideal affineSpace 3 == 1)                                      |
+-----------------------------------------------------------------------------+

The irrelevant ideal for a product,
of toric varieties is intersection of the irrelevant ideal
of the factors.

+-----------------------------------------------------------------------------+
|i11 : X = toricProjectiveSpace (2) ** toricProjectiveSpace (3);              |
+-----------------------------------------------------------------------------+
|i12 : S = ring X;                                                            |
+-----------------------------------------------------------------------------+
|i13 : B = ideal X                                                            |
|                                                                             |
|o13 = ideal (x x , x x , x x , x x , x x , x x , x x , x x , x x , x x ,     |
|              2 6   2 5   2 4   2 3   1 6   1 5   1 4   1 3   0 6   0 5      |
|      -----------------------------------------------------------------------|
|      x x , x x )                                                            |
|       0 4   0 3                                                             |
|                                                                             |
|o13 : Ideal of S                                                             |
+-----------------------------------------------------------------------------+
|i14 : primaryDecomposition B                                                 |
|                                                                             |
|o14 = {ideal (x , x , x ), ideal (x , x , x , x )}                           |
|               2   1   0           6   5   4   3                             |
|                                                                             |
|o14 : List                                                                   |
+-----------------------------------------------------------------------------+
|i15 : dual monomialIdeal B                                                   |
|                                                                             |
|o15 = monomialIdeal (x x x , x x x x )                                       |
|                      0 1 2   3 4 5 6                                        |
|                                                                             |
|o15 : MonomialIdeal of S                                                     |
+-----------------------------------------------------------------------------+

For a complete (Polyhedra), simplicial (Polyhedra),
toric variety, the irrelevant ideal is the Alexander
dual of the Stanley-Reisner ideal of the fan.

+-----------------------------------------------------------------------------+
|i16 : Y = smoothFanoToricVariety (2,3);                                      |
+-----------------------------------------------------------------------------+
|i17 : dual monomialIdeal Y                                                   |
|                                                                             |
|o17 = monomialIdeal (x x , x x , x x , x x , x x )                           |
|                      0 2   0 3   1 3   1 4   2 4                            |
|                                                                             |
|o17 : MonomialIdeal of QQ[x ..x ]                                            |
|                           0   4                                             |
+-----------------------------------------------------------------------------+
|i18 : sort apply (max Y, s -> select (# rays Y, i -> not member (i,s)))      |
|                                                                             |
|o18 = {{0, 1, 2}, {0, 1, 4}, {0, 3, 4}, {1, 2, 3}, {2, 3, 4}}                |
|                                                                             |
|o18 : List                                                                   |
+-----------------------------------------------------------------------------+
|i19 : primaryDecomposition dual monomialIdeal Y                              |
|                                                                             |
|o19 = {monomialIdeal (x , x , x ), monomialIdeal (x , x , x ), monomialIdeal |
|                       0   1   2                   0   1   4                 |
|      -----------------------------------------------------------------------|
|      (x , x , x ), monomialIdeal (x , x , x ), monomialIdeal (x , x , x )}  |
|        0   3   4                   1   2   3                   2   3   4    |
|                                                                             |
|o19 : List                                                                   |
+-----------------------------------------------------------------------------+

Since the irrelevant ideal is a monomial ideal, the command
monomialIdeal (Macaulay2Doc), also produces the irrelevant ideal.

+-----------------------------------------------------------------------------+
|i20 : code (monomialIdeal, NormalToricVariety)                               |
|                                                                             |
|o20 = -- code for method: monomialIdeal(NormalToricVariety)                  |
|      ../../../../../Macaulay2/packages/NormalToricVarieties/Sheaves.m2:34:53|
|      -35:25: --source code:                                                 |
|      monomialIdeal NormalToricVariety := MonomialIdeal => X ->              |
|          monomialIdeal ideal X                                              |
+-----------------------------------------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)

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

  * ideal(NormalToricVariety) -- make the
    irrelevant ideal
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/SheavesDocumentation.m2:251:0.

ideal(ToricMap) -- make the ideal defining the closure of the image
*******************************************************************

  * Function: ideal (Macaulay2Doc),
  * Usage:
        ideal f
  * Inputs:
      * f, a toric map,
  * Outputs:
      * an ideal (Macaulay2Doc), in the homogeneous coordinate
        ring (a.k.a. Cox ring) of the target

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

The closure of image of a morphism $f : X \to Y$ is a closed subscheme in $Y$.
All closed subschemes in normal toric variety $Y$ correspond to a saturated
homogeneous ideal in the total coordinate ring,
(a.k.a. Cox ring) of $Y$.  For more information,
see Proposition 5.2.4 in Cox-Little-Schenck's Toric Varieties.  This method
returns the saturated homogeneous ideal corresponding to the closure of the
image $f$.

The closure of a distinguished affine, open set in
the projective space, is the entire space.

+----------------------------------------------------+
|i1 : A = affineSpace 4;                             |
+----------------------------------------------------+
|i2 : P = toricProjectiveSpace 4;                    |
+----------------------------------------------------+
|i3 : iota = map(P, A, 1)                            |
|                                                    |
|o3 = | 1 0 0 0 |                                    |
|     | 0 1 0 0 |                                    |
|     | 0 0 1 0 |                                    |
|     | 0 0 0 1 |                                    |
|                                                    |
|o3 : ToricMap P <--- A                              |
+----------------------------------------------------+
|i4 : ideal iota                                     |
|                                                    |
|o4 = ideal 0                                        |
|                                                    |
|o4 : Ideal of QQ[x ..x ]                            |
|                  0   4                             |
+----------------------------------------------------+
|i5 : assert (isWellDefined iota and ideal iota == 0)|
+----------------------------------------------------+

The twisted cubic curve is the image of a map from the projective line to the
projective $3$-space.

+-------------------------------------------------------------------+
|i6 : X = toricProjectiveSpace 1;                                   |
+-------------------------------------------------------------------+
|i7 : Y = toricProjectiveSpace 3;                                   |
+-------------------------------------------------------------------+
|i8 : f = map(Y, X, matrix{{1}, {2}, {3}})                          |
|                                                                   |
|o8 = | 1 |                                                         |
|     | 2 |                                                         |
|     | 3 |                                                         |
|                                                                   |
|o8 : ToricMap Y <--- X                                             |
+-------------------------------------------------------------------+
|i9 : S = ring Y;                                                   |
+-------------------------------------------------------------------+
|i10 : I = ideal f                                                  |
|                                                                   |
|              2                       2                            |
|o10 = ideal (x  - x x , x x  - x x , x  - x x )                    |
|              2    1 3   1 2    0 3   1    0 2                     |
|                                                                   |
|o10 : Ideal of S                                                   |
+-------------------------------------------------------------------+
|i11 : assert (isWellDefined f and isHomogeneous I and              |
|          I == saturate(I, ideal Y) and I == ker inducedMap f and  |
|          I == minors(2, matrix{{S_0, S_1, S_2}, {S_1, S_2, S_3}}))|
+-------------------------------------------------------------------+

Thirdly, we have the image of diagonal embedding of the projective $4$-space.

+-----------------------------------------------------------------------------+
|i12 : (Y2 = Y ** Y, R = ring Y2);                                            |
+-----------------------------------------------------------------------------+
|i13 : g = diagonalToricMap(Y, 2);                                            |
|                                                                             |
|o13 : ToricMap Y2 <--- Y                                                     |
+-----------------------------------------------------------------------------+
|i14 : J = ideal g                                                            |
|                                                                             |
|o14 = ideal (x x  - x x , x x  - x x , x x  - x x , x x  - x x , x x  - x x ,|
|              3 6    2 7   3 5    1 7   2 5    1 6   3 4    0 7   2 4    0 6 |
|      -----------------------------------------------------------------------|
|      x x  - x x )                                                           |
|       1 4    0 5                                                            |
|                                                                             |
|o14 : Ideal of R                                                             |
+-----------------------------------------------------------------------------+
|i15 : assert (isWellDefined g and isHomogeneous J and                        |
|          J == saturate(J, ideal Y2) and                                     |
|          J == minors(2, matrix{{R_0,R_1,R_2,R_3},{R_4,R_5,R_6,R_7}}))       |
+-----------------------------------------------------------------------------+

The algorithm used is a minor variant of Algorithm 12.3 in Bernd Sturmfels
Gröbner basis and convex polytopes, University Lecture Series 8. American
Mathematical Society, Providence, RI, 1996.

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * inducedMap(ToricMap) -- make the induced
    map between total coordinate rings (a.k.a. Cox rings)
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)

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

  * ideal(ToricMap) -- make the ideal defining the
    closure of the image
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1685:0.

inducedMap(ToricMap) -- make the induced map between total coordinate rings (a.k.a. Cox rings)
**********************************************************************************************

  * Function: inducedMap (Macaulay2Doc),
  * Usage:
        inducedMap f
  * Inputs:
      * f, a toric map, with a smooth target
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc),
        => ..., default value null, unused
      * Verify (Macaulay2Doc),
        => ..., default value true, unused
  * Outputs:
      * a ring map (Macaulay2Doc), between the total homogeneous
        coordinate rings (aka Cox rings)

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

Any morphism of varieties whose target is a smooth normal toric variety is
determined by a collection of lines bundles together with a section of each
line bundle.  This data defines a ring map whose source is the total coordinate ring,
(a.k.a. Cox ring) of target
variety.  For more information, see David A. Cox, "The Functor of a Smooth
Toric Variety", The Tohoku Mathematical Journal, Second Series, 47 (1995)
251-262, arXiv:alg-geom/9312001v2 (see https://arxiv.org/abs/alg-geom/9312001
).

Given a toric map $f : X \to Y$ where $Y$ is smooth, this method returns the
induced map from the total coordinate ring $S$ of $Y$ to the total coordinate
ring $R$ of $X$.  Since $f$ is torus-equivariant, each variable in the
polynomial ring $S$ maps to a monomial in $R$.

As a first example, we compute the map on the total coordinate rings induced by
the natural inclusion of the affine plane, into
projective plane.

+---------------------------------------------------+
|i1 : A = affineSpace 2;                            |
+---------------------------------------------------+
|i2 : P = toricProjectiveSpace 2;                   |
+---------------------------------------------------+
|i3 : f = map(P, A, 1)                              |
|                                                   |
|o3 = | 1 0 |                                       |
|     | 0 1 |                                       |
|                                                   |
|o3 : ToricMap P <--- A                             |
+---------------------------------------------------+
|i4 : (R = ring A, S = ring P);                     |
+---------------------------------------------------+
|i5 : f' = inducedMap f                             |
|                                                   |
|o5 = map (R, S, {1, x , x })                       |
|                     0   1                         |
|                                                   |
|o5 : RingMap R <-- S                               |
+---------------------------------------------------+
|i6 : f' vars S                                     |
|                                                   |
|o6 = | 1 x_0 x_1 |                                 |
|                                                   |
|             1      3                              |
|o6 : Matrix R  <-- R                               |
+---------------------------------------------------+
|i7 : ideal f == 0                                  |
|                                                   |
|o7 = true                                          |
+---------------------------------------------------+
|i8 : degrees source f'                             |
|                                                   |
|o8 = {{1}, {1}, {1}}                               |
|                                                   |
|o8 : List                                          |
+---------------------------------------------------+
|i9 : degrees target f'                             |
|                                                   |
|o9 = {{}, {}}                                      |
|                                                   |
|o9 : List                                          |
+---------------------------------------------------+
|i10 : assert (isWellDefined f and isHomogeneous f')|
+---------------------------------------------------+

The second example considers the projection from the third Hirzebruch surface,
to the projective line.

+---------------------------------------------------+
|i11 : X = hirzebruchSurface 3;                     |
+---------------------------------------------------+
|i12 : Y = toricProjectiveSpace 1;                  |
+---------------------------------------------------+
|i13 : g = map(Y, X, matrix {{1, 0}})               |
|                                                   |
|o13 = | 1 0 |                                      |
|                                                   |
|o13 : ToricMap Y <--- X                            |
+---------------------------------------------------+
|i14 : (R = ring Y, S = ring X);                    |
+---------------------------------------------------+
|i15 : g' = inducedMap g                            |
|                                                   |
|o15 = map (S, R, {x , x })                         |
|                   2   0                           |
|                                                   |
|o15 : RingMap S <-- R                              |
+---------------------------------------------------+
|i16 : degrees source g'                            |
|                                                   |
|o16 = {{1}, {1}}                                   |
|                                                   |
|o16 : List                                         |
+---------------------------------------------------+
|i17 : degrees target g'                            |
|                                                   |
|o17 = {{1, 0}, {-3, 1}, {1, 0}, {0, 1}}            |
|                                                   |
|o17 : List                                         |
+---------------------------------------------------+
|i18 : assert (isWellDefined g and isHomogeneous g')|
+---------------------------------------------------+

In the third example, we consider a third Veronese embedding of the projective
line into projective $3$-space.

+-------------------------------------------------------------------------+
|i19 : Z = toricProjectiveSpace 3;                                        |
+-------------------------------------------------------------------------+
|i20 : h = map(Z, Y, matrix {{1}, {2}, {3}})                              |
|                                                                         |
|o20 = | 1 |                                                              |
|      | 2 |                                                              |
|      | 3 |                                                              |
|                                                                         |
|o20 : ToricMap Z <--- Y                                                  |
+-------------------------------------------------------------------------+
|i21 : (R = ring Y, S = ring X);                                          |
+-------------------------------------------------------------------------+
|i22 : h' = inducedMap h                                                  |
|                                                                         |
|                            3   2       2   3                            |
|o22 = map (R, QQ[x ..x ], {x , x x , x x , x })                          |
|                  0   3     0   0 1   0 1   1                            |
|                                                                         |
|o22 : RingMap R <-- QQ[x ..x ]                                           |
|                        0   3                                            |
+-------------------------------------------------------------------------+
|i23 : degrees source g'                                                  |
|                                                                         |
|o23 = {{1}, {1}}                                                         |
|                                                                         |
|o23 : List                                                               |
+-------------------------------------------------------------------------+
|i24 : degrees target g'                                                  |
|                                                                         |
|o24 = {{1, 0}, {-3, 1}, {1, 0}, {0, 1}}                                  |
|                                                                         |
|o24 : List                                                               |
+-------------------------------------------------------------------------+
|i25 : ideal h                                                            |
|                                                                         |
|              2                       2                                  |
|o25 = ideal (x  - x x , x x  - x x , x  - x x )                          |
|              2    1 3   1 2    0 3   1    0 2                           |
|                                                                         |
|o25 : Ideal of QQ[x ..x ]                                                |
|                   0   3                                                 |
+-------------------------------------------------------------------------+
|i26 : assert (isWellDefined h and isHomogeneous h' and ideal h == ker h')|
+-------------------------------------------------------------------------+

To ensure that the induced map is homogeneous, the optional argument
DegreeMap (Macaulay2Doc), is used to record the degree of the
monomials in the target ring $R$.

+-----------------------------------------------------------------------------+
|i27 : code (inducedMap, ToricMap)                                            |
|                                                                             |
|o27 = -- code for method: inducedMap(ToricMap)                               |
|      ../../../../../Macaulay2/packages/NormalToricVarieties/ToricMaps.m2:394|
|      :34-404:5: --source code:                                              |
|      inducedMap ToricMap := RingMap => o -> (cacheValue symbol inducedMap) (|
|              Y := target f;                                                 |
|              S := ring Y;                                                   |
|              R := ring source f;                                            |
|              m := picardGroup f; -- degree map                              |
|              map(R, S, apply(numgens S, i -> (                              |
|                          exps := entries pullback(f, Y_i);                  |
|                          product(numgens R, j -> R_j^(exps#j)))),           |
|                  DegreeMap => (deg -> first entries (matrix{deg} * transpose|
|              )                                                              |
|          )                                                                  |
|-----------------------------------------------------------------------------|
|f -> (                                                                       |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
| m)))                                                                        |
+-----------------------------------------------------------------------------+

Caveat
======

This method assumes that the target is smooth. One may verify this by using
isSmooth(NormalToricVariety).

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
  * classGroup(ToricMap) -- make the induced
    map between class groups
  * pullback(ToricMap,ToricDivisor)
    -- make the pullback of a Cartier
    divisor under a toric map
  * ideal(ToricMap) -- make the ideal defining the
    closure of the image

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

  * inducedMap(ToricMap) -- make the induced
    map between total coordinate rings (a.k.a. Cox rings)
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1620:0.

isAmple(ToricDivisor) -- whether a torus-invariant Weil divisor is ample
************************************************************************

  * Function: isAmple,
  * Usage:
        isAmple D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the divisor is ample

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

A Cartier divisor is very ample when it is basepoint free and the map arising
from its complete linear series is a closed embedding. A Cartier divisor is
ample when some positive integer multiple is very ample.  For a torus-invariant
Cartier divisor on a complete normal toric variety, the following conditions
are equivalent:

  * the divisor is ample;
  * the real piecewise linear support function associated to the divisor is
    strictly convex;
  * the lattice polytope corresponding to the divisor is full-dimensional and
    its normal fan equals the fan associated to the underlying toric variety;
  * the intersection product of the divisor with every torus-invariant
    irreducible curve is positive.

On projective space, every torus-invariant irreducible divisor is ample.

+------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;              |
+------------------------------------------------+
|i2 : assert all (# rays PP3, i -> isAmple PP3_i)|
+------------------------------------------------+

On a Hirzebruch surface, none of the torus-invariant irreducible divisors are
ample.

+--------------------------------------------------+
|i3 : X1 = hirzebruchSurface 2;                    |
+--------------------------------------------------+
|i4 : assert not any (# rays X1, i -> isAmple X1_i)|
+--------------------------------------------------+
|i5 : D = X1_2 + X1_3                              |
|                                                  |
|o5 = X1  + X1                                     |
|       2     3                                    |
|                                                  |
|o5 : ToricDivisor on X1                           |
+--------------------------------------------------+
|i6 : assert isAmple D                             |
+--------------------------------------------------+
|i7 : assert isProjective X1                       |
+--------------------------------------------------+

A normal toric variety is Fano if and only if its anticanonical divisors,
namely minus the sum of its torus-invariant irreducible divisors, is ample.

+------------------------------------------------------------------------+
|i8 : X2 = smoothFanoToricVariety (3,5);                                 |
+------------------------------------------------------------------------+
|i9 : K = toricDivisor X2                                                |
|                                                                        |
|o9 = - X2  - X2  - X2  - X2  - X2  - X2                                 |
|         0     1     2     3     4     5                                |
|                                                                        |
|o9 : ToricDivisor on X2                                                 |
+------------------------------------------------------------------------+
|i10 : assert isAmple (- K)                                              |
+------------------------------------------------------------------------+
|i11 : X3 = kleinschmidt (9,{1,2,3});                                    |
+------------------------------------------------------------------------+
|i12 : K = toricDivisor X3                                               |
|                                                                        |
|o12 = - X3  - X3  - X3  - X3  - X3  - X3  - X3  - X3  - X3  - X3  - X3  |
|          0     1     2     3     4     5     6     7     8     9     10|
|                                                                        |
|o12 : ToricDivisor on X3                                                |
+------------------------------------------------------------------------+
|i13 : assert isAmple (-K)                                               |
+------------------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * isVeryAmple(ToricDivisor) -- whether
    a torus-invariant Weil divisor is very ample
  * isProjective(NormalToricVariety)
    -- whether a toric variety is
    projective
  * isNef(ToricDivisor) -- whether a
    torus-invariant Weil divisor is nef
  * isFano(NormalToricVariety), --
    whether a normal toric variety is Fano

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

  * isAmple(ToricDivisor) -- whether a
    torus-invariant Weil divisor is ample
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1842:0.

isCartier(ToricDivisor) -- whether a torus-invariant Weil divisor is Cartier
****************************************************************************

  * Function: isCartier,
  * Usage:
        isCartier D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the divisor is Cartier

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

A torus-invariant Weil divisor $D$ on a normal toric variety $X$ is Cartier if
it is locally principal, meaning that $X$ has an open cover $\{U_i\}$ such that
$D|_{U_i}$ is principal in $U_i$ for every $i$.

On a smooth variety, every Weil divisor is Cartier.

+-----------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;       |
+-----------------------------------------+
|i2 : assert all (3, i -> isCartier PP3_i)|
+-----------------------------------------+

On a simplicial toric variety, every torus-invariant Weil divisor is
$\QQ$-Cartier, which means that every torus-invariant Weil divisor has a
positive integer multiple that is Cartier.

+-----------------------------------------+
|i3 : W = weightedProjectiveSpace {2,5,7};|
+-----------------------------------------+
|i4 : assert isSimplicial W               |
+-----------------------------------------+
|i5 : assert not isCartier W_0            |
+-----------------------------------------+
|i6 : assert isQQCartier W_0              |
+-----------------------------------------+
|i7 : assert isCartier (35*W_0)           |
+-----------------------------------------+

In general, the Cartier divisors are only a subgroup of the Weil divisors.

+-----------------------------------------------------+
|i8 : X = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));|
+-----------------------------------------------------+
|i9 : assert not isCartier X_0                        |
+-----------------------------------------------------+
|i10 : assert not isQQCartier X_0                     |
+-----------------------------------------------------+
|i11 : K = toricDivisor X;                            |
|                                                     |
|o11 : ToricDivisor on X                              |
+-----------------------------------------------------+
|i12 : assert isCartier K                             |
+-----------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * cartierDivisorGroup(NormalToricVariety)
    -- compute the group of
    torus-invariant Cartier divisors
  * isSimplicial(NormalToricVariety)
    -- whether a normal toric variety is
    simplicial
  * isQQCartier(ToricDivisor) -- whether
    a torus-invariant Weil divisor is QQ-Cartier

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

  * isCartier(ToricDivisor) -- whether a
    torus-invariant Weil divisor is Cartier
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1649:0.

isComplete(NormalToricVariety) -- whether a toric variety is complete
*********************************************************************

  * Function: isComplete (Polyhedra),
  * Usage:
        isComplete X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the normal toric variety is complete

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

A normal toric variety is complete if any of the following equivalent
conditions hold:

  * the associated complex variety is compact in its classical topology,
  * the constant map from the normal toric variety to space consisting of a
    single point is proper,
  * every one-parameter subgroup of the torus has a limit in the toric variety,
  * the union of all the cones in the associated fan equals the entire vector
    space containing it,
  * every torus-invariant curve lying in the normal toric variety is
    projective.

For more information, see Theorem 3.4.1 in Cox-Little-Schenck's Toric
Varieties.

Affine varieties are not complete.

+----------------------------------------------------------------------------+
|i1 : AA1 = affineSpace 1                                                    |
|                                                                            |
|o1 = AA1                                                                    |
|                                                                            |
|o1 : NormalToricVariety                                                     |
+----------------------------------------------------------------------------+
|i2 : assert (not isComplete AA1 and isSmooth AA1 and # max AA1 === 1)       |
+----------------------------------------------------------------------------+
|i3 : AA3 = affineSpace 3                                                    |
|                                                                            |
|o3 = AA3                                                                    |
|                                                                            |
|o3 : NormalToricVariety                                                     |
+----------------------------------------------------------------------------+
|i4 : assert (not isComplete AA3 and isSmooth AA3 and # max AA3 === 1)       |
+----------------------------------------------------------------------------+
|i5 : U = normalToricVariety ({{4,-1,0},{0,1,0}},{{0,1}});                   |
+----------------------------------------------------------------------------+
|i6 : assert (not isComplete U and isDegenerate U and # max U === 1)         |
+----------------------------------------------------------------------------+
|i7 : Q = normalToricVariety ({{1,0,0},{0,1,0},{0,0,1},{1,1,-1}},{{0,1,2,3}})|
|                                                                            |
|o7 = Q                                                                      |
|                                                                            |
|o7 : NormalToricVariety                                                     |
+----------------------------------------------------------------------------+
|i8 : assert (not isComplete Q and not isSmooth Q and # max Q === 1)         |
+----------------------------------------------------------------------------+

See Projective varieties, are complete.

+-----------------------------------------------------------------------------+
|i9 : PP1 = toricProjectiveSpace 1;                                           |
+-----------------------------------------------------------------------------+
|i10 : assert (isComplete PP1 and isProjective PP1 and isSmooth PP1)          |
+-----------------------------------------------------------------------------+
|i11 : FF7 = hirzebruchSurface 7;                                             |
+-----------------------------------------------------------------------------+
|i12 : assert (isComplete FF7 and isProjective FF7 and isSmooth FF7 and not   |
|-----------------------------------------------------------------------------|
|isFano FF7)                                                                  |
+-----------------------------------------------------------------------------+
|i13 : X = smoothFanoToricVariety (4,120);                                    |
+-----------------------------------------------------------------------------+
|i14 : assert (isComplete X and isProjective X and isSmooth X and isFano X)   |
+-----------------------------------------------------------------------------+
|i15 : P12234 = weightedProjectiveSpace {1,2,2,3,4};                          |
+-----------------------------------------------------------------------------+
|i16 : assert (isComplete P12234 and isProjective P12234 and not isSmooth     |
|-----------------------------------------------------------------------------|
|P12234 and isSimplicial P12234)                                              |
+-----------------------------------------------------------------------------+
|i17 : Y = normalToricVariety ( id_(ZZ^3) | - id_(ZZ^3));                     |
+-----------------------------------------------------------------------------+
|i18 : assert (isComplete Y and isProjective Y and not isSmooth Y and not     |
|-----------------------------------------------------------------------------|
|isSimplicial Y)                                                              |
+-----------------------------------------------------------------------------+

There are also complete non-projective normal toric varieties.

+-----------------------------------------------------------------------------+
|i19 : X1 = normalToricVariety                                                |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{0,-1,-1},{-1,0,-1},{-2,-1,0}},{{0,1,2},{0,1,3},{1,|
|-----------------------------------------------------------------------------|
|3,4},{1,2,4},{2,4,5},{0,2,5},{0,3,5},{3,4,5}});                              |
+-----------------------------------------------------------------------------+
|i20 : assert (isComplete X1 and not isProjective X1 and not isSmooth X1 and  |
|-----------------------------------------------------------------------------|
|isWellDefined X1)                                                            |
+-----------------------------------------------------------------------------+
|i21 : X2 = normalToricVariety                                                |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{0,-1,2},{0,0,-1},{-1,1,-1},{-1,0,-1},{-1,-1,0}},{{|
|-----------------------------------------------------------------------------|
|0,1,2},{0,2,3},{0,3,4},{0,4,5},{0,1,5},{1,2,7},{2,3,7},{3,4,7},{4,5,6},{4,6,7|
|-----------------------------------------------------------------------------|
|},{5,6,7},{1,5,7}});                                                         |
+-----------------------------------------------------------------------------+
|i22 : assert (isComplete X2 and not isProjective X2 and isSmooth X2 and      |
|-----------------------------------------------------------------------------|
|isWellDefined X2)                                                            |
+-----------------------------------------------------------------------------+
|i23 : X3 = normalToricVariety                                                |
|-----------------------------------------------------------------------------|
|({{-1,2,0},{0,-1,0},{1,-1,0},{-1,0,-1},{0,0,-1},{0,1,0},{0,0,1},{1,0,-2}},{{0|
|-----------------------------------------------------------------------------|
|,1,3},{1,2,3},{2,3,4},{3,4,5},{0,3,5},{0,5,6},{0,1,6},{1,2,6},{2,4,7},{4,5,7 |
|-----------------------------------------------------------------------------|
|},{2,6,7},{5,6,7}});                                                         |
+-----------------------------------------------------------------------------+
|i24 : assert (isComplete X3 and not isProjective X3 and isSmooth X3 and      |
|-----------------------------------------------------------------------------|
|isWellDefined X3)                                                            |
+-----------------------------------------------------------------------------+

To avoid repeating a computation, the package caches the result in the
CacheTable (Macaulay2Doc), of the normal toric variety.

The nonprojective examples are taken from Osamu Fujino and Sam Payne's "Smooth
complete toric threefolds with no nontrivial nef line bundles", Japan Academy.
Proceedings, Series A, Mathematical Sciences, 81 (2005) 174-179,
arXiv:math/0510679 (see https://arxiv.org/abs/math/0510679 ).

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * isProjective(NormalToricVariety)
    -- whether a toric variety is
    projective

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

  * isComplete(NormalToricVariety),
    -- whether a toric variety is complete
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1797:0.

isDegenerate(NormalToricVariety) -- whether a toric variety is degenerate
*************************************************************************

  * Function: isDegenerate,
  * Usage:
        isDegenerate X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the fan of X is contained in a proper linear
        subspace of its ambient space

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

A $d$-dimensional normal toric variety is degenerate if its rays do not span
$\QQ^d$.  For example, projective spaces and Hirzebruch surfaces are not
degenerate.

+---------------------------------------------------+
|i1 : assert not isDegenerate toricProjectiveSpace 3|
+---------------------------------------------------+
|i2 : assert not isDegenerate hirzebruchSurface 7   |
+---------------------------------------------------+

Although one typically works with non-degenerate toric varieties, not all
normal toric varieties are non-degenerate.

+---------------------------------------------------------+
|i3 : U = normalToricVariety ({{4,-1,0},{0,1,0}},{{0,1}});|
+---------------------------------------------------------+
|i4 : isDegenerate U                                      |
|                                                         |
|o4 = true                                                |
+---------------------------------------------------------+

Caveat
======

Many routines in this package, such as the total coordinate ring,
require the normal toric variety to be
non-degenerate.

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * rays(NormalToricVariety) -- get the
    rays of the associated fan

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

  * isDegenerate(NormalToricVariety)
    -- whether a toric variety is
    degenerate
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1582:0.

isDominant(ToricMap) -- whether a toric map is dominant
*******************************************************

  * Function: isDominant,
  * Usage:
        isDominant f
  * Inputs:
      * f, a toric map,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the image is dense

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

A morphism of varieties is dominant if the image is dense. For a toric map, it
suffices to check that the dimension of the image is the dimension of the
target.

We demonstrate that the natural inclusion from the affine plane,
into the projective plane,
is a dominant, but not surjective

+---------------------------------------------------------------------+
|i1 : A = affineSpace 2;                                              |
+---------------------------------------------------------------------+
|i2 : P = toricProjectiveSpace 2;                                     |
+---------------------------------------------------------------------+
|i3 : f = map(P, A, 1)                                                |
|                                                                     |
|o3 = | 1 0 |                                                         |
|     | 0 1 |                                                         |
|                                                                     |
|o3 : ToricMap P <--- A                                               |
+---------------------------------------------------------------------+
|i4 : isDominant f                                                    |
|                                                                     |
|o4 = true                                                            |
+---------------------------------------------------------------------+
|i5 : isSurjective f                                                  |
|                                                                     |
|o5 = false                                                           |
+---------------------------------------------------------------------+
|i6 : assert (isWellDefined f and isDominant f and not isSurjective f)|
+---------------------------------------------------------------------+

A toric map from the projective line to the projective plane is not dominant.

+---------------------------------------------------------------------+
|i7 : X = toricProjectiveSpace 1;                                     |
+---------------------------------------------------------------------+
|i8 : g = map(P, X, matrix{{2}, {1}})                                 |
|                                                                     |
|o8 = | 2 |                                                           |
|     | 1 |                                                           |
|                                                                     |
|o8 : ToricMap P <--- X                                               |
+---------------------------------------------------------------------+
|i9 : isDominant g                                                    |
|                                                                     |
|o9 = false                                                           |
+---------------------------------------------------------------------+
|i10 : I = ideal g                                                    |
|                                                                     |
|                    2                                                |
|o10 = ideal(x x  - x )                                               |
|             0 1    2                                                |
|                                                                     |
|o10 : Ideal of QQ[x ..x ]                                            |
|                   0   2                                             |
+---------------------------------------------------------------------+
|i11 : assert (isWellDefined g and not isDominant g and codim I === 1)|
+---------------------------------------------------------------------+

To avoid repeating a computation, the package caches the result in the
CacheTable (Macaulay2Doc), of the toric map.

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * map(NormalToricVariety,NormalToricVariety,ZZ)
    -- make a
    torus-equivariant map between normal toric varieties
  * isComplete(NormalToricVariety),
    -- whether a toric variety is complete

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

  * isDominant(ToricMap) -- whether a toric
    map is dominant
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1080:0.

isEffective(ToricDivisor) -- whether a torus-invariant Weil divisor is effective
********************************************************************************

  * Function: isEffective,
  * Usage:
        isEffective D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if all the coefficients of the irreducible
        torus-invariant divisors are nonnegative

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

A torus-invariant Weil divisor is effective if all the coefficients of the
torus-invariant irreducible divisors are nonnegative.

The canonical divisor is not effective, but the anticanonical divisor is.

+----------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;|
+----------------------------------+
|i2 : K = toricDivisor PP3         |
|                                  |
|o2 = - PP3  - PP3  - PP3  - PP3   |
|          0      1      2      3  |
|                                  |
|o2 : ToricDivisor on PP3          |
+----------------------------------+
|i3 : isEffective K                |
|                                  |
|o3 = false                        |
+----------------------------------+
|i4 : isEffective (-K)             |
|                                  |
|o4 = true                         |
+----------------------------------+

The torus-invariant irreducible divisors generate the cone of effective
divisors.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * NormalToricVariety _ ZZ -- make an
    irreducible torus-invariant divisor

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

  * isEffective(ToricDivisor) -- whether
    a torus-invariant Weil divisor is effective
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1598:0.

isFano(NormalToricVariety) -- whether a normal toric variety is Fano
********************************************************************

  * Function: isFano,
  * Usage:
        isFano X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the normal toric variety is Fano

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

A normal toric variety is Fano if its anticanonical divisor, namely the sum of
all the torus-invariant irreducible divisors, is ample.  This is equivalent to
saying that the polyhedron associated to the anticanonical divisor is a
reflexive polytope.

Projective space is Fano.

+-----------------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;                         |
+-----------------------------------------------------------+
|i2 : assert isFano PP3                                     |
+-----------------------------------------------------------+
|i3 : K = toricDivisor PP3                                  |
|                                                           |
|o3 = - PP3  - PP3  - PP3  - PP3                            |
|          0      1      2      3                           |
|                                                           |
|o3 : ToricDivisor on PP3                                   |
+-----------------------------------------------------------+
|i4 : isAmple (-K)                                          |
|                                                           |
|o4 = true                                                  |
+-----------------------------------------------------------+
|i5 : assert all (5, d -> isFano toricProjectiveSpace (d+1))|
+-----------------------------------------------------------+

There are eighteen smooth Fano toric threefolds.

+-----------------------------------------------------------------------------+
|i6 : assert all (18, i -> (X := smoothFanoToricVariety (3,i); isSmooth X and |
|-----------------------------------------------------------------------------|
|isFano X))                                                                   |
+-----------------------------------------------------------------------------+

There are also many singular Fano toric varieties.

+------------------------------------------------------------+
|i7 : X = normalToricVariety matrix {{1,0,-1},{0,1,-1}};     |
+------------------------------------------------------------+
|i8 : assert (not isSmooth X and isFano X)                   |
+------------------------------------------------------------+
|i9 : Y = normalToricVariety matrix {{1,1,-1,-1},{0,1,1,-1}};|
+------------------------------------------------------------+
|i10 : assert (not isSmooth Y and isFano Y)                  |
+------------------------------------------------------------+
|i11 : Z = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));      |
+------------------------------------------------------------+
|i12 : assert (not isSmooth Z and isFano Z)                  |
+------------------------------------------------------------+

To avoid duplicate computations, the attribute is cached in the normal toric
variety.

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * toricDivisor(NormalToricVariety)
    -- make the canonical divisor
  * isAmple(ToricDivisor) -- whether a
    torus-invariant Weil divisor is ample
  * smoothFanoToricVariety(ZZ,ZZ),
    -- get a smooth Fano toric variety from database

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

  * isFano(NormalToricVariety), --
    whether a normal toric variety is Fano
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1947:0.

isFibration(ToricMap) -- whether a toric map is a fibration
***********************************************************

  * Function: isFibration,
  * Usage:
        isFibration f
  * Inputs:
      * f, a toric map,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the map is a fibration

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

A proper morphism $f : X \to Y$ is a fibration if $f_*(OO_X) = OO_Y$.  A proper
toric map is a fibration if and only if the underlying map of lattices is a
surjection. For more information, see Proposition 2.1 in
deCataldo-Migliorini-Mustata, "The combinatorics and topology of proper toric
maps" arXiv:1407.3497 (see https://arxiv.org/abs/1407.3497 ).

We illustrate this method on the projection from the first Hirzebruch surface,
to the projective line.

+-----------------------------------------------+
|i1 : X = hirzebruchSurface 1;                  |
+-----------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;               |
+-----------------------------------------------+
|i3 : f = map(Y, X, matrix{{1 ,0}})             |
|                                               |
|o3 = | 1 0 |                                   |
|                                               |
|o3 : ToricMap Y <--- X                         |
+-----------------------------------------------+
|i4 : isFibration f                             |
|                                               |
|o4 = true                                      |
+-----------------------------------------------+
|i5 : assert (isWellDefined f and isFibration f)|
+-----------------------------------------------+

Here is an example of a proper map that is not a fibration.

+------------------------------------------------------------------+
|i6 : Z = weightedProjectiveSpace {1, 1, 2};                       |
+------------------------------------------------------------------+
|i7 : g = map(Z, X, matrix{{1, 0}, {0, -2}})                       |
|                                                                  |
|o7 = | 1 0  |                                                     |
|     | 0 -2 |                                                     |
|                                                                  |
|o7 : ToricMap Z <--- X                                            |
+------------------------------------------------------------------+
|i8 : isFibration g                                                |
|                                                                  |
|o8 = false                                                        |
+------------------------------------------------------------------+
|i9 : assert (isWellDefined g and isProper g and not isFibration g)|
+------------------------------------------------------------------+

To avoid repeating a computation, the package caches the result in the
CacheTable (Macaulay2Doc), of the toric map.

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * isProper(ToricMap) -- whether a toric map is
    proper

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

  * isFibration(ToricMap) -- whether a toric
    map is a fibration
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1030:0.

isNef(ToricDivisor) -- whether a torus-invariant Weil divisor is nef
********************************************************************

  * Function: isNef,
  * Usage:
        isNef D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the divisor is nef

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

A $\QQ$-Cartier divisor is nef (short for numerically effective or numerically
eventually free) if the intersection product of the divisor with every complete
irreducible curve is nonnegative.  The definition depends only on the numerical
equivalence class of the divisor.  For a torus-invariant $\QQ$-Cartier divisor
on a complete normal toric variety, the following are equivalent:

  * the divisor is nef;
  * some positive integer multiply of the divisor is Cartier and basepoint
    free;
  * the real piecewise linear support function associated to the divisor is
    convex.

A torus-invariant Cartier divisor is nef if and only if it is basepoint free;
in other words, the associated line bundle is generated by its global sections.

On a Hirzebruch surface, three of the four torus-invariant irreducible divisors
are nef, and none are ample.

+---------------------------------------------+
|i1 : X1 = hirzebruchSurface 2;               |
+---------------------------------------------+
|i2 : assert (isNef X1_0 and not isAmple X1_0)|
+---------------------------------------------+
|i3 : assert not isNef X1_1                   |
+---------------------------------------------+
|i4 : assert (isNef X1_2 and not isAmple X1_2)|
+---------------------------------------------+
|i5 : assert (isNef X1_3 and not isAmple X1_3)|
+---------------------------------------------+

Not every $\QQ$-Cartier nef divisor is basepoint free.

+---------------------------------------------------------------+
|i6 : X2 = weightedProjectiveSpace {2,3,5};                     |
+---------------------------------------------------------------+
|i7 : D = X2_1 - X2_0                                           |
|                                                               |
|o7 = - X2  + X2                                                |
|         0     1                                               |
|                                                               |
|o7 : ToricDivisor on X2                                        |
+---------------------------------------------------------------+
|i8 : assert (isNef D and HH^0(X2, OO D) == 0)                  |
+---------------------------------------------------------------+
|i9 : assert all (dim X2, i -> HH^i(X2, OO D) == 0)             |
+---------------------------------------------------------------+
|i10 : assert not isCartier D                                   |
+---------------------------------------------------------------+
|i11 : assert isCartier (30*D)                                  |
+---------------------------------------------------------------+
|i12 : HH^0 (X2, OO (30*D))                                     |
|                                                               |
|        21                                                     |
|o12 = QQ                                                       |
|                                                               |
|o12 : QQ-module, free                                          |
+---------------------------------------------------------------+
|i13 : assert all (dim X2 -1, i -> HH^(i+1)(X2, OO (30*D)) == 0)|
+---------------------------------------------------------------+

There are smooth complete normal toric varieties with no nontrivial nef
divisors.

+-----------------------------------------------------------------------------+
|i14 : X3 = normalToricVariety({{1,0,0},{0,1,0},{0,0,1},{0,-1,2},{0,0,-1},{-1,|
|-----------------------------------------------------------------------------|
|1,-1},{-1,0,-1},{-1,-1,0}},{{0,1,2},{0,2,3},{0,3,4},{0,4,5},{0,1,5},{1,2,7},{|
|-----------------------------------------------------------------------------|
|2,3,7},{3,4,7},{4,5,6},{4,6,7},{5,6,7},{1,5,7}});                            |
+-----------------------------------------------------------------------------+
|i15 : assert (isComplete X3 and not isProjective X3)                         |
+-----------------------------------------------------------------------------+
|i16 : assert not any (#rays X3, i -> isNef X3_i)                             |
+-----------------------------------------------------------------------------+
|i17 : assert isNef (0*X3_1)                                                  |
+-----------------------------------------------------------------------------+
|i18 : assert (nefGenerators X3 == 0)                                         |
+-----------------------------------------------------------------------------+

The most basic vanishing theorem for normal toric varieties states that the
higher cohomology of coherent sheaf associated to a nef divisor is zero.

+--------------------------------------------------------------+
|i19 : X4 = kleinschmidt (9,{1,2,3});                          |
+--------------------------------------------------------------+
|i20 : assert (isNef X4_0 and not isAmple X4_0)                |
+--------------------------------------------------------------+
|i21 : assert all (dim X4 - 1, i -> HH^(i+1)(X4, OO X4_0) == 0)|
+--------------------------------------------------------------+
|i22 : D = X4_0 + X4_4                                         |
|                                                              |
|o22 = X4  + X4                                                |
|        0     4                                               |
|                                                              |
|o22 : ToricDivisor on X4                                      |
+--------------------------------------------------------------+
|i23 : assert (isNef D and isAmple D)                          |
+--------------------------------------------------------------+
|i24 : assert all (dim X4 - 1, i -> HH^(i+1)(X4, OO D) == 0)   |
+--------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * nefGenerators(NormalToricVariety)
    -- compute generators of the nef
    cone
  * isComplete(NormalToricVariety),
    -- whether a toric variety is complete
  * kleinschmidt(ZZ,List) -- make any
    smooth normal toric variety having Picard rank two
  * isQQCartier(ToricDivisor) -- whether
    a torus-invariant Weil divisor is QQ-Cartier
  * isAmple(ToricDivisor) -- whether a
    torus-invariant Weil divisor is ample

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

  * isNef(ToricDivisor) -- whether a
    torus-invariant Weil divisor is nef
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1776:0.

isProjective(NormalToricVariety) -- whether a toric variety is projective
*************************************************************************

  * Function: isProjective (Varieties),
  * Usage:
        isProjective X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if X is a projective variety

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

A variety is projective if it can be realized as a closed subvariety of some
projective space.  For an normal toric variety, this is equivalent to saying
that the associated fan is the normal fan of a polytope.

Nontrivial affine varieties are not projective.

+---------------------------------------------------------+
|i1 : assert not isProjective affineSpace 1               |
+---------------------------------------------------------+
|i2 : assert not isProjective affineSpace 3               |
+---------------------------------------------------------+
|i3 : U = normalToricVariety ({{4,-1,0},{0,1,0}},{{0,1}});|
+---------------------------------------------------------+
|i4 : assert (not isProjective U and isDegenerate U)      |
+---------------------------------------------------------+

Many of our favour toric varieties are projective.

+--------------------------------------------------------------------+
|i5 : assert isProjective toricProjectiveSpace 1                     |
+--------------------------------------------------------------------+
|i6 : assert isProjective toricProjectiveSpace 3                     |
+--------------------------------------------------------------------+
|i7 : assert isProjective hirzebruchSurface 7                        |
+--------------------------------------------------------------------+
|i8 : assert isProjective smoothFanoToricVariety (3,3)               |
+--------------------------------------------------------------------+
|i9 : assert isProjective normalToricVariety (id_(ZZ^3) | -id_(ZZ^3))|
+--------------------------------------------------------------------+

There are complete non-projective normal toric varieties.

+-----------------------------------------------------------------------------+
|i10 : X1 = normalToricVariety                                                |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{0,-1,-1},{-1,0,-1},{-2,-1,0}},{{0,1,2},{0,1,3},{1,|
|-----------------------------------------------------------------------------|
|3,4},{1,2,4},{2,4,5},{0,2,5},{0,3,5},{3,4,5}});                              |
+-----------------------------------------------------------------------------+
|i11 : assert (isComplete X1 and not isProjective X1 and not isSmooth X1)     |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i12 : X2 = normalToricVariety                                                |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{0,-1,2},{0,0,-1},{-1,1,-1},{-1,0,-1},{-1,-1,0}},{{|
|-----------------------------------------------------------------------------|
|0,1,2},{0,2,3},{0,3,4},{0,4,5},{0,1,5},{1,2,7},{2,3,7},{3,4,7},{4,5,6},{4,6,7|
|-----------------------------------------------------------------------------|
|},{5,6,7},{1,5,7}});                                                         |
+-----------------------------------------------------------------------------+
|i13 : assert (isComplete X2 and not isProjective X2 and isSmooth X2)         |
+-----------------------------------------------------------------------------+

To determine if a normal toric variety is projective, we use the Gale dual
vector configuration associated to the rays; see Theorem V.4.8 in Ewald's
Combinatorial convexity and algebraic geometry for more information.

To avoid repeating a computation, the package caches the result in the
CacheTable (Macaulay2Doc), of the normal toric variety.

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * isComplete(NormalToricVariety),
    -- whether a toric variety is complete
  * isAmple(ToricDivisor) -- whether a
    torus-invariant Weil divisor is ample

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

  * isProjective(NormalToricVariety)
    -- whether a toric variety is
    projective
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1853:0.

isProper(ToricMap) -- whether a toric map is proper
***************************************************

  * Function: isProper,
  * Usage:
        isProper f
  * Inputs:
      * f, a toric map,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the map is proper

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

A morphism of varieties is proper if it is universally closed. For a toric map
$f : X \to Y$ corresponding to the map $g : N_X \to N_Y$ of lattices, this is
equivalent to the preimage of the support of the target fan under $g$ being
equal to the support of the source fan. For more information about this
equivalence, see Theorem 3.4.11 in Cox-Little-Schenck's Toric Varieties.

We illustrate this method on the projection from the second Hirzebruch surface,
to the projective line.

+---------------------------------------------------+
|i1 : X = hirzebruchSurface 2;                      |
+---------------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;                   |
+---------------------------------------------------+
|i3 : f = map(Y, X, matrix {{1,0}})                 |
|                                                   |
|o3 = | 1 0 |                                       |
|                                                   |
|o3 : ToricMap Y <--- X                             |
+---------------------------------------------------+
|i4 : isProper f                                    |
|                                                   |
|o4 = true                                          |
+---------------------------------------------------+
|i5 : assert (isWellDefined f and source f === X and|
|         target f === Y and isProper f)            |
+---------------------------------------------------+

The second example shows that the projection,
from the blow-up, of
the origin in the affine plane to affine plane, is
proper.

+------------------------------------------------------------------+
|i6 : A = affineSpace 2;                                           |
+------------------------------------------------------------------+
|i7 : B = toricBlowup({0,1}, A);                                   |
+------------------------------------------------------------------+
|i8 : g = B^[]                                                     |
|                                                                  |
|o8 = | 1 0 |                                                      |
|     | 0 1 |                                                      |
|                                                                  |
|o8 : ToricMap A <--- B                                            |
+------------------------------------------------------------------+
|i9 : isProper g                                                   |
|                                                                  |
|o9 = true                                                         |
+------------------------------------------------------------------+
|i10 : assert(isWellDefined g and g == map(A, B, 1) and isProper g)|
+------------------------------------------------------------------+

The natural inclusion of the affine plane, into the
projective plane, is not proper.

+------------------------------------------------------------------+
|i11 : A = affineSpace 2;                                          |
+------------------------------------------------------------------+
|i12 : P = toricProjectiveSpace 2;                                 |
+------------------------------------------------------------------+
|i13 : f = map(P, A, 1)                                            |
|                                                                  |
|o13 = | 1 0 |                                                     |
|      | 0 1 |                                                     |
|                                                                  |
|o13 : ToricMap P <--- A                                           |
+------------------------------------------------------------------+
|i14 : isProper f                                                  |
|                                                                  |
|o14 = false                                                       |
+------------------------------------------------------------------+
|i15 : isDominant f                                                |
|                                                                  |
|o15 = true                                                        |
+------------------------------------------------------------------+
|i16 : assert (isWellDefined f and not isProper f and isDominant f)|
+------------------------------------------------------------------+

To avoid repeating a computation, the package caches the result in the
CacheTable (Macaulay2Doc), of the toric map.

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * map(NormalToricVariety,NormalToricVariety,ZZ)
    -- make a
    torus-equivariant map between normal toric varieties
  * isComplete(NormalToricVariety),
    -- whether a toric variety is complete

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

  * isProper(ToricMap) -- whether a toric map is
    proper
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:983:0.

isQQCartier(ToricDivisor) -- whether a torus-invariant Weil divisor is QQ-Cartier
*********************************************************************************

  * Function: isQQCartier,
  * Usage:
        isCartier D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the divisor is $\QQ$-Cartier

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

A Weil divisor is $\QQ$-Cartier if some positive integer multiple is Cartier.

On a simplicial toric variety, every torus-invariant Weil divisor is
$\QQ$-Cartier.

+-----------------------------------------+
|i1 : W = weightedProjectiveSpace {2,5,7};|
+-----------------------------------------+
|i2 : assert isSimplicial W               |
+-----------------------------------------+
|i3 : assert not isCartier W_0            |
+-----------------------------------------+
|i4 : assert isQQCartier W_0              |
+-----------------------------------------+
|i5 : assert isCartier (35*W_0)           |
+-----------------------------------------+

In general, the $\QQ$-Cartier divisors form a proper subgroup of the Weil
divisors.

+-----------------------------------------------------+
|i6 : X = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));|
+-----------------------------------------------------+
|i7 : assert not isCartier X_0                        |
+-----------------------------------------------------+
|i8 : assert not isQQCartier X_0                      |
+-----------------------------------------------------+
|i9 : K = toricDivisor X;                             |
|                                                     |
|o9 : ToricDivisor on X                               |
+-----------------------------------------------------+
|i10 : assert isCartier K                             |
+-----------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * cartierDivisorGroup(NormalToricVariety)
    -- compute the group of
    torus-invariant Cartier divisors
  * isSimplicial(NormalToricVariety)
    -- whether a normal toric variety is
    simplicial
  * isCartier(ToricDivisor) -- whether a
    torus-invariant Weil divisor is Cartier

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

  * isQQCartier(ToricDivisor) -- whether
    a torus-invariant Weil divisor is QQ-Cartier
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1692:0.

isSimplicial(NormalToricVariety) -- whether a normal toric variety is simplicial
********************************************************************************

  * Function: isSimplicial (Polyhedra),
  * Usage:
        isSimplicial X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the minimal nonzero lattice points on the rays
        in each maximal cone in the associated fan of form part of a
        $\QQ$-basis

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

A normal toric variety is simplicial if every cone in its fan is simplicial and
a cone is simplicial if its minimal generators are linearly independent over
$\QQ$.  In fact, the following conditions on a normal toric variety $X$ are
equivalent:

  * X is simplicial,
  * every torus-invariant Weil divisor on X has a positive integer multiple
    that is Cartier,
  * the Picard group of X has finite index in the class group of X,
  * X has only finite quotient singularities.

For more information, see Proposition 4.2.7 in Cox-Little-Schenck's Toric
Varieties.

See Projective spaces, weighted projective spaces,
and Hirzebruch surfaces,
are simplicial.

+-------------------------------------------------------------------------+
|i1 : PP1 = toricProjectiveSpace 1;                                       |
+-------------------------------------------------------------------------+
|i2 : assert (isSimplicial PP1 and isProjective PP1)                      |
+-------------------------------------------------------------------------+
|i3 : FF7 = hirzebruchSurface 7;                                          |
+-------------------------------------------------------------------------+
|i4 : assert (isSimplicial FF7 and isProjective FF7)                      |
+-------------------------------------------------------------------------+
|i5 : AA3 = affineSpace 3;                                                |
+-------------------------------------------------------------------------+
|i6 : assert (isSimplicial AA3 and not isComplete AA3 and # max AA3 === 1)|
+-------------------------------------------------------------------------+
|i7 : P12234 = weightedProjectiveSpace {1,2,2,3,4};                       |
+-------------------------------------------------------------------------+
|i8 : assert (isSimplicial P12234 and isProjective P12234)                |
+-------------------------------------------------------------------------+
|i9 : U = normalToricVariety ({{4,-1},{0,1}},{{0,1}});                    |
+-------------------------------------------------------------------------+
|i10 : assert (isSimplicial U and not isSmooth U)                         |
+-------------------------------------------------------------------------+

However, not all normal toric varieties are simplicial.

+-----------------------------------------------------------------------------+
|i11 : Q = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{1,1,-1}},{{0,1,2,3}});                            |
+-----------------------------------------------------------------------------+
|i12 : assert (not isSmooth Q and not isSimplicial Q and not isComplete Q)    |
+-----------------------------------------------------------------------------+
|i13 : Y = normalToricVariety ( id_(ZZ^3) | - id_(ZZ^3));                     |
+-----------------------------------------------------------------------------+
|i14 : assert (not isSimplicial Y and isProjective Y)                         |
+-----------------------------------------------------------------------------+

To avoid repeating a computation, the package caches the result in the
CacheTable (Macaulay2Doc), of the normal toric variety.

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan
  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth
  * makeSimplicial(NormalToricVariety)
    -- make a birational simplicial
    toric variety

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

  * isSimplicial(NormalToricVariety)
    -- whether a normal toric variety is
    simplicial
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1648:0.

isSmooth(NormalToricVariety) -- whether a normal toric variety is smooth
************************************************************************

  * Function: isSmooth (Macaulay2Doc),
  * Usage:
        isSmooth X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the minimal nonzero lattice points on the rays
        in each maximal cone in the associated fan of form part of a
        $\ZZ$-basis

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

A normal toric variety is smooth if every cone in its fan is smooth and a cone
is smooth if its minimal generators are linearly independent over $\ZZ$.  In
fact, the following conditions on a normal toric variety $X$ are equivalent:

  * X is smooth,
  * every torus-invariant Weil divisor on X is Cartier,
  * the Picard group of X equals the class group of X,
  * X has no singularities.

For more information, see Proposition 4.2.6 in Cox-Little-Schenck's Toric
Varieties.

Many of our favourite normal toric varieties are smooth.

+---------------------------------------------------------------------+
|i1 : PP1 = toricProjectiveSpace 1;                                   |
+---------------------------------------------------------------------+
|i2 : assert (isSmooth PP1 and isProjective PP1)                      |
+---------------------------------------------------------------------+
|i3 : FF7 = hirzebruchSurface 7;                                      |
+---------------------------------------------------------------------+
|i4 : assert (isSmooth FF7 and isProjective FF7)                      |
+---------------------------------------------------------------------+
|i5 : AA3 = affineSpace 3;                                            |
+---------------------------------------------------------------------+
|i6 : assert (isSmooth AA3 and not isComplete AA3 and # max AA3 === 1)|
+---------------------------------------------------------------------+
|i7 : X = smoothFanoToricVariety (4,120);                             |
+---------------------------------------------------------------------+
|i8 : assert (isSmooth X and isProjective X and isFano X)             |
+---------------------------------------------------------------------+
|i9 : U = normalToricVariety ({{4,-1},{0,1}},{{0},{1}});              |
+---------------------------------------------------------------------+
|i10 : assert (isSmooth U and not isComplete U)                       |
+---------------------------------------------------------------------+

However, not all normal toric varieties are smooth.

+-----------------------------------------------------------------------------+
|i11 : P12234 = weightedProjectiveSpace {1,2,2,3,4};                          |
+-----------------------------------------------------------------------------+
|i12 : assert (not isSmooth P12234 and isSimplicial P12234 and isProjective   |
|-----------------------------------------------------------------------------|
|P12234)                                                                      |
+-----------------------------------------------------------------------------+
|i13 : C = normalToricVariety ({{4,-1},{0,1}},{{0,1}});                       |
+-----------------------------------------------------------------------------+
|i14 : assert (not isSmooth C and isSimplicial C and # max C === 1)           |
+-----------------------------------------------------------------------------+
|i15 : Q = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{1,1,-1}},{{0,1,2,3}});                            |
+-----------------------------------------------------------------------------+
|i16 : assert (not isSmooth Q and not isSimplicial Q and not isComplete Q)    |
+-----------------------------------------------------------------------------+
|i17 : Y = normalToricVariety ( id_(ZZ^3) | - id_(ZZ^3));                     |
+-----------------------------------------------------------------------------+
|i18 : assert (not isSmooth Y and not isSimplicial Y and isProjective Y)      |
+-----------------------------------------------------------------------------+

To avoid repeating a computation, the package caches the result in the
CacheTable (Macaulay2Doc), of the normal toric variety.

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan
  * isSimplicial(NormalToricVariety)
    -- whether a normal toric variety is
    simplicial

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

  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1715:0.

isSurjective(ToricMap) -- whether a toric map is surjective
***********************************************************

  * Function: isSurjective (Macaulay2Doc),
  * Usage:
        isSurjective f
  * Inputs:
      * f, a toric map,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the map is surjective

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

A morphism $f : X \to Y$ is surjective if $f(X) = Y$ as sets.  To be surjective
toric map, the dimension of $X$ must be greater than or equal to $Y$ and the
image of the algebraic torus in $X$ must be equal to the algebraic torus in
$Y$.  Since $f$ is torus-equivariant, it follows that $f$ is surjective if and
only if its image contains a point in each torus orbit in $Y$.  This method
checks whether all of the cones in the target fan contain a point from the
relative interior of a cone in the source fan.

The canonical projections, from a product to
the factors are surjective.

+----------------------------------------------------+
|i1 : X = toricProjectiveSpace 2;                    |
+----------------------------------------------------+
|i2 : Y = hirzebruchSurface 2;                       |
+----------------------------------------------------+
|i3 : XY = X ** Y;                                   |
+----------------------------------------------------+
|i4 : pi0 = XY^[0]                                   |
|                                                    |
|o4 = | 1 0 0 0 |                                    |
|     | 0 1 0 0 |                                    |
|                                                    |
|o4 : ToricMap X <--- XY                             |
+----------------------------------------------------+
|i5 : isSurjective pi0                               |
|                                                    |
|o5 = true                                           |
+----------------------------------------------------+
|i6 : assert (isWellDefined pi0 and isSurjective pi0)|
+----------------------------------------------------+
|i7 : pi1 = XY^[1]                                   |
|                                                    |
|o7 = | 0 0 1 0 |                                    |
|     | 0 0 0 1 |                                    |
|                                                    |
|o7 : ToricMap Y <--- XY                             |
+----------------------------------------------------+
|i8 : isSurjective pi1                               |
|                                                    |
|o8 = true                                           |
+----------------------------------------------------+
|i9 : assert (isWellDefined pi1 and isSurjective pi1)|
+----------------------------------------------------+

We demonstrate that the natural inclusion from the affine plane,
into the projective plane,
is a dominant, but not surjective

+----------------------------------------------------------------------+
|i10 : A = affineSpace 2;                                              |
+----------------------------------------------------------------------+
|i11 : f = map(X, A, 1)                                                |
|                                                                      |
|o11 = | 1 0 |                                                         |
|      | 0 1 |                                                         |
|                                                                      |
|o11 : ToricMap X <--- A                                               |
+----------------------------------------------------------------------+
|i12 : isDominant f                                                    |
|                                                                      |
|o12 = true                                                            |
+----------------------------------------------------------------------+
|i13 : isSurjective f                                                  |
|                                                                      |
|o13 = false                                                           |
+----------------------------------------------------------------------+
|i14 : assert (isWellDefined f and isDominant f and not isSurjective f)|
+----------------------------------------------------------------------+

For a toric map to be surjective, the underlying map of fans need not be
surjective.

+----------------------------------------------------------------------+
|i15 : Y = (toricProjectiveSpace 1) ** (toricProjectiveSpace 1);       |
+----------------------------------------------------------------------+
|i16 : X = normalToricVariety(                                         |
|          {{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}},    |
|          {{0},{1},{2},{3},{4},{5},{6},{7}});                         |
+----------------------------------------------------------------------+
|i17 : g = map(Y,X,1)                                                  |
|                                                                      |
|o17 = | 1 0 |                                                         |
|      | 0 1 |                                                         |
|                                                                      |
|o17 : ToricMap Y <--- X                                               |
+----------------------------------------------------------------------+
|i18 : isSurjective g                                                  |
|                                                                      |
|o18 = true                                                            |
+----------------------------------------------------------------------+
|i19 : isComplete X                                                    |
|                                                                      |
|o19 = false                                                           |
+----------------------------------------------------------------------+
|i20 : assert (isWellDefined g and isSurjective g and not isComplete X)|
+----------------------------------------------------------------------+

To avoid repeating a computation, the package caches the result in the
CacheTable (Macaulay2Doc), of the toric map.

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * isDominant(ToricMap) -- whether a toric
    map is dominant

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

  * isSurjective(ToricMap) -- whether a
    toric map is surjective
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1148:0.

isVeryAmple(ToricDivisor) -- whether a torus-invariant Weil divisor is very ample
*********************************************************************************

  * Function: isVeryAmple (Macaulay2Doc),
  * Usage:
        isVeryAmple D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the divisor is very ample

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

A Cartier divisor is very ample when it is basepoint free and the map arising
from its complete linear series is a closed embedding. On a normal toric
variety, the following are equivalent:

  * the divisor is a very ample divisor;
  * for every vertex of the associated lattice polytope associated to the
    divisor, the corresponding semigroup is saturated in the group characters.

On a smooth normal toric variety every ample divisor is very ample.

+---------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;     |
+---------------------------------------+
|i2 : assert isAmple PP3_0              |
+---------------------------------------+
|i3 : assert isVeryAmple PP3_0          |
+---------------------------------------+
|i4 : FF2 = hirzebruchSurface 2;        |
+---------------------------------------+
|i5 : assert isAmple (FF2_2 + FF2_3)    |
+---------------------------------------+
|i6 : assert isVeryAmple (FF2_2 + FF2_3)|
+---------------------------------------+

A Cartier divisor is ample when some positive integer multiple is very ample.
On a normal toric variety of dimension $d$, the $(d-1)$ multiple of any ample
divisor is always very ample.

+-----------------------------------------------------------------------------+
|i7 : X = normalToricVariety matrix                                           |
|-----------------------------------------------------------------------------|
|{{0,1,0,0,1},{0,0,1,0,1},{0,0,0,1,1},{0,0,0,0,3}};                           |
+-----------------------------------------------------------------------------+
|i8 : assert (dim X === 4)                                                    |
+-----------------------------------------------------------------------------+
|i9 : D = 3*X_0                                                               |
|                                                                             |
|o9 = 3*X                                                                     |
|        0                                                                    |
|                                                                             |
|o9 : ToricDivisor on X                                                       |
+-----------------------------------------------------------------------------+
|i10 : assert isAmple D                                                       |
+-----------------------------------------------------------------------------+
|i11 : assert not isVeryAmple D                                               |
+-----------------------------------------------------------------------------+
|i12 : assert not isVeryAmple (2*D)                                           |
+-----------------------------------------------------------------------------+
|i13 : assert isVeryAmple (3*D)                                               |
+-----------------------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * isProjective(NormalToricVariety)
    -- whether a toric variety is
    projective
  * isAmple(ToricDivisor) -- whether a
    torus-invariant Weil divisor is ample

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

  * isVeryAmple(ToricDivisor) -- whether
    a torus-invariant Weil divisor is very ample
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1894:0.

isWellDefined(NormalToricVariety) -- whether a toric variety is well-defined
****************************************************************************

  * Function: isWellDefined (Macaulay2Doc),
  * Usage:
        isWellDefined X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the lists of rays and maximal cones associated
        to X determine a strongly convex rational polyhedral fan

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

A pair (rayList, coneList) of lists correspond to a well-defined normal toric
variety if the following conditions hold:

  * the union of the elements of coneList equals the set of indices of elements
    of rayList,
  * no element of coneList is properly contained in another element of
    coneList,
  * the rays indexed by an element of coneList generate a strongly convex cone,
  * the rays indexed by an element of coneList are the unique minimal lattice
    points for the cone they generate,
  * the intersection of the cones associated to two elements of coneList is a
    face of each cone.

The first examples illustrate that small projective spaces are well-defined.

+------------------------------------------------------------------+
|i1 : assert all (5, d -> isWellDefined toricProjectiveSpace (d+1))|
+------------------------------------------------------------------+

The second examples show that a randomly selected Kleinschmidt toric variety
and a weighted projective space are also well-defined.

+--------------------------------------------+
|i2 : setRandomSeed (currentTime ());        |
| -- setting random seed to 1781094328       |
+--------------------------------------------+
|i3 : a = sort apply (3, i -> random (7))    |
|                                            |
|o3 = {2, 3, 6}                              |
|                                            |
|o3 : List                                   |
+--------------------------------------------+
|i4 : assert isWellDefined kleinschmidt (4,a)|
+--------------------------------------------+
+-----------------------------------------------------------------------------+
|i5 : q = sort apply (5, j -> random (1,9));                                  |
+-----------------------------------------------------------------------------+
|i6 : while not all (subsets (q,#q-1), s -> gcd s === 1) do q = sort apply (5,|
|-----------------------------------------------------------------------------|
|j -> random (1,9));                                                          |
+-----------------------------------------------------------------------------+
|i7 : q                                                                       |
|                                                                             |
|o7 = {1, 4, 5, 6, 8}                                                         |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : assert isWellDefined weightedProjectiveSpace q                          |
+-----------------------------------------------------------------------------+

The next ten examples illustrate various ways that two lists can fail to define
a normal toric variety.  By making the current debugging level greater than
one, one gets some addition information about the nature of the failure.

+-------------------------------------------------------------------------+
|i9 : X = new MutableHashTable;                                           |
+-------------------------------------------------------------------------+
|i10 : coneList = max toricProjectiveSpace 2;                             |
+-------------------------------------------------------------------------+
|i11 : X#1 = normalToricVariety ({{-1,-1},{1,0},{0,1},{-1,0}}, coneList); |
+-------------------------------------------------------------------------+
|i12 : isWellDefined X#1                                                  |
|                                                                         |
|o12 = false                                                              |
+-------------------------------------------------------------------------+
|i13 : debugLevel = 1;                                                    |
+-------------------------------------------------------------------------+
|i14 : isWellDefined X#1                                                  |
|-- some ray does not appear in maximal cone                              |
|                                                                         |
|o14 = false                                                              |
+-------------------------------------------------------------------------+
|i15 : X#2 = normalToricVariety ({},{});                                  |
+-------------------------------------------------------------------------+
|i16 : isWellDefined X#2                                                  |
|-- expected `rays' to be a list of lists                                 |
|                                                                         |
|o16 = false                                                              |
+-------------------------------------------------------------------------+
|i17 : X#3 = normalToricVariety ({{}},{});                                |
+-------------------------------------------------------------------------+
|i18 : isWellDefined X#3                                                  |
|-- expected `max' to be a list of lists                                  |
|                                                                         |
|o18 = false                                                              |
+-------------------------------------------------------------------------+
|i19 : X#4 = normalToricVariety ({{}},{{}});                              |
+-------------------------------------------------------------------------+
|i20 : isWellDefined X#4                                                  |
|-- some ray does not appear in maximal cone                              |
|                                                                         |
|o20 = false                                                              |
+-------------------------------------------------------------------------+
|i21 : coneList' = {{0,1},{0,3},{1,2},{2,3},{3}};                         |
+-------------------------------------------------------------------------+
|i22 : X#5 = normalToricVariety ({{-1,0},{0,-1},{1,-1},{0,1}}, coneList');|
+-------------------------------------------------------------------------+
|i23 : isWellDefined X#5                                                  |
|-- some cone is not maximal                                              |
|                                                                         |
|o23 = false                                                              |
+-------------------------------------------------------------------------+
|i24 : X#6 = normalToricVariety ({{-1,-1},{1,0},{0,1,1}},coneList);       |
+-------------------------------------------------------------------------+
|i25 : isWellDefined X#6                                                  |
|-- expected `rays' to be a list of equal length lists                    |
|                                                                         |
|o25 = false                                                              |
+-------------------------------------------------------------------------+
|i26 : X#7 = normalToricVariety ({{-1,-1/1},{1,0},{0,1}},coneList);       |
+-------------------------------------------------------------------------+
|i27 : isWellDefined X#7                                                  |
|-- expected `rays' to be a list of lists of integers                     |
|                                                                         |
|o27 = false                                                              |
+-------------------------------------------------------------------------+
|i28 : X#8 = normalToricVariety ({{1,0},{0,1},{-1,0}},{{0,1,2}});         |
+-------------------------------------------------------------------------+
|i29 : isWellDefined X#8                                                  |
|-- not all maximal cones are strongly convex                             |
|                                                                         |
|o29 = false                                                              |
+-------------------------------------------------------------------------+
|i30 : X#9 = normalToricVariety ({{1,0,0},{0,1,0},{0,0,2}},{{0,1,2}});    |
+-------------------------------------------------------------------------+
|i31 : isWellDefined X#9                                                  |
|-- the rays are not the primitive generators                             |
|                                                                         |
|o31 = false                                                              |
+-------------------------------------------------------------------------+
|i32 : X#10 = normalToricVariety ({{1,0},{0,1},{1,1}},{{0,1},{1,2}});     |
+-------------------------------------------------------------------------+
|i33 : isWellDefined X#10                                                 |
|-- intersection of cones is not a cone                                   |
|                                                                         |
|o33 = false                                                              |
+-------------------------------------------------------------------------+
|i34 : debugLevel = 0;                                                    |
+-------------------------------------------------------------------------+
|i35 : assert all (keys X, k -> not isWellDefined X#k)                    |
+-------------------------------------------------------------------------+

This method also checks that the following aspects of the data structure:

  * the underlying HashTable (Macaulay2Doc), has the expected
    keys, namely rays, max, and cache,
  * the value of the rays key is a List (Macaulay2Doc),
  * each entry in the rays list is a List (Macaulay2Doc),
  * each entry in an entry of the rays list is an ZZ (Macaulay2Doc),
  * each entry in the rays list as the same number of entries,
  * the value of the max key is a List (Macaulay2Doc),
  * each entry in the max list is a List (Macaulay2Doc),
  * each entry in an entry of the max list is an ZZ (Macaulay2Doc),
  * each entry in an entry of the max list corresponds to a ray,
  * the value of the cache key is a CacheTable (Macaulay2Doc).

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * normalToricVariety(List,List),
    -- make a normal toric variety
  * debugLevel (Macaulay2Doc) -- current debugging level

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

  * isWellDefined(NormalToricVariety)
    -- whether a toric variety is
    well-defined
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:532:0.

isWellDefined(ToricDivisor) -- whether a toric divisor is well-defined
**********************************************************************

  * Function: isWellDefined (Macaulay2Doc),
  * Usage:
        isWellDefined D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if underlying data structure is correctly formatted

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

This function checks that the following aspects of the data structure:

  * the underlying HashTable (Macaulay2Doc), has the expected
    keys, namely the integers from 0 to n-1 where n = # rays variety D,
    variety, and cache,
  * the value of each integer key is an ZZ (Macaulay2Doc),
  * the value of the variety key is a NormalToricVariety,
  * the value of the cache key is a CacheTable (Macaulay2Doc).
+--------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2     |
|                                      |
|o1 = PP2                              |
|                                      |
|o1 : NormalToricVariety               |
+--------------------------------------+
|i2 : D1 = toricDivisor ({2,-7,3}, PP2)|
|                                      |
|o2 = 2*PP2  - 7*PP2  + 3*PP2          |
|          0        1        2         |
|                                      |
|o2 : ToricDivisor on PP2              |
+--------------------------------------+
|i3 : assert isWellDefined D1          |
+--------------------------------------+
+-----------------------------------------------------------------------------+
|i4 : debugLevel = 1;                                                         |
+-----------------------------------------------------------------------------+
|i5 : D2 = new ToricDivisor from hashTable { 0 => 2, symbol variety => PP2,   |
|                                                                             |
|o5 : ToricDivisor on PP2                                                     |
|-----------------------------------------------------------------------------|
|symbol cache => new CacheTable};                                             |
+-----------------------------------------------------------------------------+
|i6 : assert not isWellDefined D2                                             |
|-- missing key(s): {1, 2}                                                    |
+-----------------------------------------------------------------------------+
|i7 : D3 = new ToricDivisor from hashTable { 0 => 2, 1 => x, 2 => 3, symbol   |
|                                                                             |
|o7 : ToricDivisor on PP2                                                     |
|-----------------------------------------------------------------------------|
|variety => PP2, symbol cache => new CacheTable};                             |
+-----------------------------------------------------------------------------+
|i8 : assert not isWellDefined D3                                             |
|expected 1-th coefficient to be an integer                                   |
+-----------------------------------------------------------------------------+
|i9 : D4 = new ToricDivisor from hashTable { 0 => 2, 1 => -7, 2 => 3, symbol  |
|                                                                             |
|o9 : ToricDivisor on 7                                                       |
|-----------------------------------------------------------------------------|
|variety => 7, symbol cache => new CacheTable};                               |
+-----------------------------------------------------------------------------+
|i10 : assert not isWellDefined D4                                            |
|expected a divisor over a normal toric variety                               |
+-----------------------------------------------------------------------------+

The function expression(ToricDivisor),
assumes that the input toric divisor is well-defined.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * toricDivisor(List,NormalToricVariety)
    -- make a torus-invariant Weil
    divisor
  * debugLevel (Macaulay2Doc) -- current debugging level

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

  * isWellDefined(ToricDivisor), --
    whether a toric divisor is well-defined
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1217:0.

isWellDefined(ToricMap) -- whether a toric map is well defined
**************************************************************

  * Function: isWellDefined (Macaulay2Doc),
  * Usage:
        isWellDefined f
  * Inputs:
      * f, a toric map,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true if the
        underlying linear map determines a toric map

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

Let $X$ and $Y$ be normal toric varieties whose underlying lattices are $N_X$
and $N_Y$ respectively.  Every toric map $f : X \to Y$ corresponds to a unique
map $g : N_X \to N_Y$ of lattices such that, for any cone $\sigma$ in the fan
of $X$, there is a cone in the fan of $Y$ that contains the image $g(\sigma)$.
For more information on this correspondence, see Theorem 3.3.4 in
Cox-Little-Schenck's Toric Varieties.  This method determines whether the
underlying map of lattices defines a toric map.

We illustrate this test with the projection from the second Hirzebruch surface,
to the projective line.

+---------------------------------------------------------+
|i1 : X = hirzebruchSurface 2;                            |
+---------------------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;                         |
+---------------------------------------------------------+
|i3 : f = map (Y, X, matrix {{1, 0}})                     |
|                                                         |
|o3 = | 1 0 |                                             |
|                                                         |
|o3 : ToricMap Y <--- X                                   |
+---------------------------------------------------------+
|i4 : source f                                            |
|                                                         |
|o4 = X                                                   |
|                                                         |
|o4 : NormalToricVariety                                  |
+---------------------------------------------------------+
|i5 : target f                                            |
|                                                         |
|o5 = Y                                                   |
|                                                         |
|o5 : NormalToricVariety                                  |
+---------------------------------------------------------+
|i6 : matrix f                                            |
|                                                         |
|o6 = | 1 0 |                                             |
|                                                         |
|              1       2                                  |
|o6 : Matrix ZZ  <-- ZZ                                   |
+---------------------------------------------------------+
|i7 : assert (isWellDefined f and source f === X and      |
|         target f === Y and matrix f === matrix {{1, 0}})|
+---------------------------------------------------------+

The second example illustrates two attempts to define a toric map from the
projective plane to a weighted projective space.
The first, corresponding to the identity on
the lattices, is not well-defined.  The second, corresponding to a stretch in
the lattices, is well-defined.  By making the current debugging level greater
than one, one gets some addition information about the nature of the failure.

+---------------------------------------------------------------------------+
|i8 : debugLevel = 1;                                                       |
+---------------------------------------------------------------------------+
|i9 : Z = toricProjectiveSpace 2;                                           |
+---------------------------------------------------------------------------+
|i10 : W = weightedProjectiveSpace {1, 1, 2};                               |
+---------------------------------------------------------------------------+
|i11 : g = map (W, Z, 1)                                                    |
|                                                                           |
|o11 = | 1 0 |                                                              |
|      | 0 1 |                                                              |
|                                                                           |
|o11 : ToricMap W <--- Z                                                    |
+---------------------------------------------------------------------------+
|i12 : assert not isWellDefined g                                           |
|-- expected image of each maximal cone to be contained in some maximal cone|
+---------------------------------------------------------------------------+
|i13 : h = map (W, Z, matrix {{1, 0}, {0, 2}})                              |
|                                                                           |
|o13 = | 1 0 |                                                              |
|      | 0 2 |                                                              |
|                                                                           |
|o13 : ToricMap W <--- Z                                                    |
+---------------------------------------------------------------------------+
|i14 : assert isWellDefined h                                               |
+---------------------------------------------------------------------------+

This method also checks the following aspects of the data structure:

  * the underlying HashTable (Macaulay2Doc), has the expected
    keys, namely source, target, matrix, and cache,
  * the value of the source key is a NormalToricVariety,
  * the value of the target key is a NormalToricVariety,
  * the value of the matrix key is a Matrix (Macaulay2Doc),
  * the underling ring of the matrix is ZZ (Macaulay2Doc),
  * the rank of the source of the matrix equal dimension of the source variety,
  * the rank of the target of the matrix equal dimension of the target variety,
  * the value of the cache key is a CacheTable (Macaulay2Doc).

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * hirzebruchSurface(ZZ) -- make any
    Hirzebruch surface
  * toricProjectiveSpace(ZZ) -- make a
    projective space as a normal toric variety
  * weightedProjectiveSpace(List), --
    make a weighted projective space

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

  * isWellDefined(ToricMap) -- whether a
    toric map is well defined
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:563:0.

kleinschmidt(ZZ,List) -- make any smooth normal toric variety having Picard rank two
************************************************************************************

  * Function: kleinschmidt,
  * Usage:
        kleinschmidt (d, a)
  * Inputs:
      * d, an integer (Macaulay2Doc), that specifies the dimension of
        toric variety
      * a, a list (Macaulay2Doc), that is nondecreasing and
        consists of at most $d-1$ nonnegative integers
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        that specifies the coefficient ring of the total coordinate ring,
      * Variable => a symbol (Macaulay2Doc), default value x,
        that specifies the base name (Macaulay2Doc), for the
        indexed variables in the total coordinate ring
  * Outputs:
      * a normal toric variety, a smooth toric
        variety with Picard rank two

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

Peter Kleinschmidt constructs (up to isomorphism) all smooth normal toric
varieties with dimension $d$ and $d+2$ rays; see Kleinschmidt's "A
classification of toric varieties with few generators" Aequationes
Mathematicae, 35 (1998) 254-266.

When $d = 2$, we obtain a variety isomorphic to a Hirzebruch surface.  By
permuting the indexing of the rays and taking an automorphism of the lattice,
we produce an explicit isomorphism.

+-----------------------------------------------------------------------------+
|i1 : X = kleinschmidt (2,{3});                                               |
+-----------------------------------------------------------------------------+
|i2 : rays X                                                                  |
|                                                                             |
|o2 = {{-1, 0}, {1, 0}, {0, 1}, {3, -1}}                                      |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+
|i3 : max X                                                                   |
|                                                                             |
|o3 = {{0, 2}, {0, 3}, {1, 2}, {1, 3}}                                        |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : FF3 = hirzebruchSurface 3;                                              |
+-----------------------------------------------------------------------------+
|i5 : rays FF3                                                                |
|                                                                             |
|o5 = {{1, 0}, {0, 1}, {-1, 3}, {0, -1}}                                      |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : max FF3                                                                 |
|                                                                             |
|o6 = {{0, 1}, {0, 3}, {1, 2}, {2, 3}}                                        |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : permutingRays = matrix {{0,0,0,1},{0,1,0,0},{1,0,0,0},{0,0,1,0}}        |
|                                                                             |
|o7 = | 0 0 0 1 |                                                             |
|     | 0 1 0 0 |                                                             |
|     | 1 0 0 0 |                                                             |
|     | 0 0 1 0 |                                                             |
|                                                                             |
|              4       4                                                      |
|o7 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i8 : latticeAutomorphism = matrix {{0,1},{1,0}}                              |
|                                                                             |
|o8 = | 0 1 |                                                                 |
|     | 1 0 |                                                                 |
|                                                                             |
|              2       2                                                      |
|o8 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i9 : assert (latticeAutomorphism * (matrix transpose rays X) * permutingRays |
|-----------------------------------------------------------------------------|
|== matrix transpose rays FF3)                                                |
+-----------------------------------------------------------------------------+

The normal toric variety associated to the pair $(d,a)$ is Fano if and only if
$\sum_{i=0}^{r-1} a_i < d-r+1$.

+-----------------------------------------------------------------------------+
|i10 : X1 = kleinschmidt (3, {0,1});                                          |
+-----------------------------------------------------------------------------+
|i11 : isFano X1                                                              |
|                                                                             |
|o11 = true                                                                   |
+-----------------------------------------------------------------------------+
|i12 : X2 = kleinschmidt (4, {0,0});                                          |
+-----------------------------------------------------------------------------+
|i13 : isFano X2                                                              |
|                                                                             |
|o13 = true                                                                   |
+-----------------------------------------------------------------------------+
|i14 : ring X2                                                                |
|                                                                             |
|o14 = QQ[x ..x ]                                                             |
|          0   5                                                              |
|                                                                             |
|o14 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i15 : X3 = kleinschmidt (9, {1,2,3}, CoefficientRing => ZZ/32003, Variable =>|
|-----------------------------------------------------------------------------|
|y);                                                                          |
+-----------------------------------------------------------------------------+
|i16 : isFano X3                                                              |
|                                                                             |
|o16 = true                                                                   |
+-----------------------------------------------------------------------------+
|i17 : ring X3                                                                |
|                                                                             |
|        ZZ                                                                   |
|o17 = -----[y ..y  ]                                                         |
|      32003  0   10                                                          |
|                                                                             |
|o17 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+

The map from the group of torus-invariant Weil divisors,
to the class group,
is chosen so that the positive orthant
corresponds to the cone of nef line bundles.

+------------------------+
|i18 : nefGenerators X   |
|                        |
|o18 = | 1 0 |           |
|      | 0 1 |           |
|                        |
|               2       2|
|o18 : Matrix ZZ  <-- ZZ |
+------------------------+
|i19 : nefGenerators X1  |
|                        |
|o19 = | 1 0 |           |
|      | 0 1 |           |
|                        |
|               2       2|
|o19 : Matrix ZZ  <-- ZZ |
+------------------------+
|i20 : nefGenerators X2  |
|                        |
|o20 = | 1 0 |           |
|      | 0 1 |           |
|                        |
|               2       2|
|o20 : Matrix ZZ  <-- ZZ |
+------------------------+
|i21 : nefGenerators X3  |
|                        |
|o21 = | 1 0 |           |
|      | 0 1 |           |
|                        |
|               2       2|
|o21 : Matrix ZZ  <-- ZZ |
+------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * normalToricVariety -- make a
    normal toric variety
  * hirzebruchSurface -- make any Hirzebruch
    surface

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

  * kleinschmidt(ZZ,List) -- make any
    smooth normal toric variety having Picard rank two
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:915:0.

latticePoints(ToricDivisor) -- compute the lattice points in the associated polytope
************************************************************************************

  * Function: latticePoints (Polyhedra),
  * Usage:
        latticePoints D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a matrix (Macaulay2Doc), whose columns are the lattice
        points in the associated polytope

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

On a complete normal toric variety, the polyhedron associated to a Cartier
divisor is a lattice polytope.  Given a torus-invariant Cartier divisor on a
normal toric variety, this method returns an integer matrix whose columns
correspond to the lattices points contained in the associated polytope.  For a
non-effective Cartier divisor, this method returns null (Macaulay2Doc).

On the projective plane, the associate polytope is either empty, a point, or a
triangle.

+------------------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                                |
+------------------------------------------------------------------+
|i2 : assert (null === vertices (-PP2_0))                          |
+------------------------------------------------------------------+
|i3 : latticePoints (0*PP2_0)                                      |
|                                                                  |
|o3 = 0                                                            |
|                                                                  |
|              2       1                                           |
|o3 : Matrix ZZ  <-- ZZ                                            |
+------------------------------------------------------------------+
|i4 : assert isAmple PP2_0                                         |
+------------------------------------------------------------------+
|i5 : V1 = latticePoints (PP2_0)                                   |
|                                                                  |
|o5 = | 0 1 0 |                                                    |
|     | 0 0 1 |                                                    |
|                                                                  |
|              2       3                                           |
|o5 : Matrix ZZ  <-- ZZ                                            |
+------------------------------------------------------------------+
|i6 : X1 = normalToricVariety V1;                                  |
+------------------------------------------------------------------+
|i7 : assert (set rays X1 === set rays PP2 and  max X1 === max PP2)|
+------------------------------------------------------------------+
|i8 : assert isAmple (2*PP2_0)                                     |
+------------------------------------------------------------------+
|i9 : V2 = latticePoints (2*PP2_0)                                 |
|                                                                  |
|o9 = | 0 1 2 0 1 0 |                                              |
|     | 0 0 0 1 1 2 |                                              |
|                                                                  |
|              2       6                                           |
|o9 : Matrix ZZ  <-- ZZ                                            |
+------------------------------------------------------------------+
|i10 : X2 = normalToricVariety(V2, MinimalGenerators => true);     |
+------------------------------------------------------------------+
|i11 : assert (rays X2 === rays X1 and max X2 === max X1)          |
+------------------------------------------------------------------+

In this singular example, we see that all the lattice points in the polytope
arising from a divisor $2D$ do not come from the lattice points in the polytope
arising from $D$.

+-----------------------------------------------------------------------------+
|i12 : Y = normalToricVariety matrix                                          |
|-----------------------------------------------------------------------------|
|{{0,1,0,0,1},{0,0,1,0,1},{0,0,0,1,1},{0,0,0,0,3}};                           |
+-----------------------------------------------------------------------------+
|i13 : D = 3*Y_0;                                                             |
|                                                                             |
|o13 : ToricDivisor on Y                                                      |
+-----------------------------------------------------------------------------+
|i14 : latticePoints D                                                        |
|                                                                             |
|o14 = | 0 1 0 0 1 |                                                          |
|      | 0 0 1 0 1 |                                                          |
|      | 0 0 0 1 1 |                                                          |
|      | 0 0 0 0 3 |                                                          |
|                                                                             |
|               4       5                                                     |
|o14 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i15 : latticePoints (2*D)                                                    |
|                                                                             |
|o15 = | 0 1 2 0 1 0 0 1 0 0 1 1 2 1 1 2 |                                    |
|      | 0 0 0 1 1 2 0 0 1 0 1 1 1 2 1 2 |                                    |
|      | 0 0 0 0 0 0 1 1 1 2 1 1 1 1 2 2 |                                    |
|      | 0 0 0 0 0 0 0 0 0 0 2 3 3 3 3 6 |                                    |
|                                                                             |
|               4       16                                                    |
|o15 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * normalToricVariety(Matrix) -- make a
    normal toric variety from a polytope
  * vertices(ToricDivisor) -- compute the
    vertices of the associated polytope

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

  * latticePoints(ToricDivisor), --
    compute the lattice points in the associated polytope
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:2065:0.

makeSimplicial(NormalToricVariety) -- make a birational simplicial toric variety
********************************************************************************

  * Function: makeSimplicial,
  * Usage:
        makeSimplicial X
  * Inputs:
      * X, a normal toric variety,
  * Optional inputs (Macaulay2Doc),:
      * Strategy => an integer (Macaulay2Doc), default value 0,
        either 0 or 1
  * Outputs:
      * a normal toric variety, that is simplicial

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

A normal toric variety is simplicial if every cone in its fan is simplicial and
a cone is simplicial if its minimal generators are linearly independent over
$\QQ$.  In fact, the following conditions on a normal toric variety $X$ are
equivalent:

  * X is simplicial;
  * every Weil divisor on X has a positive integer multiple that is Cartier;
  * the Picard group of X has finite index in the class group of X;
  * X has only finite quotient singularities.

For more information, see Proposition 4.2.7 in Cox-Little-Schenck's Toric
Varieties.

Given a normal toric variety, this method makes a simplicial toric variety with
the same rays by triangulating the non-simplicial maximal cones.  For the 0
strategy, the triangulation is constructed by repeated regular subdivisions
using random integral weight vectors.  For the 1 strategy, the triangulation is
constructed by repeated pushing subdivisions (i.e. toricBlowups at a given
ray).

+-----------------------------------------------------------------------------+
|i1 : X = normalToricVariety (id_(ZZ^3) | - id_(ZZ^3));                       |
+-----------------------------------------------------------------------------+
|i2 : assert not isSimplicial X                                               |
+-----------------------------------------------------------------------------+
|i3 : Y1 = makeSimplicial X;                                                  |
+-----------------------------------------------------------------------------+
|i4 : assert isSimplicial Y1                                                  |
+-----------------------------------------------------------------------------+
|i5 : assert (rays Y1 === rays X)                                             |
+-----------------------------------------------------------------------------+
|i6 : max Y1                                                                  |
|                                                                             |
|o6 = {{0, 1, 3}, {0, 1, 5}, {0, 2, 3}, {0, 2, 6}, {0, 4, 5}, {0, 4, 6}, {1,  |
|     ------------------------------------------------------------------------|
|     3, 7}, {1, 5, 7}, {2, 3, 7}, {2, 6, 7}, {4, 5, 7}, {4, 6, 7}}           |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : max X                                                                   |
|                                                                             |
|o7 = {{0, 1, 2, 3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, {2, 3, 6, 7},  |
|     ------------------------------------------------------------------------|
|     {4, 5, 6, 7}}                                                           |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : Y2 = makeSimplicial(X, Strategy => 1);                                  |
+-----------------------------------------------------------------------------+
|i9 : assert isSimplicial Y2                                                  |
+-----------------------------------------------------------------------------+
|i10 : assert (rays Y2 === rays X)                                            |
+-----------------------------------------------------------------------------+
|i11 : max Y2                                                                 |
|                                                                             |
|o11 = {{0, 1, 3}, {0, 1, 5}, {0, 2, 3}, {0, 2, 6}, {0, 4, 5}, {0, 4, 6}, {1, |
|      -----------------------------------------------------------------------|
|      3, 7}, {1, 5, 7}, {2, 3, 7}, {2, 6, 7}, {4, 5, 7}, {4, 6, 7}}          |
|                                                                             |
|o11 : List                                                                   |
+-----------------------------------------------------------------------------+
|i12 : max Y1 == max Y2                                                       |
|                                                                             |
|o12 = true                                                                   |
+-----------------------------------------------------------------------------+

If the initial toric variety is simplicial, then this method simply returns it.

+--------------------------------------------------------+
|i13 : PP3 = toricProjectiveSpace 3;                     |
+--------------------------------------------------------+
|i14 : assert isSimplicial PP3                           |
+--------------------------------------------------------+
|i15 : Z = makeSimplicial PP3;                           |
+--------------------------------------------------------+
|i16 : assert (rays Z === rays PP3 and max Z === max PP3)|
+--------------------------------------------------------+

See also
========

  * resolving singularities -- information
    about find a smooth proper birational surjection
  * isSimplicial(NormalToricVariety)
    -- whether a normal toric variety is
    simplicial

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

  * makeSimplicial(NormalToricVariety)
    -- make a birational simplicial
    toric variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:2089:0.

makeSmooth(NormalToricVariety) -- make a birational smooth toric variety
************************************************************************

  * Function: makeSmooth,
  * Usage:
        makeSmooth X
  * Inputs:
      * X, a normal toric variety,
  * Optional inputs (Macaulay2Doc),:
      * Strategy => an integer (Macaulay2Doc), default value 0,
        either 0 or 1
  * Outputs:
      * a normal toric variety, that is smooth and
        birational to X

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

Every normal toric variety has a resolution of singularities given by another
normal toric variety.  Given a normal toric variety $X$ this method makes a new
smooth toric variety $Y$ which has a proper birational map to $X$.  The normal
toric variety $Y$ is obtained from $X$ by repeatedly blowing up appropriate
torus orbit closures (if necessary the makeSimplicial,
method is also used with the specified
strategy).  A minimal number of blow-ups are used.

As a simple example, we can resolve a simplicial affine singularity.

+------------------------------------------------------+
|i1 : U = normalToricVariety ({{4,-1},{0,1}}, {{0,1}});|
+------------------------------------------------------+
|i2 : assert not isSmooth U                            |
+------------------------------------------------------+
|i3 : V = makeSmooth U;                                |
+------------------------------------------------------+
|i4 : assert isSmooth V                                |
+------------------------------------------------------+
|i5 : rays V, max V                                    |
|                                                      |
|o5 = ({{4, -1}, {0, 1}, {1, 0}}, {{0, 2}, {1, 2}})    |
|                                                      |
|o5 : Sequence                                         |
+------------------------------------------------------+
|i6 : toList (set rays V - set rays U)                 |
|                                                      |
|o6 = {{1, 0}}                                         |
|                                                      |
|o6 : List                                             |
+------------------------------------------------------+

There is one additional rays, so only one toricBlowup was needed.

To resolve the singularities of this simplicial projective fourfold, we need
eleven toricBlowups.

+-----------------------------------------------+
|i7 : W = weightedProjectiveSpace {1,2,3,4,5};  |
+-----------------------------------------------+
|i8 : assert (dim W === 4)                      |
+-----------------------------------------------+
|i9 : assert (isSimplicial W and not isSmooth W)|
+-----------------------------------------------+
|i10 : W' = makeSmooth W;                       |
+-----------------------------------------------+
|i11 : assert isSmooth W'                       |
+-----------------------------------------------+
|i12 : # (set rays W' - set rays W)             |
|                                               |
|o12 = 11                                       |
+-----------------------------------------------+

If the initial toric variety is smooth, then this method simply returns it.

+-------------------------------------+
|i13 : AA1 = affineSpace 1;           |
+-------------------------------------+
|i14 : assert (AA1 === makeSmooth AA1)|
+-------------------------------------+
|i15 : PP2 = toricProjectiveSpace 2;  |
+-------------------------------------+
|i16 : assert (PP2 === makeSmooth PP2)|
+-------------------------------------+

In the next example, we resolve the singularities of a non-simplicial
projective threefold.

+------------------------------------------------------+
|i17 : X = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));|
+------------------------------------------------------+
|i18 : assert (not isSimplicial X and not isSmooth X)  |
+------------------------------------------------------+
|i19 : X' = makeSmooth X;                              |
+------------------------------------------------------+
|i20 : assert isSmooth X'                              |
+------------------------------------------------------+
|i21 : # (set rays X' - set rays X)                    |
|                                                      |
|o21 = 18                                              |
+------------------------------------------------------+

We also demonstrate this method on a complete simplicial non-projective
threefold.

+-----------------------------------------------------------------------------+
|i22 : Z = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{-1,-1,1},{3,-1,1},{0,0,1},{1,0,1},{0,1,1},{-1,3,1},{0,0,-1}},             |
|-----------------------------------------------------------------------------|
|{{0,1,3},{0,1,6},{0,2,3},{0,2,5},{0,5,6},{1,3,4},{1,4,5},{1,5,6},{2,3,4},{2,4|
|-----------------------------------------------------------------------------|
|,5}});                                                                       |
+-----------------------------------------------------------------------------+
|i23 : assert (isSimplicial Z and not isSmooth Z)                             |
+-----------------------------------------------------------------------------+
|i24 : assert (isComplete Z and not isProjective Z)                           |
+-----------------------------------------------------------------------------+
|i25 : Z' = makeSmooth Z;                                                     |
+-----------------------------------------------------------------------------+
|i26 : assert isSmooth Z'                                                     |
+-----------------------------------------------------------------------------+
|i27 : # (set rays Z' - set rays Z)                                           |
|                                                                             |
|o27 = 11                                                                     |
+-----------------------------------------------------------------------------+

We end with a degenerate example.

+-----------------------------------------------------------------------------+
|i28 : Y = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{1,0,0,0},{0,1,0,0},{0,0,1,0},{1,-1,1,0},{1,0,-2,0}}, {{0,1,2,3},{0,4}});  |
+-----------------------------------------------------------------------------+
|i29 : assert (isDegenerate Y and not isSimplicial Y and not isComplete Y)    |
+-----------------------------------------------------------------------------+
|i30 : Y' = makeSmooth Y;                                                     |
+-----------------------------------------------------------------------------+
|i31 : assert isSmooth Y'                                                     |
+-----------------------------------------------------------------------------+
|i32 : # (set rays Y' - set rays Y)                                           |
|                                                                             |
|o32 = 1                                                                      |
+-----------------------------------------------------------------------------+

Caveat
======

A singular normal toric variety almost never has a unique minimal resolution.
This method returns only one of the many minimal resolutions.

See also
========

  * resolving singularities -- information
    about find a smooth proper birational surjection
  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth
  * makeSimplicial(NormalToricVariety)
    -- make a birational simplicial
    toric variety

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

  * makeSmooth(NormalToricVariety),
    -- make a birational smooth toric variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:2286:0.

making normal toric varieties -- information about the basic constructors
*************************************************************************

A normal toric variety corresponds to a strongly convex rational polyhedral fan
in affine space.  In this package, the fan associated to a normal
$d$-dimensional toric variety lies in the rational vector space $\QQ^d$ with
underlying lattice $N = \ZZ^d$. The fan is encoded by the minimal nonzero
lattice points on its rays and the set of rays defining the maximal cones (a
maximal cone is not properly contained in another cone in the fan).  More
information about the correspondence between normal toric varieties and
strongly convex rational polyhedral fans appears in Subsection 3.1 of
Cox-Little-Schenck.

The general method for creating normal toric variety,
is normalToricVariety.  However,
there are many additional methods for constructing other specific types of
normal toric varieties.

Constructors for normal toric varieties
=======================================

  * normalToricVariety(List,List),
    -- make a normal toric variety
  * normalToricVariety(Matrix) -- make a
    normal toric variety from a polytope
  * NormalToricVariety -- the class of all normal
    toric varieties
  * isWellDefined(NormalToricVariety)
    -- whether a toric variety is
    well-defined
  * affineSpace(ZZ) -- make an affine space as a
    normal toric variety
  * projective space -- information about various
    constructions of projective space
  * toricProjectiveSpace(ZZ) -- make a
    projective space as a normal toric variety
  * weightedProjectiveSpace(List), --
    make a weighted projective space
  * hirzebruchSurface(ZZ) -- make any
    Hirzebruch surface
  * kleinschmidt(ZZ,List) -- make any
    smooth normal toric variety having Picard rank two
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties
  * NormalToricVariety ^** ZZ -- make the
    Cartesian power of a normal toric variety
  * smoothFanoToricVariety(ZZ,ZZ),
    -- get a smooth Fano toric variety from database
  * normalToricVariety(Fan) -- make a
    normal toric variety from a 'Polyhedra' fan
  * normalToricVariety(Polyhedron),
    -- make a normal toric variety from a 'Polyhedra' polyhedron

Several methods for making new normal toric varieties from old ones are listed
in the section on resolution of singularities.

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * resolving singularities -- information
    about find a smooth proper birational surjection
  * working with toric maps -- information
    about toric maps and the induced operations
  * working with divisors -- information about
    toric divisors and their related groups
  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:136:0.

map(NormalToricVariety,NormalToricVariety,Matrix) -- make a torus-equivariant map between normal toric varieties
****************************************************************************************************************

  * Function: map (Macaulay2Doc),
  * Usage:
        f = map(Y, X, g)
  * Inputs:
      * Y, a normal toric variety, the target of the
        map
      * X, a normal toric variety, the source of the
        map
      * g, a matrix (Macaulay2Doc), over the integers
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), =>
        ..., default value null, used
      * DegreeLift (Macaulay2Doc), => ...,
        default value null, used
      * DegreeMap (Macaulay2Doc), => ...,
        default value null, used
  * Outputs:
      * f, a toric map,

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

Let $X$ and $Y$ be normal toric varieties whose underlying lattices are $N_X$
and $N_Y$ respectively.  Every toric map $f : X \to Y$ corresponds to a unique
map $g : N_X \to N_Y$ of lattices such that, for any cone $\sigma$ in the fan
of $X$, there is a cone in the fan of $Y$ that contains the image $g(\sigma)$.
For more information on this correspondence, see Theorem 3.3.4 in
Cox-Little-Schenck's Toric Varieties.  Given the target, the source, and the
matrix representing lattice map, this basic constructor creates the
corresponding toric map.

We illustrate how to construct the projection from the second Hirzebruch surface,
to the projective line.

+---------------------------------------------------------+
|i1 : X = hirzebruchSurface 2;                            |
+---------------------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;                         |
+---------------------------------------------------------+
|i3 : f = map (Y, X, matrix {{1, 0}})                     |
|                                                         |
|o3 = | 1 0 |                                             |
|                                                         |
|o3 : ToricMap Y <--- X                                   |
+---------------------------------------------------------+
|i4 : assert (isWellDefined f and source f === X and      |
|         target f === Y and matrix f === matrix {{1, 0}})|
+---------------------------------------------------------+

Our second example makes the projection, from
the blow-up, of the
origin in the affine plane to the affine plane, is
proper.

+-----------------------------------------------------+
|i5 : A = affineSpace 2;                              |
+-----------------------------------------------------+
|i6 : max A                                           |
|                                                     |
|o6 = {{0, 1}}                                        |
|                                                     |
|o6 : List                                            |
+-----------------------------------------------------+
|i7 : B = toricBlowup({0, 1}, A);                     |
+-----------------------------------------------------+
|i8 : g = B^[]                                        |
|                                                     |
|o8 = | 1 0 |                                         |
|     | 0 1 |                                         |
|                                                     |
|o8 : ToricMap A <--- B                               |
+-----------------------------------------------------+
|i9 : isProper g                                      |
|                                                     |
|o9 = true                                            |
+-----------------------------------------------------+
|i10 : assert (isWellDefined g and g == map(A,B,1) and|
|          matrix g === id_(ZZ^2) and isProper g)     |
+-----------------------------------------------------+

Caveat
======

This method does not check that the given matrix determines a map of toric
varieties. In particular, it assumes that the image of each cone in the source
is contained in a cone in the target. One can verify this by using
isWellDefined(ToricMap).

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * source(ToricMap) -- get the source of the map
  * target(ToricMap) -- get the target of the map
  * matrix(ToricMap) -- get the underlying map of
    lattices
  * map(NormalToricVariety,NormalToricVariety,ZZ)
    -- make a
    torus-equivariant map between normal toric varieties
  * isProper(ToricMap) -- whether a toric map is
    proper

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

  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:357:0.

map(NormalToricVariety,NormalToricVariety,ZZ) -- make a torus-equivariant map between normal toric varieties
************************************************************************************************************

  * Function: map (Macaulay2Doc),
  * Usage:
        f = map(Y, X, m)
  * Inputs:
      * Y, a normal toric variety, the target of the
        map
      * X, a normal toric variety, the source of the
        map
      * m, an integer (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), =>
        ..., default value null, used
      * DegreeLift (Macaulay2Doc), => ...,
        default value null, used
      * DegreeMap (Macaulay2Doc), => ...,
        default value null, used
  * Outputs:
      * f, a toric map,

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

Let $X$ and $Y$ be normal toric varieties whose underlying lattices are $N_X$
and $N_Y$ respectively.  Every toric map $f : X \to Y$ corresponds to a unique
map $g : N_X \to N_Y$ of lattices such that, for any cone $\sigma$ in the fan
of $X$, there is a cone in the fan of $Y$ that contains the image $g(\sigma)$.
For more information on this correspondence, see Theorem 3.3.4 in
Cox-Little-Schenck's Toric Varieties.  Given the target, the source, and the
matrix representing lattice map, this basic constructor creates the
corresponding toric map; the integer determines the lattice map in two distinct
ways.

When the integer equals zero, the underlying map of lattices is represented by
the zero matrix.

+------------------------------------------------------------------------+
|i1 : X = hirzebruchSurface 2;                                           |
+------------------------------------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;                                        |
+------------------------------------------------------------------------+
|i3 : f = map(Y, X, 0)                                                   |
|                                                                        |
|o3 = 0                                                                  |
|                                                                        |
|o3 : ToricMap Y <--- X                                                  |
+------------------------------------------------------------------------+
|i4 : assert (isWellDefined f and source f === X and                     |
|         target f === Y and matrix f === map(ZZ^(dim Y), ZZ^(dim X), 0))|
+------------------------------------------------------------------------+

If the integer $m$ is nonzero, then the underlying map of lattices is
represented by multiplying the identity matrix by the given integer $m$.
Hence, this second case requires that the dimension of the source and target be
equal.

+-------------------------------------------------------------------------+
|i5 : Z = normalToricVariety ({{1,0},{-1,2},{0,-1}}, {{0,1},{0,2},{1,2}});|
+-------------------------------------------------------------------------+
|i6 : assert (isWellDefined Z and not isSmooth Z)                         |
+-------------------------------------------------------------------------+
|i7 : g = map(Z, X, 2)                                                    |
|                                                                         |
|o7 = | 2 0 |                                                             |
|     | 0 2 |                                                             |
|                                                                         |
|o7 : ToricMap Z <--- X                                                   |
+-------------------------------------------------------------------------+
|i8 : assert (isWellDefined g and source g === X and                      |
|         target g === Z and matrix g === 2*id_(ZZ^(dim X)))              |
+-------------------------------------------------------------------------+

Setting m = 1 is a easy way to construct the canonical projection,
associated to a blow-up,
or the identity map.

+----------------------------------------------------+
|i9 : A = affineSpace 2;                             |
+----------------------------------------------------+
|i10 : B = toricBlowup ({0, 1}, A);                  |
+----------------------------------------------------+
|i11 : h = map(A, B, 1)                              |
|                                                    |
|o11 = | 1 0 |                                       |
|      | 0 1 |                                       |
|                                                    |
|o11 : ToricMap A <--- B                             |
+----------------------------------------------------+
|i12 : assert (isWellDefined h and h == B^[])        |
+----------------------------------------------------+
|i13 : i = map(A, A, 1)                              |
|                                                    |
|o13 = | 1 0 |                                       |
|      | 0 1 |                                       |
|                                                    |
|o13 : ToricMap A <--- A                             |
+----------------------------------------------------+
|i14 : i == id_A                                     |
|                                                    |
|o14 = true                                          |
+----------------------------------------------------+
|i15 : assert (isWellDefined i and source i === A and|
|          target i === A and matrix i === id_(ZZ^2))|
+----------------------------------------------------+

Caveat
======

This method does not check that the given matrix determines a map of toric
varieties. In particular, it assumes that the image of each cone in the source
is contained in a cone in the target. One can verify this by using
isWellDefined(ToricMap).

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * source(ToricMap) -- get the source of the map
  * target(ToricMap) -- get the target of the map
  * matrix(ToricMap) -- get the underlying map of
    lattices
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties

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

  * map(NormalToricVariety,NormalToricVariety,ZZ)
    -- make a
    torus-equivariant map between normal toric varieties
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:438:0.

matrix(ToricMap) -- get the underlying map of lattices
******************************************************

  * Function: matrix (Macaulay2Doc),
  * Usage:
        g = matrix f
  * Inputs:
      * f, a toric map,
  * Optional inputs (Macaulay2Doc),:
      * Degree (Macaulay2Doc), => ..., default value
        null, unused
  * Outputs:
      * g, a matrix (Macaulay2Doc), over the integers (Macaulay2Doc),

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

Every toric map $f : X \to Y$ corresponds to a unique map $g : N_X \to N_Y$ of
lattices such that, for every cone $\sigma$ in the fan of $X$, there is a cone
in the fan of $Y$ that contains the image $g(\sigma)$.  For more information on
this correspondence, see Theorem 3.3.4 in Cox-Little-Schenck's Toric Varieties.
This method returns an integer matrix representing $g$.

We illustrate how to access this defining feature of a toric map with the
projection from the second Hirzebruch surface,
to the projective line.

+-----------------------------------------------+
|i1 : X = hirzebruchSurface 2;                  |
+-----------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;               |
+-----------------------------------------------+
|i3 : f = map(Y, X, matrix {{1, 0}})            |
|                                               |
|o3 = | 1 0 |                                   |
|                                               |
|o3 : ToricMap Y <--- X                         |
+-----------------------------------------------+
|i4 : g = matrix f                              |
|                                               |
|o4 = | 1 0 |                                   |
|                                               |
|              1       2                        |
|o4 : Matrix ZZ  <-- ZZ                         |
+-----------------------------------------------+
|i5 : assert (isWellDefined f and ring g === ZZ)|
+-----------------------------------------------+

An inclusion map, into the Cartesian square
of a normal toric variety corresponds to matrix having identity and zero
blocks.

+---------------------------------------------------------+
|i6 : X2 = X ** X;                                        |
+---------------------------------------------------------+
|i7 : iota0 = X2_[0]                                      |
|                                                         |
|o7 = | 1 0 |                                             |
|     | 0 1 |                                             |
|     | 0 0 |                                             |
|     | 0 0 |                                             |
|                                                         |
|o7 : ToricMap X2 <--- X                                  |
+---------------------------------------------------------+
|i8 : assert (isWellDefined iota0 and source iota0 === X) |
+---------------------------------------------------------+
|i9 : iota1 = X2_[1]                                      |
|                                                         |
|o9 = | 0 0 |                                             |
|     | 0 0 |                                             |
|     | 1 0 |                                             |
|     | 0 1 |                                             |
|                                                         |
|o9 : ToricMap X2 <--- X                                  |
+---------------------------------------------------------+
|i10 : assert (isWellDefined iota1 and source iota1 === X)|
+---------------------------------------------------------+

In a well-defined toric map, the number of rows in the underlying matrix must
equal the dimension of the target and the number of columns must equal the
dimension of the source.

+------------------------------------+
|i11 : assert (numColumns g == dim X)|
+------------------------------------+
|i12 : assert (numRows g == dim Y)   |
+------------------------------------+

The output display for toric maps is inherited the underlying map of lattices.

+-----------------------------------------------------------------------------+
|i13 : code (net, ToricMap)                                                   |
|                                                                             |
|o13 = -- code for method: net(ToricMap)                                      |
|      ../../../../../Macaulay2/packages/NormalToricVarieties/ToricMaps.m2:10:|
|      16-10:33: --source code:                                               |
|      net ToricMap := f -> net matrix f                                      |
+-----------------------------------------------------------------------------+

Since this is a defining attribute of a toric map, no computation is required.

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * source(ToricMap) -- get the source of the map
  * target(ToricMap) -- get the target of the map
  * isWellDefined(ToricMap) -- whether a
    toric map is well defined
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties
  * NormalToricVariety _ Array -- make a
    canonical inclusion into a product

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

  * matrix(ToricMap) -- get the underlying map of
    lattices
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:282:0.

max(NormalToricVariety) -- get the maximal cones in the associated fan
**********************************************************************

  * Function: max (Macaulay2Doc),
  * Usage:
        max X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a list (Macaulay2Doc), of lists of nonnegative integers;
        each entry indexes the rays that generate a maximal cone in the fan

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

A normal toric variety corresponds to a strongly convex rational polyhedral fan
in affine space.  In this package, the fan associated to a normal
$d$-dimensional toric variety lies in the rational vector space $\QQ^d$ with
underlying lattice $N = \ZZ^d$. The fan is encoded by the minimal nonzero
lattice points on its rays and the set of rays defining the maximal cones
(where a maximal cone is not properly contained in another cone in the fan).
The rays are ordered and indexed by nonnegative integers: $0, 1, \dots, n-1$.
Using this indexing, a maximal cone in the fan corresponds to a sublist of $\{
0, 1, \dots, n-1 \}$; the entries index the rays that generate the cone.

The examples show the maximal cones for the projective line, see projective $3$-space,
a Hirzebruch surface,
and a weighted projective space.

+----------------------------------+
|i1 : PP1 = toricProjectiveSpace 1;|
+----------------------------------+
|i2 : # rays PP1                   |
|                                  |
|o2 = 2                            |
+----------------------------------+
|i3 : max PP1                      |
|                                  |
|o3 = {{0}, {1}}                   |
|                                  |
|o3 : List                         |
+----------------------------------+
+-------------------------------------------------+
|i4 : PP3 = toricProjectiveSpace 3;               |
+-------------------------------------------------+
|i5 : # rays PP3                                  |
|                                                 |
|o5 = 4                                           |
+-------------------------------------------------+
|i6 : max PP3                                     |
|                                                 |
|o6 = {{0, 1, 2}, {0, 1, 3}, {0, 2, 3}, {1, 2, 3}}|
|                                                 |
|o6 : List                                        |
+-------------------------------------------------+
+-------------------------------------+
|i7 : FF7 = hirzebruchSurface 7;      |
+-------------------------------------+
|i8 : # rays FF7                      |
|                                     |
|o8 = 4                               |
+-------------------------------------+
|i9 : max FF7                         |
|                                     |
|o9 = {{0, 1}, {0, 3}, {1, 2}, {2, 3}}|
|                                     |
|o9 : List                            |
+-------------------------------------+
+------------------------------------------+
|i10 : X = weightedProjectiveSpace {1,2,3};|
+------------------------------------------+
|i11 : # rays X                            |
|                                          |
|o11 = 3                                   |
+------------------------------------------+
|i12 : max X                               |
|                                          |
|o12 = {{0, 1}, {0, 2}, {1, 2}}            |
|                                          |
|o12 : List                                |
+------------------------------------------+

In this package, a list corresponding to the maximal cones in the fan is part
of the defining data of a normal toric variety, so this method does no
computation.

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * rays(NormalToricVariety) -- get the
    rays of the associated fan

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

  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1502:0.

monomials(ToricDivisor) -- list the monomials that span the linear series
*************************************************************************

  * Function: monomials (Macaulay2Doc),
  * Usage:
        monomials D
  * Inputs:
      * D, a toric divisor,
  * Optional inputs (Macaulay2Doc),:
      * Variables (Macaulay2Doc),
        => ..., default value null,
  * Outputs:
      * a list (Macaulay2Doc), of torus-invariant
        RingElements (Macaulay2Doc), that appear in the complete
        linear system of the given divisor

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

By identifying the coefficients of an effective irreducible torus-invariant
divisors with exponents of the generators of the total coordinate ring,
each toric divisor on a
NormalToricVariety, corresponds to a monomial.  This method
function returns all of the monomials corresponding to linear equivalent toric
divisors.

This method function assumes that the underlying toric variety is projective.

Projective space is especially simple.

+-----------------------------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                                           |
+-----------------------------------------------------------------------------+
|i2 : D1 = 5*PP2_0                                                            |
|                                                                             |
|o2 = 5*PP2                                                                   |
|          0                                                                  |
|                                                                             |
|o2 : ToricDivisor on PP2                                                     |
+-----------------------------------------------------------------------------+
|i3 : M1 = elapsedTime monomials D1                                           |
| -- .0340647s elapsed                                                        |
|                                                                             |
|       5     4     4   2 3       3   2 3   3 2     2 2   2   2   3 2   4     |
|o3 = {x , x x , x x , x x , x x x , x x , x x , x x x , x x x , x x , x x ,  |
|       2   1 2   0 2   1 2   0 1 2   0 2   1 2   0 1 2   0 1 2   0 2   1 2   |
|     ------------------------------------------------------------------------|
|        3     2 2     3       4     5     4   2 3   3 2   4     5            |
|     x x x , x x x , x x x , x x , x , x x , x x , x x , x x , x }           |
|      0 1 2   0 1 2   0 1 2   0 2   1   0 1   0 1   0 1   0 1   0            |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : elapsedTime assert (set M1 === set first entries basis(degree D1, ring  |
| -- .00163213s elapsed                                                       |
|-----------------------------------------------------------------------------|
|variety D1))                                                                 |
+-----------------------------------------------------------------------------+

Toric varieties of Picard-rank 2 are slightly more interesting.

+-----------------------------------------------------------------------------+
|i5 : FF2 = hirzebruchSurface 2;                                              |
+-----------------------------------------------------------------------------+
|i6 : D2 = 2*FF2_0 + 3 * FF2_1                                                |
|                                                                             |
|o6 = 2*FF2  + 3*FF2                                                          |
|          0        1                                                         |
|                                                                             |
|o6 : ToricDivisor on FF2                                                     |
+-----------------------------------------------------------------------------+
|i7 : M2 = elapsedTime monomials D2                                           |
| -- .138979s elapsed                                                         |
|                                                                             |
|       2     3 2     3     2 3                                               |
|o7 = {x x , x x , x x x , x x }                                              |
|       1 3   1 2   0 1 2   0 1                                               |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : elapsedTime assert (set M2 === set first entries basis (degree D2, ring |
| -- .00452794s elapsed                                                       |
|-----------------------------------------------------------------------------|
|variety D2))                                                                 |
+-----------------------------------------------------------------------------+
|i9 : X = kleinschmidt (5, {1,2,3});                                          |
+-----------------------------------------------------------------------------+
|i10 : D3 = 3*X_0 + 5*X_1                                                     |
|                                                                             |
|o10 = 3*X  + 5*X                                                             |
|         0      1                                                            |
|                                                                             |
|o10 : ToricDivisor on X                                                      |
+-----------------------------------------------------------------------------+
|i11 : m3 = elapsedTime # monomials D3                                        |
| -- 51.9467s elapsed                                                         |
|                                                                             |
|o11 = 7909                                                                   |
+-----------------------------------------------------------------------------+
|i12 : elapsedTime assert (m3 === #first entries basis (degree D3, ring       |
| -- .174756s elapsed                                                         |
|-----------------------------------------------------------------------------|
|variety D3))                                                                 |
+-----------------------------------------------------------------------------+

By exploiting latticePoints (Polyhedra), this method
function avoids using the basis (Macaulay2Doc), function.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
  * vector(ToricDivisor) -- make the vector of
    coefficients

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

  * monomials(ToricDivisor) -- list the
    monomials that span the linear series
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1019:0.

nefGenerators(NormalToricVariety) -- compute generators of the nef cone
***********************************************************************

  * Function: nefGenerators (missing documentation)
  * Usage:
        nefGenerators X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a matrix (Macaulay2Doc), whose columns generate the nef
        cone of X as a convex cone in the Picard group

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

The nef cone of a variety is the cone generated by classes of nef Cartier
divisors in vector space of Cartier divisors modulo numerical equivalence.  On
a normal toric variety, numerical equivalence and linear equivalence coincide,
so the nef cone lies in the Picard group.  Assume that the normal toric variety
is non-degenerate, its nef cone is a rational polyhedral cone in the Picard
group; see Theorem 6.3.20 in Cox-Little-Schenck's Toric Varieties.  This
function calculates generators for the rays of this cone, and returns a matrix
whose columns correspond to these generates (expressed as vectors in the chosen
basis for the Picard group).

For some of our favourite normal toric varieties, we choose a basis for the
Picard group which makes the nef cone into the positive orthant.

+----------------------------------------------------------------+
|i1 : nefGenerators toricProjectiveSpace 1                       |
|                                                                |
|o1 = | 1 |                                                      |
|                                                                |
|              1       1                                         |
|o1 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+
|i2 : nefGenerators toricProjectiveSpace 3                       |
|                                                                |
|o2 = | 1 |                                                      |
|                                                                |
|              1       1                                         |
|o2 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+
|i3 : nefGenerators normalToricVariety ( id_(ZZ^3) | - id_(ZZ^3))|
|                                                                |
|o3 = | 1 |                                                      |
|                                                                |
|              1       1                                         |
|o3 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+
|i4 : nefGenerators hirzebruchSurface 7                          |
|                                                                |
|o4 = | 1 0 |                                                    |
|     | 0 1 |                                                    |
|                                                                |
|              2       2                                         |
|o4 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+
|i5 : nefGenerators kleinschmidt (3,{0,1})                       |
|                                                                |
|o5 = | 1 0 |                                                    |
|     | 0 1 |                                                    |
|                                                                |
|              2       2                                         |
|o5 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+
|i6 : nefGenerators smoothFanoToricVariety (2,3)                 |
|                                                                |
|o6 = | 1 0 0 |                                                  |
|     | 0 1 0 |                                                  |
|     | 0 0 1 |                                                  |
|                                                                |
|              3       3                                         |
|o6 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+
|i7 : nefGenerators smoothFanoToricVariety (3,12)                |
|                                                                |
|o7 = | 1 0 0 0 |                                                |
|     | 0 1 0 0 |                                                |
|     | 0 0 1 0 |                                                |
|     | 0 0 0 1 |                                                |
|                                                                |
|              4       4                                         |
|o7 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+
|i8 : nefGenerators smoothFanoToricVariety (4,90)                |
|                                                                |
|o8 = | 1 0 0 0 0 |                                              |
|     | 0 1 0 0 0 |                                              |
|     | 0 0 1 0 0 |                                              |
|     | 0 0 0 1 0 |                                              |
|     | 0 0 0 0 1 |                                              |
|                                                                |
|              5       5                                         |
|o8 : Matrix ZZ  <-- ZZ                                          |
+----------------------------------------------------------------+

In general, the nef cone need not even be simplicial (Polyhedra).

+--------------------------------------------------+
|i9 : nefGenerators smoothFanoToricVariety (2,4)   |
|                                                  |
|o9 = | 1 0 0 1 0 |                                |
|     | 0 1 1 0 0 |                                |
|     | 0 0 1 0 1 |                                |
|     | 0 0 0 1 1 |                                |
|                                                  |
|              4       5                           |
|o9 : Matrix ZZ  <-- ZZ                            |
+--------------------------------------------------+
|i10 : nefGenerators smoothFanoToricVariety (3,16) |
|                                                  |
|o10 = | 1 0 1 0 0 0 |                             |
|      | 1 0 0 0 0 1 |                             |
|      | 0 1 1 0 0 0 |                             |
|      | 0 0 0 1 0 0 |                             |
|      | 0 0 0 0 1 1 |                             |
|                                                  |
|               5       6                          |
|o10 : Matrix ZZ  <-- ZZ                           |
+--------------------------------------------------+
|i11 : nefGenerators smoothFanoToricVariety (4,120)|
|                                                  |
|o11 = | 1 0 1 0 0 0 0 0 0 0 |                     |
|      | 0 1 0 1 0 0 0 0 0 0 |                     |
|      | 0 0 1 0 1 0 0 0 0 0 |                     |
|      | 0 0 0 1 1 0 0 0 0 0 |                     |
|      | 0 0 0 0 0 1 0 1 0 0 |                     |
|      | 0 0 0 0 0 0 1 0 1 0 |                     |
|      | 0 0 0 0 0 0 0 1 0 1 |                     |
|      | 0 0 0 0 0 0 0 0 1 1 |                     |
|                                                  |
|               8       10                         |
|o11 : Matrix ZZ  <-- ZZ                           |
+--------------------------------------------------+

There are smooth, complete (Polyhedra),
normal toric varieties with no nontrivial nef divisors.

+-----------------------------------------------------------------------------+
|i12 : X = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{0,-1,2},{0,0,-1},{-1,1,-1},{-1,0,-1},{-1,-1,0}},{{|
|-----------------------------------------------------------------------------|
|0,1,2},{0,2,3},{0,3,4},{0,4,5},{0,1,5},{1,2,7},{2,3,7},{3,4,7},{4,5,6},{4,6,7|
|-----------------------------------------------------------------------------|
|},{5,6,7},{1,5,7}});                                                         |
+-----------------------------------------------------------------------------+
|i13 : assert (isComplete X and not isProjective X and isSmooth X)            |
+-----------------------------------------------------------------------------+
|i14 : picardGroup X                                                          |
|                                                                             |
|        5                                                                    |
|o14 = ZZ                                                                     |
|                                                                             |
|o14 : ZZ-module, free                                                        |
+-----------------------------------------------------------------------------+
|i15 : assert (nefGenerators X == 0)                                          |
+-----------------------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * isNef(ToricDivisor) -- whether a
    torus-invariant Weil divisor is nef

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

  * nefGenerators(NormalToricVariety)
    -- compute generators of the nef
    cone
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:683:0.

NormalToricVariety -- the class of all normal toric varieties
*************************************************************

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

A normal toric variety corresponds to a strongly convex rational polyhedral
fan.  In this package, the fan associated to a normal $d$-dimensional toric
variety lies in the rational vector space $\QQ^d$ with underlying lattice $N =
\ZZ^d$.  The fan is encoded by the minimal nonzero lattice points on its rays
and the set of rays defining the maximal cones (a maximal cone is not properly
contained in another cone in the fan).  More information about the
correspondence between normal toric varieties and strongly convex rational
polyhedral fans appears in Subsection 3.1 of Cox-Little-Schenck.

Caveat
======

To sidestep edge case issues, this package excludes some normal toric
varieties.  To avoid the $0$-dimensional vector space, all normal toric
varieties in this package have positive dimension.  Similarly, to circumvent
the empty set of rays, all normal toric varieties in this package have an orbit
other than the dense algebraic

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * normalToricVariety -- make a
    normal toric variety
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan
  * expression(NormalToricVariety),
    -- get the expression used to format for printing

Functions and methods returning a normal toric variety:
=======================================================

  * affineSpace(ZZ) -- make an affine space as a
    normal toric variety
  * hirzebruchSurface(ZZ) -- make any
    Hirzebruch surface
  * kleinschmidt(ZZ,List) -- make any
    smooth normal toric variety having Picard rank two
  * "makeSimplicial" -- see makeSimplicial(NormalToricVariety),
    -- make a birational simplicial
    toric variety
  * "makeSmooth" -- see makeSmooth(NormalToricVariety),
    -- make a birational smooth toric
    variety
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties
  * NormalToricVariety ^** ZZ -- make the
    Cartesian power of a normal toric variety
  * "normalToricVariety" -- see normalToricVariety(List,List),
    -- make a normal toric variety
  * normalToricVariety(Ring) -- get the
    associated normal toric variety
  * smoothFanoToricVariety(ZZ,ZZ),
    -- get a smooth Fano toric variety from database
  * source(ToricMap) -- get the source of the map
  * target(ToricMap) -- get the target of the map
  * "toricBlowup(List,NormalToricVariety)" -- see
    toricBlowup(List,NormalToricVariety,List),
    -- makes the toricBlowup
    of a normal toric variety along a torus orbit closure
  * toricBlowup(List,NormalToricVariety,List)
    -- makes the toricBlowup
    of a normal toric variety along a torus orbit closure
  * toricProjectiveSpace(ZZ) -- make a
    projective space as a normal toric variety
  * "normalToricVariety(ToricDivisor)" -- see variety(ToricDivisor),
    -- get the underlying normal toric variety
  * variety(ToricDivisor) -- get the
    underlying normal toric variety
  * weightedProjectiveSpace(List), --
    make a weighted projective space

Methods that use a normal toric variety:
========================================

  * abstractSheaf(NormalToricVariety,AbstractVariety,CoherentSheaf),
    --
    make the corresponding abstract sheaf
  * "abstractSheaf(NormalToricVariety,CoherentSheaf)" -- see
    abstractSheaf(NormalToricVariety,AbstractVariety,CoherentSheaf),
    --
    make the corresponding abstract sheaf
  * abstractSheaf(NormalToricVariety,AbstractVariety,ToricDivisor),
    --
    make the corresponding abstract sheaf
  * "abstractSheaf(NormalToricVariety,ToricDivisor)" -- see
    abstractSheaf(NormalToricVariety,AbstractVariety,ToricDivisor),
    --
    make the corresponding abstract sheaf
  * "abstractVariety(NormalToricVariety)" -- see
    abstractVariety(NormalToricVariety,AbstractVariety),
    -- make the
    corresponding abstract variety
  * abstractVariety(NormalToricVariety,AbstractVariety)
    -- make the
    corresponding abstract variety
  * "cartesianProduct(NormalToricVariety)" -- see
    cartesianProduct(Sequence), -- make the
    Cartesian product of normal toric varieties
  * cartierDivisorGroup(NormalToricVariety)
    -- compute the group of
    torus-invariant Cartier divisors
  * "intersectionRing(NormalToricVariety)" -- see Chow ring,
    -- make the rational Chow ring
  * "intersectionRing(NormalToricVariety,AbstractVariety)" -- see Chow ring,
    -- make the rational Chow ring
  * classGroup(NormalToricVariety),
    -- make the class group
  * components(NormalToricVariety),
    -- list the factors in a product
  * "cotangentSheaf(List,NormalToricVariety)" -- see
    cotangentSheaf(NormalToricVariety),
    -- make the sheaf of Zariski 1-forms
  * cotangentSheaf(NormalToricVariety)
    -- make the sheaf of Zariski
    1-forms
  * "cotangentSheaf(ZZ,NormalToricVariety)" -- see
    cotangentSheaf(NormalToricVariety),
    -- make the sheaf of Zariski 1-forms
  * "diagonalToricMap(NormalToricVariety)" -- see diagonalToricMap,
    -- make a diagonal map into a Cartesian product
  * "diagonalToricMap(NormalToricVariety,ZZ)" -- see diagonalToricMap,
    -- make a diagonal map into a Cartesian product
  * "diagonalToricMap(NormalToricVariety,ZZ,Array)" -- see
    diagonalToricMap, -- make a diagonal map into a Cartesian
    product
  * dim(NormalToricVariety) -- get the
    dimension of a normal toric variety
  * effCone(NormalToricVariety) (missing documentation)
  * effGenerators(NormalToricVariety) (missing documentation)
  * expression(NormalToricVariety),
    -- get the expression used to format for printing
  * fan(NormalToricVariety) -- make the
    'Polyhedra' fan associated to the normal toric variety
  * fromCDivToPic(NormalToricVariety)
    -- get the map from Cartier divisors
    to the Picard group
  * fromCDivToWDiv(NormalToricVariety)
    -- get the map from Cartier
    divisors to Weil divisors
  * fromPicToCl(NormalToricVariety),
    -- get the map from Picard group to class group
  * fromWDivToCl(NormalToricVariety)
    -- get the map from the group of Weil
    divisors to the class group
  * HH^ZZ(NormalToricVariety,CoherentSheaf)
    -- compute the cohomology of
    a coherent sheaf
  * "HH^ZZ(NormalToricVariety,SheafOfRings)" -- see
    HH^ZZ(NormalToricVariety,CoherentSheaf),
    -- compute the cohomology of
    a coherent sheaf
  * hilbertPolynomial(NormalToricVariety)
    -- compute the multivariate
    Hilbert polynomial
  * "hilbertPolynomial(NormalToricVariety,Ring)" -- see
    hilbertPolynomial(NormalToricVariety),
    -- compute the multivariate
    Hilbert polynomial
  * "hilbertPolynomial(NormalToricVariety,SheafOfRings)" -- see
    hilbertPolynomial(NormalToricVariety),
    -- compute the multivariate
    Hilbert polynomial
  * hilbertPolynomial(NormalToricVariety,CoherentSheaf)
    -- compute the
    multivariate Hilbert polynomial
  * "hilbertPolynomial(NormalToricVariety,Ideal)" -- see
    hilbertPolynomial(NormalToricVariety,CoherentSheaf),
    -- compute the
    multivariate Hilbert polynomial
  * "hilbertPolynomial(NormalToricVariety,Module)" -- see
    hilbertPolynomial(NormalToricVariety,CoherentSheaf),
    -- compute the
    multivariate Hilbert polynomial
  * ideal(NormalToricVariety) -- make the
    irrelevant ideal
  * "monomialIdeal(NormalToricVariety)" -- see ideal(NormalToricVariety),
    -- make the irrelevant ideal
  * isComplete(NormalToricVariety),
    -- whether a toric variety is complete
  * isDegenerate(NormalToricVariety)
    -- whether a toric variety is
    degenerate
  * isFano(NormalToricVariety), --
    whether a normal toric variety is Fano
  * isProjective(NormalToricVariety)
    -- whether a toric variety is
    projective
  * isSimplicial(NormalToricVariety)
    -- whether a normal toric variety is
    simplicial
  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth
  * isWellDefined(NormalToricVariety)
    -- whether a toric variety is
    well-defined
  * makeSimplicial(NormalToricVariety)
    -- make a birational simplicial
    toric variety
  * makeSmooth(NormalToricVariety),
    -- make a birational smooth toric variety
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * map(NormalToricVariety,NormalToricVariety,ZZ)
    -- make a
    torus-equivariant map between normal toric varieties
  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan
  * nefCone(NormalToricVariety) (missing documentation)
  * nefGenerators(NormalToricVariety)
    -- compute generators of the nef
    cone
  * NormalToricVariety ^ Array -- make a
    canonical projection map
  * NormalToricVariety _ Array -- make a
    canonical inclusion into a product
  * NormalToricVariety _ ZZ -- make an
    irreducible torus-invariant divisor
  * orbits(NormalToricVariety) -- make a
    hashtable indexing the torus orbits (a.k.a. cones in the fan)
  * orbits(NormalToricVariety,ZZ),
    -- get a list of the torus orbits (a.k.a. cones in the fan) of a given
    dimension
  * picardGroup(NormalToricVariety),
    -- make the Picard group
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
  * sheaf(NormalToricVariety,Module)
    -- make a coherent sheaf
  * "OO _ NormalToricVariety" -- see sheaf(NormalToricVariety,Ring),
    -- make a coherent sheaf of rings
  * "sheaf(NormalToricVariety)" -- see sheaf(NormalToricVariety,Ring),
    -- make a coherent sheaf of rings
  * sheaf(NormalToricVariety,Ring),
    -- make a coherent sheaf of rings
  * "todd(NormalToricVariety)" -- see todd(CoherentSheaf),
    -- compute the Todd class of a coherent sheaf
  * toricDivisor(List,NormalToricVariety)
    -- make a torus-invariant Weil
    divisor
  * toricDivisor(NormalToricVariety)
    -- make the canonical divisor
  * weilDivisorGroup(NormalToricVariety)
    -- make the group of
    torus-invariant Weil divisors

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

The object NormalToricVariety, is a type (Macaulay2Doc),
with ancestor classes Variety (Varieties), <
MutableHashTable (Macaulay2Doc) < HashTable (Macaulay2Doc)
< Thing (Macaulay2Doc).

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

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:168:0.

NormalToricVariety ** NormalToricVariety -- make the Cartesian product of two normal toric varieties
****************************************************************************************************

  * Operator: ** (Macaulay2Doc),
  * Usage:
        X ** Y
  * Inputs:
      * X, a normal toric variety,
      * Y, a normal toric variety,
  * Outputs:
      * a normal toric variety, the product of X and
        Y

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

The Cartesian product of two varieties $X$ and $Y$, both defined over the same
ground field $k$, is the fiber product $X \times_k Y$.  For normal toric
varieties, the fan of the product is given by the Cartesian product of each
pair of cones in the fans of the factors.

+-----------------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                               |
+-----------------------------------------------------------------+
|i2 : FF2 = hirzebruchSurface 2;                                  |
+-----------------------------------------------------------------+
|i3 : X = FF2 ** PP2;                                             |
+-----------------------------------------------------------------+
|i4 : assert (# rays X == # rays FF2 + # rays PP2)                |
+-----------------------------------------------------------------+
|i5 : assert (matrix rays X == matrix rays FF2 ++ matrix rays PP2)|
+-----------------------------------------------------------------+
|i6 : primaryDecomposition ideal X                                |
|                                                                 |
|o6 = {ideal (x , x ), ideal (x , x ), ideal (x , x , x )}        |
|              2   0           1   3           6   5   4          |
|                                                                 |
|o6 : List                                                        |
+-----------------------------------------------------------------+
|i7 : flatten (primaryDecomposition \ {ideal FF2,ideal PP2})      |
|                                                                 |
|o7 = {ideal (x , x ), ideal (x , x ), ideal (x , x , x )}        |
|              2   0           1   3           2   1   0          |
|                                                                 |
|o7 : List                                                        |
+-----------------------------------------------------------------+

The map from the torus-invariant Weil divisors to the class group is the direct
sum of the maps for the factors.

+--------------------------------------------------------------------+
|i8 : assert (fromWDivToCl FF2 ++ fromWDivToCl PP2 == fromWDivToCl X)|
+--------------------------------------------------------------------+

The factors are cached and can be accessed with components (Macaulay2Doc).

+--------------------------------+
|i9 : factors = components X     |
|                                |
|o9 = {FF2, PP2}                 |
|                                |
|o9 : List                       |
+--------------------------------+
|i10 : assert (# factors === 2)  |
+--------------------------------+
|i11 : assert (factors#0 === FF2)|
+--------------------------------+
|i12 : assert (factors#1 === PP2)|
+--------------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * cartesianProduct(Sequence) -- make
    the Cartesian product of normal toric varieties
  * components(NormalToricVariety),
    -- list the factors in a product
  * NormalToricVariety ^** ZZ -- make the
    Cartesian power of a normal toric variety
  * normalToricVariety -- make a
    normal toric variety

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

  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1053:0.

NormalToricVariety ^ Array -- make a canonical projection map
*************************************************************

  * Operator: ^ (Macaulay2Doc),
  * Usage:
        X ^ A
  * Inputs:
      * X, a normal toric variety, that is a
        constructed as a product or blow-up
      * A, an array (Macaulay2Doc), whose entries index factors in
        the product construction of X or is empty if X is a blow-up
  * Outputs:
      * a toric map, that projects from X onto the product of
        the factors indexed by A or the normal toric variety that was blown-up

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

A product of varieties is equipped with canonical projection maps onto it
factors.  Given a product of normal toric varieties and a nonempty array, this
methods provides a concise way to make these toric maps.

The product of two normal toric varieties has projections onto each factor.

+----------------------------------+
|i1 : Y0 = toricProjectiveSpace 1; |
+----------------------------------+
|i2 : Y1 = hirzebruchSurface 3;    |
+----------------------------------+
|i3 : X = Y0 ** Y1;                |
+----------------------------------+
|i4 : X^[0]                        |
|                                  |
|o4 = | 1 0 0 |                    |
|                                  |
|o4 : ToricMap Y0 <--- X           |
+----------------------------------+
|i5 : assert isWellDefined X^[0]   |
+----------------------------------+
|i6 : assert (source X^[0] === X)  |
+----------------------------------+
|i7 : assert (target X^[0] === Y0) |
+----------------------------------+
|i8 : X^[1]                        |
|                                  |
|o8 = | 0 1 0 |                    |
|     | 0 0 1 |                    |
|                                  |
|o8 : ToricMap Y1 <--- X           |
+----------------------------------+
|i9 : assert isWellDefined X^[1]   |
+----------------------------------+
|i10 : assert (source X^[1] === X) |
+----------------------------------+
|i11 : assert (target X^[1] === Y1)|
+----------------------------------+

If A indexes all the factors, then we simply obtain the identity map on X.

+------------------------------+
|i12 : X^[0,1]                 |
|                              |
|o12 = | 1 0 0 |               |
|      | 0 1 0 |               |
|      | 0 0 1 |               |
|                              |
|o12 : ToricMap X <--- X       |
+------------------------------+
|i13 : assert (X^[0,1] == id_X)|
+------------------------------+

When there are more than two factors, we also obtain projections onto any
subset of the factors.

+-----------------------------------------------------------------------------+
|i14 : Z = Y0 ^** 3;                                                          |
+-----------------------------------------------------------------------------+
|i15 : Z^[0]                                                                  |
|                                                                             |
|o15 = | 1 0 0 |                                                              |
|                                                                             |
|o15 : ToricMap Y0 <--- Z                                                     |
+-----------------------------------------------------------------------------+
|i16 : Z^[1]                                                                  |
|                                                                             |
|o16 = | 0 1 0 |                                                              |
|                                                                             |
|o16 : ToricMap Y0 <--- Z                                                     |
+-----------------------------------------------------------------------------+
|i17 : Z^[2]                                                                  |
|                                                                             |
|o17 = | 0 0 1 |                                                              |
|                                                                             |
|o17 : ToricMap Y0 <--- Z                                                     |
+-----------------------------------------------------------------------------+
|i18 : assert all (3, i -> isWellDefined Z^[i] and source Z^[i] === Z and     |
|-----------------------------------------------------------------------------|
|target Z^[i] === Y0)                                                         |
+-----------------------------------------------------------------------------+
|i19 : Z^[0,1]                                                                |
|                                                                             |
|o19 = | 1 0 0 |                                                              |
|      | 0 1 0 |                                                              |
|                                                                             |
|o19 : ToricMap normalToricVariety ({{-1, 0}, {1, 0}, {0, -1}, {0, 1}}, {{0,  |
|-----------------------------------------------------------------------------|
|2}, {0, 3}, {1, 2}, {1, 3}}) <--- Z                                          |
+-----------------------------------------------------------------------------+
|i20 : Z^[0,2]                                                                |
|                                                                             |
|o20 = | 1 0 0 |                                                              |
|      | 0 0 1 |                                                              |
|                                                                             |
|o20 : ToricMap normalToricVariety ({{-1, 0}, {1, 0}, {0, -1}, {0, 1}}, {{0,  |
|-----------------------------------------------------------------------------|
|2}, {0, 3}, {1, 2}, {1, 3}}) <--- Z                                          |
+-----------------------------------------------------------------------------+
|i21 : Z^[1,2]                                                                |
|                                                                             |
|o21 = | 0 1 0 |                                                              |
|      | 0 0 1 |                                                              |
|                                                                             |
|o21 : ToricMap normalToricVariety ({{-1, 0}, {1, 0}, {0, -1}, {0, 1}}, {{0,  |
|-----------------------------------------------------------------------------|
|2}, {0, 3}, {1, 2}, {1, 3}}) <--- Z                                          |
+-----------------------------------------------------------------------------+
|i22 : assert (isWellDefined Z^[1,2] and target Z^[1,2] === Y0 ** Y0)         |
+-----------------------------------------------------------------------------+
|i23 : Z^[0,1,2]                                                              |
|                                                                             |
|o23 = | 1 0 0 |                                                              |
|      | 0 1 0 |                                                              |
|      | 0 0 1 |                                                              |
|                                                                             |
|o23 : ToricMap Z <--- Z                                                      |
+-----------------------------------------------------------------------------+
|i24 : assert (Z^[0,1,2] == id_Z)                                             |
+-----------------------------------------------------------------------------+

When the normal toric variety is not constructed as a product, this method only
reproduces the identity map.

+------------------------------+
|i25 : components Y1           |
|                              |
|o25 = {Y1}                    |
|                              |
|o25 : List                    |
+------------------------------+
|i26 : Y1^[0]                  |
|                              |
|o26 = | 1 0 |                 |
|      | 0 1 |                 |
|                              |
|o26 : ToricMap Y1 <--- Y1     |
+------------------------------+
|i27 : assert (Y1^[0] == id_Y1)|
+------------------------------+

When the normal toric variety X is a blow-up and the array A is empty, one
obtains the canonical projection.

+-----------------------------------------------------------------------------+
|i28 : A = affineSpace 2;                                                     |
+-----------------------------------------------------------------------------+
|i29 : B = toricBlowup({0,1}, A);                                             |
+-----------------------------------------------------------------------------+
|i30 : B^[]                                                                   |
|                                                                             |
|o30 = | 1 0 |                                                                |
|      | 0 1 |                                                                |
|                                                                             |
|o30 : ToricMap A <--- B                                                      |
+-----------------------------------------------------------------------------+
|i31 : assert (isWellDefined B^[] and source B^[] === B and target B^[] === A)|
+-----------------------------------------------------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * NormalToricVariety _ Array -- make a
    canonical inclusion into a product
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties
  * cartesianProduct(Sequence) -- make
    the Cartesian product of normal toric varieties
  * components (Macaulay2Doc) -- list the components of a
    direct sum
  * toricBlowup, --
    makes the toricBlowup of a normal toric variety along a torus orbit closure
  * Module ^ Array (Macaulay2Doc) -- projection onto
    summand

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

  * NormalToricVariety ^ Array -- make a
    canonical projection map
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:755:0.

NormalToricVariety ^** ZZ -- make the Cartesian power of a normal toric variety
*******************************************************************************

  * Operator: ^** (Macaulay2Doc),
  * Usage:
        X ^** i
  * Inputs:
      * X, a normal toric variety,
      * i, an integer (Macaulay2Doc), that is positive
  * Outputs:
      * a normal toric variety, the i-ary Cartesian
        product of X with itself

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

The $i$-ary Cartesian product of the variety $X$, defined over the ground field
$k$, is the $i$-ary fiber product of $X$ with itself over $k$.  For a normal
toric variety, the fan of the $i$-ary Cartesian product is given by the $i$-ary
Cartesian product of the cones.

+----------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;|
+----------------------------------+
|i2 : X = PP2 ^** 4;               |
+----------------------------------+
|i3 : fromWDivToCl X               |
|                                  |
|o3 = | 1 1 1 0 0 0 0 0 0 0 0 0 |  |
|     | 0 0 0 1 1 1 0 0 0 0 0 0 |  |
|     | 0 0 0 0 0 0 1 1 1 0 0 0 |  |
|     | 0 0 0 0 0 0 0 0 0 1 1 1 |  |
|                                  |
|              4       12          |
|o3 : Matrix ZZ  <-- ZZ            |
+----------------------------------+

The factors are cached and can be accessed with components (Macaulay2Doc).

+-------------------------------------------+
|i4 : factors = components X                |
|                                           |
|o4 = {PP2, PP2, PP2, PP2}                  |
|                                           |
|o4 : List                                  |
+-------------------------------------------+
|i5 : assert (# factors === 4)              |
+-------------------------------------------+
|i6 : assert all (4, i -> factors#i === PP2)|
+-------------------------------------------+
+-----------------------------------+
|i7 : FF2 = hirzebruchSurface (2);  |
+-----------------------------------+
|i8 : Y = FF2 ^** 3;                |
+-----------------------------------+
|i9 : fromWDivToCl Y                |
|                                   |
|o9 = | 1 -2 1 0 0 0  0 0 0 0  0 0 ||
|     | 0 1  0 1 0 0  0 0 0 0  0 0 ||
|     | 0 0  0 0 1 -2 1 0 0 0  0 0 ||
|     | 0 0  0 0 0 1  0 1 0 0  0 0 ||
|     | 0 0  0 0 0 0  0 0 1 -2 1 0 ||
|     | 0 0  0 0 0 0  0 0 0 1  0 1 ||
|                                   |
|              6       12           |
|o9 : Matrix ZZ  <-- ZZ             |
+-----------------------------------+
+---------------------------------------------------------+
|i10 : X' = PP2 ** PP2;                                   |
+---------------------------------------------------------+
|i11 : X'' = PP2 ^** 2;                                   |
+---------------------------------------------------------+
|i12 : assert (rays X' == rays X'' and  max X' == max X'')|
+---------------------------------------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties
  * components(NormalToricVariety),
    -- list the factors in a product
  * normalToricVariety -- make a
    normal toric variety

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

  * NormalToricVariety ^** ZZ -- make the
    Cartesian power of a normal toric variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1100:0.

NormalToricVariety _ Array -- make a canonical inclusion into a product
***********************************************************************

  * Operator: _ (Macaulay2Doc),
  * Usage:
        X _ A
  * Inputs:
      * X, a normal toric variety, that is a
        constructed as a product
      * A, an array (Macaulay2Doc), whose entries index factors in
        the product construction of X
  * Outputs:
      * a toric map, that is a canonical inclusion from the
        product of the factors indexed by A into the product X

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

A product of varieties is equipped with canonical inclusion maps from a product
of any subset of its factors.  Given a product of normal toric varieties and a
nonempty array, this methods provides a concise way to make these toric maps.

The product of two normal toric varieties has inclusions from each factor.

+-----------------------------------------------------------------------------+
|i1 : Y0 = toricProjectiveSpace 1;                                            |
+-----------------------------------------------------------------------------+
|i2 : Y1 = hirzebruchSurface 3;                                               |
+-----------------------------------------------------------------------------+
|i3 : X = Y0 ** Y1;                                                           |
+-----------------------------------------------------------------------------+
|i4 : X_[0]                                                                   |
|                                                                             |
|o4 = | 1 |                                                                   |
|     | 0 |                                                                   |
|     | 0 |                                                                   |
|                                                                             |
|o4 : ToricMap X <--- Y0                                                      |
+-----------------------------------------------------------------------------+
|i5 : assert (isWellDefined X_[0] and source X_[0] === Y0 and target X_[0] ===|
|-----------------------------------------------------------------------------|
|X)                                                                           |
+-----------------------------------------------------------------------------+
|i6 : X_[1]                                                                   |
|                                                                             |
|o6 = | 0 0 |                                                                 |
|     | 1 0 |                                                                 |
|     | 0 1 |                                                                 |
|                                                                             |
|o6 : ToricMap X <--- Y1                                                      |
+-----------------------------------------------------------------------------+
|i7 : assert (isWellDefined X_[1] and source X_[1] === Y1 and target X_[1] ===|
|-----------------------------------------------------------------------------|
|X)                                                                           |
+-----------------------------------------------------------------------------+

The canonical inclusions interact with the canonical projections,
in the expected way.

+-----------------------------------------------------------------------------+
|i8 : assert (X^[0] * X_[0] == id_Y0 and X^[1] * X_[1] == id_Y1)              |
+-----------------------------------------------------------------------------+
|i9 : assert (X^[1] * X_[0] == map(Y1, Y0, 0) and X^[0] * X_[1] == map(Y0, Y1,|
|-----------------------------------------------------------------------------|
|0))                                                                          |
+-----------------------------------------------------------------------------+

If A indexes all the factors, then we simply obtain the identity map on X.

+------------------------------+
|i10 : X_[0,1]                 |
|                              |
|o10 = | 1 0 0 |               |
|      | 0 1 0 |               |
|      | 0 0 1 |               |
|                              |
|o10 : ToricMap X <--- X       |
+------------------------------+
|i11 : assert (X_[0,1] == id_X)|
+------------------------------+

When there are more than two factors, we also obtain inclusions from any subset
of the factors.

+-----------------------------------------------------------------------------+
|i12 : Z = Y0 ^** 3;                                                          |
+-----------------------------------------------------------------------------+
|i13 : Z_[0]                                                                  |
|                                                                             |
|o13 = | 1 |                                                                  |
|      | 0 |                                                                  |
|      | 0 |                                                                  |
|                                                                             |
|o13 : ToricMap Z <--- Y0                                                     |
+-----------------------------------------------------------------------------+
|i14 : Z_[1]                                                                  |
|                                                                             |
|o14 = | 0 |                                                                  |
|      | 1 |                                                                  |
|      | 0 |                                                                  |
|                                                                             |
|o14 : ToricMap Z <--- Y0                                                     |
+-----------------------------------------------------------------------------+
|i15 : Z_[2]                                                                  |
|                                                                             |
|o15 = | 0 |                                                                  |
|      | 0 |                                                                  |
|      | 1 |                                                                  |
|                                                                             |
|o15 : ToricMap Z <--- Y0                                                     |
+-----------------------------------------------------------------------------+
|i16 : assert all (3, i -> isWellDefined Z_[i] and source Z_[i] === Y0 and    |
|-----------------------------------------------------------------------------|
|target Z_[i] === Z)                                                          |
+-----------------------------------------------------------------------------+
|i17 : Z_[0,1]                                                                |
|                                                                             |
|o17 = | 1 0 |                                                                |
|      | 0 1 |                                                                |
|      | 0 0 |                                                                |
|                                                                             |
|o17 : ToricMap Z <--- normalToricVariety ({{-1, 0}, {1, 0}, {0, -1}, {0, 1}},|
|-----------------------------------------------------------------------------|
|{{0, 2}, {0, 3}, {1, 2}, {1, 3}})                                            |
+-----------------------------------------------------------------------------+
|i18 : Z_[0,2]                                                                |
|                                                                             |
|o18 = | 1 0 |                                                                |
|      | 0 0 |                                                                |
|      | 0 1 |                                                                |
|                                                                             |
|o18 : ToricMap Z <--- normalToricVariety ({{-1, 0}, {1, 0}, {0, -1}, {0, 1}},|
|-----------------------------------------------------------------------------|
|{{0, 2}, {0, 3}, {1, 2}, {1, 3}})                                            |
+-----------------------------------------------------------------------------+
|i19 : Z_[1,2]                                                                |
|                                                                             |
|o19 = | 0 0 |                                                                |
|      | 1 0 |                                                                |
|      | 0 1 |                                                                |
|                                                                             |
|o19 : ToricMap Z <--- normalToricVariety ({{-1, 0}, {1, 0}, {0, -1}, {0, 1}},|
|-----------------------------------------------------------------------------|
|{{0, 2}, {0, 3}, {1, 2}, {1, 3}})                                            |
+-----------------------------------------------------------------------------+
|i20 : assert (isWellDefined Z_[1,2] and source Z_[1,2] === Y0 ** Y0)         |
+-----------------------------------------------------------------------------+
|i21 : Z_[0,1,2]                                                              |
|                                                                             |
|o21 = | 1 0 0 |                                                              |
|      | 0 1 0 |                                                              |
|      | 0 0 1 |                                                              |
|                                                                             |
|o21 : ToricMap Z <--- Z                                                      |
+-----------------------------------------------------------------------------+
|i22 : assert (Z_[0,1,2] == id_Z)                                             |
+-----------------------------------------------------------------------------+

When the normal toric variety is not constructed as a product, this method only
reproduces the identity map.

+------------------------------+
|i23 : components Y1           |
|                              |
|o23 = {Y1}                    |
|                              |
|o23 : List                    |
+------------------------------+
|i24 : Y1_[0]                  |
|                              |
|o24 = | 1 0 |                 |
|      | 0 1 |                 |
|                              |
|o24 : ToricMap Y1 <--- Y1     |
+------------------------------+
|i25 : assert (Y1_[0] == id_Y1)|
+------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * NormalToricVariety _ Array -- make a
    canonical inclusion into a product
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties
  * cartesianProduct(Sequence) -- make
    the Cartesian product of normal toric varieties
  * components (Macaulay2Doc) -- list the components of a
    direct sum
  * Module ^ Array (Macaulay2Doc) -- projection onto
    summand

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

  * NormalToricVariety _ Array -- make a
    canonical inclusion into a product
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:833:0.

NormalToricVariety _ ZZ -- make an irreducible torus-invariant divisor
**********************************************************************

  * Operator: _ (Macaulay2Doc),
  * Usage:
        X_i
  * Inputs:
      * X, a normal toric variety,
      * i, an integer (Macaulay2Doc), indexing a ray in the fan
        associated to X
  * Outputs:
      * a toric divisor, namely the irreducible
        torus-invariant divisor associated to the i-th ray in the fan of X

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

The irreducible torus-invariant divisors on a normal toric variety correspond
to the rays in the associated fan.  In this package, the rays are ordered and
indexed by the nonnegative integers. Given a normal toric variety and
nonnegative integer, this method returns the corresponding irreducible
torus-invariant divisor. The most convenient way to make a general
torus-invariant Weil divisor is to simply write the appropriate linear
combination of these torus-invariant Weil divisors.

There are three irreducible torus-invariant divisors on the projective plane.

+----------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                        |
+----------------------------------------------------------+
|i2 : PP2_0                                                |
|                                                          |
|o2 = PP2                                                  |
|        0                                                 |
|                                                          |
|o2 : ToricDivisor on PP2                                  |
+----------------------------------------------------------+
|i3 : PP2_1                                                |
|                                                          |
|o3 = PP2                                                  |
|        1                                                 |
|                                                          |
|o3 : ToricDivisor on PP2                                  |
+----------------------------------------------------------+
|i4 : PP2_2                                                |
|                                                          |
|o4 = PP2                                                  |
|        2                                                 |
|                                                          |
|o4 : ToricDivisor on PP2                                  |
+----------------------------------------------------------+
|i5 : assert (- PP2_0 - PP2_1 - PP2_2 === toricDivisor PP2)|
+----------------------------------------------------------+

A torus-invariant Weil divisor is irreducible if and only if its support has a
single element.

+-----------------------------------------------------+
|i6 : X = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));|
+-----------------------------------------------------+
|i7 : X_0                                             |
|                                                     |
|o7 = X                                               |
|      0                                              |
|                                                     |
|o7 : ToricDivisor on X                               |
+-----------------------------------------------------+
|i8 : support X_0                                     |
|                                                     |
|o8 = {0}                                             |
|                                                     |
|o8 : List                                            |
+-----------------------------------------------------+
|i9 : assert( # support X_0 === 1)                    |
+-----------------------------------------------------+
|i10 : K = toricDivisor X                             |
|                                                     |
|o10 = - X  - X  - X  - X  - X  - X  - X  - X         |
|         0    1    2    3    4    5    6    7        |
|                                                     |
|o10 : ToricDivisor on X                              |
+-----------------------------------------------------+
|i11 : support K                                      |
|                                                     |
|o11 = {0, 1, 2, 3, 4, 5, 6, 7}                       |
|                                                     |
|o11 : List                                           |
+-----------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * support(ToricDivisor) -- make the list of
    irreducible divisors with nonzero coefficients
  * variety(ToricDivisor) -- get the
    underlying normal toric variety

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

  * NormalToricVariety _ ZZ -- make an
    irreducible torus-invariant divisor
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1268:0.

normalToricVariety(Fan) -- make a normal toric variety from a 'Polyhedra' fan
*****************************************************************************

  * Function: normalToricVariety,
  * Usage:
        normalToricVariety F
  * Inputs:
      * F, an instance of the type Fan (Polyhedra),
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing, => a
        ring (Macaulay2Doc), default value QQ, that determines the
        coefficient ring of the total coordinate ring,
      * MinimalGenerators, => a
        Boolean value (Macaulay2Doc), default value false, unused
      * Variable, => a symbol (Macaulay2Doc),
        default value x, that specifies the base name (Macaulay2Doc),
        for the indexed variables in the total
        coordinate ring
      * WeilToClass, => a
        matrix (Macaulay2Doc), default value null, that specifies the
        map from the group of torus-invariant Weil divisors to the class group
  * Outputs:
      * a normal toric variety, determined by the
        rational strongly convex polyhedral fan

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

This method makes a NormalToricVariety, from a
Fan (Polyhedra), as implemented in the Polyhedra,
package.

+-----------------------------------------------------------------------------+
|i1 : F = faceFan convexHull (id_(ZZ^3) | -id_(ZZ^3))                         |
|                                                                             |
|o1 = F                                                                       |
|                                                                             |
|o1 : Fan                                                                     |
+-----------------------------------------------------------------------------+
|i2 : rays F                                                                  |
|                                                                             |
|o2 = | -1 1 0  0 0  0 |                                                      |
|     | 0  0 -1 1 0  0 |                                                      |
|     | 0  0 0  0 -1 1 |                                                      |
|                                                                             |
|              3       6                                                      |
|o2 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i3 : maxCones F                                                              |
|                                                                             |
|o3 = {{0, 2, 4}, {1, 2, 4}, {0, 3, 4}, {1, 3, 4}, {0, 2, 5}, {1, 2, 5}, {0,  |
|     ------------------------------------------------------------------------|
|     3, 5}, {1, 3, 5}}                                                       |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : X = normalToricVariety F;                                               |
+-----------------------------------------------------------------------------+
|i5 : assert (transpose matrix rays X == rays F and max X == sort maxCones F) |
+-----------------------------------------------------------------------------+

The recommended method for creating a NormalToricVariety,
from a fan is normalToricVariety(List,List).
In fact, this package avoids using
objects from the Polyhedra, package whenever possible.
Here is a trivial example, namely projective 2-space, illustrating the
substantial increase in time resulting from the use of a Polyhedra,
fan.

+-----------------------------------------------------------------------------+
|i6 : X1 = time normalToricVariety ({{-1,-1},{1,0},{0,1}},                    |
| -- used 2.8953e-05s (cpu); 2.4947e-05s (thread); 0s (gc)                    |
|                                                                             |
|o6 = X1                                                                      |
|                                                                             |
|o6 : NormalToricVariety                                                      |
|-----------------------------------------------------------------------------|
|{{0,1},{1,2},{0,2}})                                                         |
+-----------------------------------------------------------------------------+
|i7 : X2 = time normalToricVariety fan {posHull matrix {{-1,1},{-1,0}},       |
| -- used 0.0524004s (cpu); 0.0524041s (thread); 0s (gc)                      |
|-----------------------------------------------------------------------------|
|posHull matrix {{1,0},{0,1}}, posHull matrix{{-1,0},{-1,1}}};                |
+-----------------------------------------------------------------------------+
|i8 : assert (sort rays X1 == sort rays X2 and max X1 == max X2)              |
+-----------------------------------------------------------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * normalToricVariety -- make a
    normal toric variety

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

  * normalToricVariety(Fan) -- make a
    normal toric variety from a 'Polyhedra' fan
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1235:0.

normalToricVariety(List,List) -- make a normal toric variety
************************************************************

  * Function: normalToricVariety,
  * Usage:
        normalToricVariety (rayList, coneList)
  * Inputs:
      * rayList, a list (Macaulay2Doc), of lists of integers; each
        entry is the minimal nonzero lattice point on a ray in the fan
      * coneList, a list (Macaulay2Doc), of lists of nonnegative
        integers; each entry indexes the rays defining a maximal cone in the
        fan
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        that determines the coefficient ring of the total coordinate ring,
      * MinimalGenerators, => a
        Boolean value (Macaulay2Doc), default value false, unused
      * Variable => a symbol (Macaulay2Doc), default value x,
        that specifies the base name (Macaulay2Doc), for the
        indexed variables in the total coordinate ring
      * WeilToClass => a matrix (Macaulay2Doc), default value
        null, that specifies the map from the group of torus-invariant Weil
        divisors to the class group
  * Outputs:
      * a normal toric variety, the normal toric
        variety determined by the fan

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

This is the main method for constructing a normal toric variety.  Almost all
other constructors invoke it.

A normal toric variety corresponds to a strongly convex rational polyhedral fan
in affine space.  In this package, the fan associated to a normal
$d$-dimensional toric variety lies in the rational vector space $\QQ^d$ with
underlying lattice $N = \ZZ^d$. The fan is encoded by the minimal nonzero
lattice points on its rays and the set of rays defining the maximal cones
(meaning cones that are not proper subsets of another cone in the fan).  More
precisely, rayList lists the minimal nonzero lattice points on each ray (a.k.a.
one-dimensional cone) in the fan. Each lattice point is a list (Macaulay2Doc),
of integers (Macaulay2Doc). The rays are ordered
and indexed by nonnegative integers: $0,1,\dots,n$. Using this indexing, a
maximal cone in the fan corresponds to a sublist of $\{0,1,\dots,n\}$.  All
maximal cones are listed in coneList.  More information explaining the
correspondence between normal toric varieties and strongly convex rational
polyhedral fans appears in Subsection 3.1 of Cox-Little-Schenck.

The first example is projective plane blown up at two points.

+---------------------------------------------------------------+
|i1 : rayList = {{1,0},{0,1},{-1,1},{-1,0},{0,-1}}              |
|                                                               |
|o1 = {{1, 0}, {0, 1}, {-1, 1}, {-1, 0}, {0, -1}}               |
|                                                               |
|o1 : List                                                      |
+---------------------------------------------------------------+
|i2 : coneList = {{0,1},{1,2},{2,3},{3,4},{0,4}}                |
|                                                               |
|o2 = {{0, 1}, {1, 2}, {2, 3}, {3, 4}, {0, 4}}                  |
|                                                               |
|o2 : List                                                      |
+---------------------------------------------------------------+
|i3 : X = normalToricVariety (rayList, coneList)                |
|                                                               |
|o3 = X                                                         |
|                                                               |
|o3 : NormalToricVariety                                        |
+---------------------------------------------------------------+
|i4 : rays X                                                    |
|                                                               |
|o4 = {{1, 0}, {0, 1}, {-1, 1}, {-1, 0}, {0, -1}}               |
|                                                               |
|o4 : List                                                      |
+---------------------------------------------------------------+
|i5 : max X                                                     |
|                                                               |
|o5 = {{0, 1}, {0, 4}, {1, 2}, {2, 3}, {3, 4}}                  |
|                                                               |
|o5 : List                                                      |
+---------------------------------------------------------------+
|i6 : dim X                                                     |
|                                                               |
|o6 = 2                                                         |
+---------------------------------------------------------------+
|i7 : assert (isWellDefined X and isProjective X and isSmooth X)|
+---------------------------------------------------------------+

The second example illustrates the data defining projective $4$-space.

+-----------------------------------------------------------------------------+
|i8 : PP4 = toricProjectiveSpace 4;                                           |
+-----------------------------------------------------------------------------+
|i9 : rays PP4                                                                |
|                                                                             |
|o9 = {{-1, -1, -1, -1}, {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0,  |
|     ------------------------------------------------------------------------|
|     1}}                                                                     |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+
|i10 : max PP4                                                                |
|                                                                             |
|o10 = {{0, 1, 2, 3}, {0, 1, 2, 4}, {0, 1, 3, 4}, {0, 2, 3, 4}, {1, 2, 3, 4}} |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+
|i11 : dim PP4                                                                |
|                                                                             |
|o11 = 4                                                                      |
+-----------------------------------------------------------------------------+
|i12 : ring PP4                                                               |
|                                                                             |
|o12 = QQ[x ..x ]                                                             |
|          0   4                                                              |
|                                                                             |
|o12 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i13 : PP4' = normalToricVariety (rays PP4, max PP4, CoefficientRing =>       |
|                                                                             |
|o13 = PP4'                                                                   |
|                                                                             |
|o13 : NormalToricVariety                                                     |
|-----------------------------------------------------------------------------|
|ZZ/32003, Variable => y)                                                     |
+-----------------------------------------------------------------------------+
|i14 : ring PP4'                                                              |
|                                                                             |
|        ZZ                                                                   |
|o14 = -----[y ..y ]                                                          |
|      32003  0   4                                                           |
|                                                                             |
|o14 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i15 : assert (isWellDefined PP4 and isProjective PP4 and isSmooth PP4)       |
+-----------------------------------------------------------------------------+

The optional argument WeilToClass allows one to specify the map from the
group of torus-invariant Weil divisors,
to the class group.
In particular, this allows the user to
choose her favourite basis for the class group.  This map also determines the
grading on the total coordinate ring, of
the normal toric variety.  For example, we can choose the opposite generator
for the class group of projective space as follows.

+---------------------------------------------------------------------+
|i16 : PP2 = toricProjectiveSpace 2;                                  |
+---------------------------------------------------------------------+
|i17 : A = fromWDivToCl PP2                                           |
|                                                                     |
|o17 = | 1 1 1 |                                                      |
|                                                                     |
|               1       3                                             |
|o17 : Matrix ZZ  <-- ZZ                                              |
+---------------------------------------------------------------------+
|i18 : source A == weilDivisorGroup PP2                               |
|                                                                     |
|o18 = true                                                           |
+---------------------------------------------------------------------+
|i19 : target A == classGroup PP2                                     |
|                                                                     |
|o19 = true                                                           |
+---------------------------------------------------------------------+
|i20 : degrees ring PP2                                               |
|                                                                     |
|o20 = {{1}, {1}, {1}}                                                |
|                                                                     |
|o20 : List                                                           |
+---------------------------------------------------------------------+
|i21 : deg = matrix {toList (3:-1)}                                   |
|                                                                     |
|o21 = | -1 -1 -1 |                                                   |
|                                                                     |
|               1       3                                             |
|o21 : Matrix ZZ  <-- ZZ                                              |
+---------------------------------------------------------------------+
|i22 : X = normalToricVariety (rays PP2, max PP2, WeilToClass => deg);|
+---------------------------------------------------------------------+
|i23 : A' = fromWDivToCl X                                            |
|                                                                     |
|o23 = | -1 -1 -1 |                                                   |
|                                                                     |
|               1       3                                             |
|o23 : Matrix ZZ  <-- ZZ                                              |
+---------------------------------------------------------------------+
|i24 : source A' == weilDivisorGroup X                                |
|                                                                     |
|o24 = true                                                           |
+---------------------------------------------------------------------+
|i25 : target A' == classGroup X                                      |
|                                                                     |
|o25 = true                                                           |
+---------------------------------------------------------------------+
|i26 : degrees ring X                                                 |
|                                                                     |
|o26 = {{-1}, {-1}, {-1}}                                             |
|                                                                     |
|o26 : List                                                           |
+---------------------------------------------------------------------+
|i27 : (matrix A') * (matrix rays X)                                  |
|                                                                     |
|o27 = 0                                                              |
|                                                                     |
|               1       2                                             |
|o27 : Matrix ZZ  <-- ZZ                                              |
+---------------------------------------------------------------------+
|i28 : assert (isWellDefined X and isProjective X and isSmooth X)     |
+---------------------------------------------------------------------+

The integer matrix A should span the kernel of the matrix whose columns are the
minimal nonzero lattice points on the rays of the fan.

We can also choose a basis for the class group of a blow-up of the projective
plane such that the nef cone is the positive quadrant.

+------------------------------------------------------------------+
|i29 : rayList = {{1,0},{0,1},{-1,1},{-1,0},{0,-1}};               |
+------------------------------------------------------------------+
|i30 : coneList = {{0,1},{1,2},{2,3},{3,4},{0,4}};                 |
+------------------------------------------------------------------+
|i31 : Y = normalToricVariety (rayList, coneList);                 |
+------------------------------------------------------------------+
|i32 : fromWDivToCl Y                                              |
|                                                                  |
|o32 = | 1 -1 1 0 0 |                                              |
|      | 1 0  0 1 0 |                                              |
|      | 0 1  0 0 1 |                                              |
|                                                                  |
|               3       5                                          |
|o32 : Matrix ZZ  <-- ZZ                                           |
+------------------------------------------------------------------+
|i33 : nefGenerators Y                                             |
|                                                                  |
|o33 = | 1 0 0 |                                                   |
|      | 1 0 1 |                                                   |
|      | 0 1 1 |                                                   |
|                                                                  |
|               3       3                                          |
|o33 : Matrix ZZ  <-- ZZ                                           |
+------------------------------------------------------------------+
|i34 : deg = matrix{{1,-1,1,0,0},{0,1,-1,1,0},{0,0,1,-1,1}}        |
|                                                                  |
|o34 = | 1 -1 1  0  0 |                                            |
|      | 0 1  -1 1  0 |                                            |
|      | 0 0  1  -1 1 |                                            |
|                                                                  |
|               3       5                                          |
|o34 : Matrix ZZ  <-- ZZ                                           |
+------------------------------------------------------------------+
|i35 : Y' = normalToricVariety (rays Y, max Y, WeilToClass => deg);|
+------------------------------------------------------------------+
|i36 : fromWDivToCl Y'                                             |
|                                                                  |
|o36 = | 1 -1 1  0  0 |                                            |
|      | 0 1  -1 1  0 |                                            |
|      | 0 0  1  -1 1 |                                            |
|                                                                  |
|               3       5                                          |
|o36 : Matrix ZZ  <-- ZZ                                           |
+------------------------------------------------------------------+
|i37 : nefGenerators Y'                                            |
|                                                                  |
|o37 = | 1 0 0 |                                                   |
|      | 0 1 0 |                                                   |
|      | 0 0 1 |                                                   |
|                                                                  |
|               3       3                                          |
|o37 : Matrix ZZ  <-- ZZ                                           |
+------------------------------------------------------------------+
|i38 : assert (isWellDefined Y and isWellDefined Y')               |
+------------------------------------------------------------------+

Caveat
======

This method assumes that the lists rayList and coneList correctly encode a
strongly convex rational polyhedral fan.  One can verify this by using
isWellDefined(NormalToricVariety).

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan
  * isWellDefined(NormalToricVariety)
    -- whether a toric variety is
    well-defined

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

  * normalToricVariety(List,List),
    -- make a normal toric variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:340:0.

normalToricVariety(Matrix) -- make a normal toric variety from a polytope
*************************************************************************

  * Function: normalToricVariety,
  * Usage:
        normalToricVariety VertMat
  * Inputs:
      * VertMat, a matrix (Macaulay2Doc), of integers; each
        column is the lattice vertex of the polytope
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing, => a
        ring (Macaulay2Doc), default value QQ, that specifies the
        coefficient ring of the total coordinate ring,
      * MinimalGenerators => a Boolean value (Macaulay2Doc),
        default value false, that specifies whether to compute minimal
        generators
      * Variable, => a symbol (Macaulay2Doc),
        default value x, that specifies the base name (Macaulay2Doc),
        for the indexed variables in the total
        coordinate ring
      * WeilToClass, => a
        matrix (Macaulay2Doc), default value null, that specifies the
        map from the group of torus-invariant Weil divisors to the class group
  * Outputs:
      * a normal toric variety, the normal toric
        variety determined by the polytope

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

This method makes a normal toric variety, from the
polytope with vertices corresponding to the columns of the matrix VertMat.  In
particular, the associated fan is the INNER normal fan of the polytope.

The first example shows how projective plane is obtained from a triangle.

+-------------------------------------------------------+
|i1 : PP2 = normalToricVariety matrix {{0,1,0},{0,0,1}};|
+-------------------------------------------------------+
|i2 : rays PP2                                          |
|                                                       |
|o2 = {{1, 0}, {0, 1}, {-1, -1}}                        |
|                                                       |
|o2 : List                                              |
+-------------------------------------------------------+
|i3 : max PP2                                           |
|                                                       |
|o3 = {{0, 1}, {0, 2}, {1, 2}}                          |
|                                                       |
|o3 : List                                              |
+-------------------------------------------------------+
|i4 : PP2' = toricProjectiveSpace 2;                    |
+-------------------------------------------------------+
|i5 : set rays PP2 === set rays PP2'                    |
|                                                       |
|o5 = true                                              |
+-------------------------------------------------------+
|i6 : max PP2 === max PP2'                              |
|                                                       |
|o6 = true                                              |
+-------------------------------------------------------+
|i7 : assert (isWellDefined PP2 and isWellDefined PP2') |
+-------------------------------------------------------+

The second example makes the toric variety associated to the hypercube in
$3$-space.

+-----------------------------------------------------------------------------+
|i8 : X = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));                        |
+-----------------------------------------------------------------------------+
|i9 : transpose matrix rays X                                                 |
|                                                                             |
|o9 = | 1 -1 1  -1 1  -1 1  -1 |                                              |
|     | 1 1  -1 -1 1  1  -1 -1 |                                              |
|     | 1 1  1  1  -1 -1 -1 -1 |                                              |
|                                                                             |
|              3       8                                                      |
|o9 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i10 : max X                                                                  |
|                                                                             |
|o10 = {{0, 1, 2, 3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, {2, 3, 6, 7}, |
|      -----------------------------------------------------------------------|
|      {4, 5, 6, 7}}                                                          |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+
|i11 : assert (isWellDefined X and not isSimplicial X)                        |
+-----------------------------------------------------------------------------+

The optional argument MinimalGenerators specifics whether to compute the
vertices of the polytope defined as the convex hull of the columns of the
matrix VertMat.

+----------------------------------------------------------------------+
|i12 : FF1 = normalToricVariety matrix {{0,1,0,2},{0,0,1,1}};          |
+----------------------------------------------------------------------+
|i13 : assert isWellDefined FF1                                        |
+----------------------------------------------------------------------+
|i14 : rays FF1                                                        |
|                                                                      |
|o14 = {{1, 0}, {0, 1}, {-1, 1}, {0, -1}}                              |
|                                                                      |
|o14 : List                                                            |
+----------------------------------------------------------------------+
|i15 : max FF1                                                         |
|                                                                      |
|o15 = {{0, 1}, {0, 3}, {1, 2}, {2, 3}}                                |
|                                                                      |
|o15 : List                                                            |
+----------------------------------------------------------------------+
|i16 : FF1' = hirzebruchSurface 1;                                     |
+----------------------------------------------------------------------+
|i17 : assert (rays FF1 === rays FF1' and max FF1 === max FF1')        |
+----------------------------------------------------------------------+
|i18 : VertMat = matrix {{0,0,1,1,2},{0,1,0,1,1}}                      |
|                                                                      |
|o18 = | 0 0 1 1 2 |                                                   |
|      | 0 1 0 1 1 |                                                   |
|                                                                      |
|               2       5                                              |
|o18 : Matrix ZZ  <-- ZZ                                               |
+----------------------------------------------------------------------+
|i19 : notFF1 = normalToricVariety VertMat;                            |
+----------------------------------------------------------------------+
|i20 : max notFF1                                                      |
|                                                                      |
|o20 = {{0, 1}, {0, 3}, {1, 2}, {2, 3}, {3}}                           |
|                                                                      |
|o20 : List                                                            |
+----------------------------------------------------------------------+
|i21 : isWellDefined notFF1                                            |
|                                                                      |
|o21 = false                                                           |
+----------------------------------------------------------------------+
|i22 : FF1'' = normalToricVariety (VertMat, MinimalGenerators => true);|
+----------------------------------------------------------------------+
|i23 : assert (rays FF1'' == rays FF1 and max FF1'' == max FF1)        |
+----------------------------------------------------------------------+
|i24 : assert isWellDefined FF1''                                      |
+----------------------------------------------------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan
  * isWellDefined(NormalToricVariety)
    -- whether a toric variety is
    well-defined
  * vertices(ToricDivisor) -- compute the
    vertices of the associated polytope
  * latticePoints(ToricDivisor), --
    compute the lattice points in the associated polytope

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

  * normalToricVariety(Matrix) -- make a
    normal toric variety from a polytope
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:418:0.

normalToricVariety(Polyhedron) -- make a normal toric variety from a 'Polyhedra' polyhedron
*******************************************************************************************

  * Function: normalToricVariety,
  * Usage:
        normalToricVariety P
  * Inputs:
      * P, a convex polyhedron (Polyhedra), whose vertices
        are lattice points
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing, => a
        ring (Macaulay2Doc), default value QQ, that determines the
        coefficient ring of the total coordinate ring,
      * MinimalGenerators, => a
        Boolean value (Macaulay2Doc), default value false, unused
      * Variable, => a symbol (Macaulay2Doc),
        default value x, that specifies the base name (Macaulay2Doc),
        for the indexed variables in the total
        coordinate ring
      * WeilToClass, => a
        matrix (Macaulay2Doc), default value null, that specifies the
        map from the group of torus-invariant Weil divisors to the class group
  * Outputs:
      * a normal toric variety, determined by the
        lattice polytope

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

This method makes a NormalToricVariety, from a
Polyhedron (Polyhedra), as implemented in the Polyhedra,
package.  In particular, the associated fan is inner normal fan
to the polyhedron.

+-----------------------------------------------------------------------------+
|i1 : P = convexHull (id_(ZZ^3) | -id_(ZZ^3));                                |
+-----------------------------------------------------------------------------+
|i2 : fVector P                                                               |
|                                                                             |
|o2 = {6, 12, 8, 1}                                                           |
|                                                                             |
|o2 : List                                                                    |
+-----------------------------------------------------------------------------+
|i3 : vertices P                                                              |
|                                                                             |
|o3 = | -1 1 0  0 0  0 |                                                      |
|     | 0  0 -1 1 0  0 |                                                      |
|     | 0  0 0  0 -1 1 |                                                      |
|                                                                             |
|              3       6                                                      |
|o3 : Matrix QQ  <-- QQ                                                       |
+-----------------------------------------------------------------------------+
|i4 : X = normalToricVariety P;                                               |
+-----------------------------------------------------------------------------+
|i5 : rays X                                                                  |
|                                                                             |
|o5 = {{-1, -1, -1}, {1, -1, -1}, {-1, 1, -1}, {1, 1, -1}, {-1, -1, 1}, {1,   |
|     ------------------------------------------------------------------------|
|     -1, 1}, {-1, 1, 1}, {1, 1, 1}}                                          |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : max X                                                                   |
|                                                                             |
|o6 = {{0, 1, 2, 3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, {2, 3, 6, 7},  |
|     ------------------------------------------------------------------------|
|     {4, 5, 6, 7}}                                                           |
|                                                                             |
|o6 : List                                                                    |
+-----------------------------------------------------------------------------+
|i7 : picardGroup X                                                           |
|                                                                             |
|       1                                                                     |
|o7 = ZZ                                                                      |
|                                                                             |
|o7 : ZZ-module, free                                                         |
+-----------------------------------------------------------------------------+

When the polyhedron is not full-dimensional, restricting to the smallest linear
subspace that contains the polyhedron guarantees that normal fan is strongly
convex.

+-----------------------------------------------------------------------------+
|i8 : P = convexHull transpose matrix unique permutations {1,1,0,0};          |
+-----------------------------------------------------------------------------+
|i9 : assert not isFullDimensional P                                          |
+-----------------------------------------------------------------------------+
|i10 : fVector P                                                              |
|                                                                             |
|o10 = {6, 12, 8, 1}                                                          |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+
|i11 : X = normalToricVariety P;                                              |
+-----------------------------------------------------------------------------+
|i12 : assert (dim P === dim X)                                               |
+-----------------------------------------------------------------------------+
|i13 : rays X                                                                 |
|                                                                             |
|o13 = {{-1, 0, 0}, {1, 0, 0}, {0, -1, 0}, {0, 1, 0}, {0, 0, -1}, {-1, -1,    |
|      -----------------------------------------------------------------------|
|      -1}, {0, 0, 1}, {1, 1, 1}}                                             |
|                                                                             |
|o13 : List                                                                   |
+-----------------------------------------------------------------------------+
|i14 : max X                                                                  |
|                                                                             |
|o14 = {{0, 2, 5, 6}, {0, 3, 4, 5}, {0, 3, 6, 7}, {1, 2, 4, 5}, {1, 2, 6, 7}, |
|      -----------------------------------------------------------------------|
|      {1, 3, 4, 7}}                                                          |
|                                                                             |
|o14 : List                                                                   |
+-----------------------------------------------------------------------------+
|i15 : assert (8 === #rays X)                                                 |
+-----------------------------------------------------------------------------+
|i16 : assert (6 === #max X)                                                  |
+-----------------------------------------------------------------------------+
|i17 : picardGroup X                                                          |
|                                                                             |
|        1                                                                    |
|o17 = ZZ                                                                     |
|                                                                             |
|o17 : ZZ-module, free                                                        |
+-----------------------------------------------------------------------------+

The recommended method for creating a NormalToricVariety,
from a polytope is normalToricVariety(Matrix).
In fact, this package avoids using objects
from the Polyhedra, whenever possible.  Here is a trivial
example, namely projective 2-space, illustrating the increase in time resulting
from the use of a Polyhedra, polyhedron.

+----------------------------------------------------------------+
|i18 : vertMatrix = matrix {{0,1,0},{0,0,1}}                     |
|                                                                |
|o18 = | 0 1 0 |                                                 |
|      | 0 0 1 |                                                 |
|                                                                |
|               2       3                                        |
|o18 : Matrix ZZ  <-- ZZ                                         |
+----------------------------------------------------------------+
|i19 : X1 = time normalToricVariety convexHull (vertMatrix);     |
| -- used 0.0293346s (cpu); 0.0293341s (thread); 0s (gc)         |
+----------------------------------------------------------------+
|i20 : X2 = time normalToricVariety vertMatrix;                  |
| -- used 0.0032978s (cpu); 0.0033014s (thread); 0s (gc)         |
+----------------------------------------------------------------+
|i21 : assert (set rays X2 === set rays X1 and max X1 === max X2)|
+----------------------------------------------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * normalToricVariety(Matrix) -- make a
    normal toric variety from a polytope

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

  * normalToricVariety(Polyhedron),
    -- make a normal toric variety from a 'Polyhedra' polyhedron
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1306:0.

normalToricVariety(Ring) -- get the associated normal toric variety
*******************************************************************

  * Function: normalToricVariety,
  * Usage:
        normalToricVariety S
  * Inputs:
      * S, a ring (Macaulay2Doc),
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing, => a
        ring (Macaulay2Doc), default value QQ, not used
      * MinimalGenerators, => a
        Boolean value (Macaulay2Doc), default value false, not used
      * Variable, => a symbol (Macaulay2Doc),
        default value x, not used
      * WeilToClass, => a
        matrix (Macaulay2Doc), default value null, not used
  * Outputs:
      * a normal toric variety,

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

If a polynomial ring is constructed as the total coordinate ring,
of normal toric variety, then this method returns
the associated variety.

+------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;        |
+------------------------------------------+
|i2 : S = ring PP3                         |
|                                          |
|o2 = S                                    |
|                                          |
|o2 : PolynomialRing                       |
+------------------------------------------+
|i3 : gens S                               |
|                                          |
|o3 = {x , x , x , x }                     |
|       0   1   2   3                      |
|                                          |
|o3 : List                                 |
+------------------------------------------+
|i4 : degrees S                            |
|                                          |
|o4 = {{1}, {1}, {1}, {1}}                 |
|                                          |
|o4 : List                                 |
+------------------------------------------+
|i5 : normalToricVariety S                 |
|                                          |
|o5 = PP3                                  |
|                                          |
|o5 : NormalToricVariety                   |
+------------------------------------------+
|i6 : assert (PP3 === normalToricVariety S)|
+------------------------------------------+
|i7 : variety S                            |
|                                          |
|o7 = PP3                                  |
|                                          |
|o7 : NormalToricVariety                   |
+------------------------------------------+
|i8 : assert (PP3 === variety S)           |
+------------------------------------------+

If the polynomial ring is not constructed from a variety, then this method
produces an error: "no variety associated with ring".

+----------------------------------------------------------+
|i9 : S = QQ[x_0..x_2];                                    |
+----------------------------------------------------------+
|i10 : gens S                                              |
|                                                          |
|o10 = {x , x , x }                                        |
|        0   1   2                                         |
|                                                          |
|o10 : List                                                |
+----------------------------------------------------------+
|i11 : degrees S                                           |
|                                                          |
|o11 = {{1}, {1}, {1}}                                     |
|                                                          |
|o11 : List                                                |
+----------------------------------------------------------+
|i12 : assert (try (normalToricVariety S; false) else true)|
+----------------------------------------------------------+
|i13 : assert instance(variety S, ProjectiveVariety)       |
+----------------------------------------------------------+

Caveat
======

This methods does not determine if a ring could be realized as the total
coordinate ring of a normal toric variety.

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)

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

  * normalToricVariety(Ring) -- get the
    associated normal toric variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/SheavesDocumentation.m2:178:0.

OO ToricDivisor -- make the associated rank-one reflexive sheaf
***************************************************************

  * Operator: SPACE (Macaulay2Doc),
  * Usage:
        OO D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a coherent sheaf (Varieties), the associated
        rank-one reflexive sheaf

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

For a Weil divisor $D$ on a normal variety $X$ the associated sheaf ${\cal
O}_X(D)$ is defined by $H^0(U, {\cal O}_X(D)) = \{ f \in {\mathbb C}(X)^* |
(div(f)+D)|_U \geq 0 \} \cup \{0\}$. The sheaf associated to a Weil divisor is
reflexive; it is equal to its bidual.  A divisor is Cartier if and only if the
associated sheaf is a line bundle

The first examples show that the associated sheaves are reflexive.

+------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;              |
+------------------------------------------------+
|i2 : K = toricDivisor PP3                       |
|                                                |
|o2 = - PP3  - PP3  - PP3  - PP3                 |
|          0      1      2      3                |
|                                                |
|o2 : ToricDivisor on PP3                        |
+------------------------------------------------+
|i3 : omega = OO K                               |
|                                                |
|          1                                     |
|o3 = OO    (-4)                                 |
|       PP3                                      |
|                                                |
|o3 : coherent sheaf on PP3, free of rank 1      |
+------------------------------------------------+
|i4 : omegaVee = prune sheafHom (omega, OO_PP3)  |
|                                                |
|          1                                     |
|o4 = OO    (4)                                  |
|       PP3                                      |
|                                                |
|o4 : coherent sheaf on PP3, free of rank 1      |
+------------------------------------------------+
|i5 : omega === prune sheafHom (omegaVee, OO_PP3)|
|                                                |
|o5 = true                                       |
+------------------------------------------------+
+----------------------------------------+
|i6 : X = hirzebruchSurface 2;           |
+----------------------------------------+
|i7 : D = X_0 + X_1                      |
|                                        |
|o7 = X  + X                             |
|      0    1                            |
|                                        |
|o7 : ToricDivisor on X                  |
+----------------------------------------+
|i8 : L = OO D                           |
|                                        |
|        1                               |
|o8 = OO   (-1, 1)                       |
|       X                                |
|                                        |
|o8 : coherent sheaf on X, free of rank 1|
+----------------------------------------+
|i9 : LVee = prune sheafHom (L, OO_X)    |
|                                        |
|        1                               |
|o9 = OO   (1, -1)                       |
|       X                                |
|                                        |
|o9 : coherent sheaf on X, free of rank 1|
+----------------------------------------+
|i10 : L === prune sheafHom (LVee, OO_X) |
|                                        |
|o10 = true                              |
+----------------------------------------+
+-----------------------------------------------------------------------------+
|i11 : rayList = {{1,0,0},{0,1,0},{0,0,1},{0,-1,-1},{-1,0,-1},{-2,-1,0}};     |
+-----------------------------------------------------------------------------+
|i12 : coneList = {{0,1,2},{0,1,3},{1,3,4},{1,2,4},{2,4,5},{0,2,5},{0,3,5},{3,|
|-----------------------------------------------------------------------------|
|4,5}};                                                                       |
+-----------------------------------------------------------------------------+
|i13 : Y = normalToricVariety(rayList,coneList);                              |
+-----------------------------------------------------------------------------+
|i14 : isSmooth Y                                                             |
|                                                                             |
|o14 = false                                                                  |
+-----------------------------------------------------------------------------+
|i15 : isProjective Y                                                         |
|                                                                             |
|o15 = false                                                                  |
+-----------------------------------------------------------------------------+
|i16 : E = Y_0 + Y_2 + Y_4                                                    |
|                                                                             |
|o16 = Y  + Y  + Y                                                            |
|       0    2    4                                                           |
|                                                                             |
|o16 : ToricDivisor on Y                                                      |
+-----------------------------------------------------------------------------+
|i17 : isCartier E                                                            |
|                                                                             |
|o17 = false                                                                  |
+-----------------------------------------------------------------------------+
|i18 : F = OO E                                                               |
|                                                                             |
|         1                                                                   |
|o18 = OO   (1, 3, 2)                                                         |
|        Y                                                                    |
|                                                                             |
|o18 : coherent sheaf on Y, free of rank 1                                    |
+-----------------------------------------------------------------------------+
|i19 : FVee = prune sheafHom(F, OO_Y)                                         |
|                                                                             |
|         1                                                                   |
|o19 = OO   (-1, -3, -2)                                                      |
|        Y                                                                    |
|                                                                             |
|o19 : coherent sheaf on Y, free of rank 1                                    |
+-----------------------------------------------------------------------------+
|i20 : F === prune sheafHom(FVee, OO_Y)                                       |
|                                                                             |
|o20 = true                                                                   |
+-----------------------------------------------------------------------------+

Two Weil divisors $D$ and $E$ are linearly equivalent if $D = E + div(f)$, for
some $f \in {\mathbb C}(X)^*$. Linearly equivalent divisors produce isomorphic
sheaves.

+-----------------------------------+
|i21 : PP3 = toricProjectiveSpace 3;|
+-----------------------------------+
|i22 : D1 = PP3_0                   |
|                                   |
|o22 = PP3                          |
|         0                         |
|                                   |
|o22 : ToricDivisor on PP3          |
+-----------------------------------+
|i23 : E1 = PP3_1                   |
|                                   |
|o23 = PP3                          |
|         1                         |
|                                   |
|o23 : ToricDivisor on PP3          |
+-----------------------------------+
|i24 : OO D1 === OO E1              |
|                                   |
|o24 = true                         |
+-----------------------------------+
|i25 : X = hirzebruchSurface 2;     |
+-----------------------------------+
|i26 : D2 = X_2 + X_3               |
|                                   |
|o26 = X  + X                       |
|       2    3                      |
|                                   |
|o26 : ToricDivisor on X            |
+-----------------------------------+
|i27 : E2 = 3*X_0 + X_1             |
|                                   |
|o27 = 3*X  + X                     |
|         0    1                    |
|                                   |
|o27 : ToricDivisor on X            |
+-----------------------------------+
|i28 : OO D2 === OO E2              |
|                                   |
|o28 = true                         |
+-----------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)

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

  * OO ToricDivisor -- make the associated rank-one
    reflexive sheaf
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1559:0.

orbits(NormalToricVariety) -- make a hashtable indexing the torus orbits (a.k.a. cones in the fan)
**************************************************************************************************

  * Function: orbits,
  * Usage:
        orbits X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a hash table (Macaulay2Doc), whose keys are the
        dimensions of the torus orbits in X and whose values are lists of lists
        of integers indexing the torus orbits

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

A normal toric variety is a disjoint union of its orbits under the action of
its algebraic torus.  These orbits are in bijection with the cones in the
associated fan.  Each cone is determined by the rays it contains.  In this
package, the rays are ordered and indexed by nonnegative integers: $0, 1,
\dots,n$.  Using this indexing, an orbit or cone corresponds to a sublist of
$\{0,\dots,n\}$; the entries index the rays that generate the cone.

The projective plane has three fixed points and three fixed curves (under the
action of its torus), and projective $3$-space has four fixed points, six fixed
curves, and four divisors.  More generally, the orbits of projective
$(n-1)$-space are enumerated by the $n$-th row of Pascal's triangle.

+---------------------------------------------------------------------+
|i1 : O2 = orbits toricProjectiveSpace 2                              |
|                                                                     |
|o1 = HashTable{0 => {{0, 1}, {0, 2}, {1, 2}}}                        |
|               1 => {{0}, {1}, {2}}                                  |
|               2 => {{}}                                             |
|                                                                     |
|o1 : HashTable                                                       |
+---------------------------------------------------------------------+
|i2 : (#O2#0, #O2#1, #O2#2)                                           |
|                                                                     |
|o2 = (3, 3, 1)                                                       |
|                                                                     |
|o2 : Sequence                                                        |
+---------------------------------------------------------------------+
|i3 : O3 = orbits toricProjectiveSpace 3                              |
|                                                                     |
|o3 = HashTable{0 => {{0, 1, 2}, {0, 1, 3}, {0, 2, 3}, {1, 2, 3}}    }|
|               1 => {{0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3}} |
|               2 => {{0}, {1}, {2}, {3}}                             |
|               3 => {{}}                                             |
|                                                                     |
|o3 : HashTable                                                       |
+---------------------------------------------------------------------+
|i4 : apply (4, k -> #O3#k)                                           |
|                                                                     |
|o4 = {4, 6, 4, 1}                                                    |
|                                                                     |
|o4 : List                                                            |
+---------------------------------------------------------------------+
|i5 : apply (5, k -> # (orbits toricProjectiveSpace 4)#k)             |
|                                                                     |
|o5 = {5, 10, 10, 5, 1}                                               |
|                                                                     |
|o5 : List                                                            |
+---------------------------------------------------------------------+
|i6 : apply (6, k -> # (orbits toricProjectiveSpace 5)#k)             |
|                                                                     |
|o6 = {6, 15, 20, 15, 6, 1}                                           |
|                                                                     |
|o6 : List                                                            |
+---------------------------------------------------------------------+

Here is a non-simplicial example.

+-----------------------------------------------------------------------------+
|i7 : X = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));                        |
+-----------------------------------------------------------------------------+
|i8 : assert not isSimplicial X                                               |
+-----------------------------------------------------------------------------+
|i9 : OX = orbits X                                                           |
|                                                                             |
|o9 = HashTable{0 => {{0, 1, 2, 3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, |
|               1 => {{0, 1}, {0, 2}, {0, 4}, {1, 3}, {1, 5}, {2, 3}, {2, 6}, |
|               2 => {{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}}                 |
|               3 => {{}}                                                     |
|                                                                             |
|o9 : HashTable                                                               |
|-----------------------------------------------------------------------------|
|{2, 3, 6, 7}, {4, 5, 6, 7}}            }                                     |
|{3, 7}, {4, 5}, {4, 6}, {5, 7}, {6, 7}}                                      |
+-----------------------------------------------------------------------------+
|i10 : apply (1+dim X, k -> #OX#k)                                            |
|                                                                             |
|o10 = {6, 12, 8, 1}                                                          |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+

The following degenerate example has no fixed points.

+----------------------------------------------------------+
|i11 : U = normalToricVariety ({{4,-1,0},{0,1,0}},{{0,1}});|
+----------------------------------------------------------+
|i12 : assert isDegenerate U                               |
+----------------------------------------------------------+
|i13 : OU = orbits U                                       |
|                                                          |
|o13 = HashTable{0 => {}        }                          |
|                1 => {{0, 1}}                             |
|                2 => {{0}, {1}}                           |
|                3 => {{}}                                 |
|                                                          |
|o13 : HashTable                                           |
+----------------------------------------------------------+
|i14 : apply (4, k -> #OU#k)                               |
|                                                          |
|o14 = {0, 1, 2, 1}                                        |
|                                                          |
|o14 : List                                                |
+----------------------------------------------------------+
|i15 : assert (#OU#0 == 0)                                 |
+----------------------------------------------------------+

To avoid repeating a computation, the package caches the result in the
CacheTable (Macaulay2Doc), of the normal toric variety.

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * orbits(NormalToricVariety,ZZ),
    -- get a list of the torus orbits (a.k.a. cones in the fan) of a given
    dimension

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

  * orbits(NormalToricVariety) -- make a
    hashtable indexing the torus orbits (a.k.a. cones in the fan)
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1916:0.

orbits(NormalToricVariety,ZZ) -- get a list of the torus orbits (a.k.a. cones in the fan) of a given dimension
**************************************************************************************************************

  * Function: orbits,
  * Usage:
        orbits (X, i)
  * Inputs:
      * X, a normal toric variety,
      * i, an integer (Macaulay2Doc), determining the dimension of
        the orbits
  * Outputs:
      * a list (Macaulay2Doc), of lists of integers indexing the
        torus orbits

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

A normal toric variety is a disjoint union of its orbits under the action of
its algebraic torus.  These orbits are in bijection with the cones in the
associated fan.  Each cone is determined by the rays it contains.  In this
package, the rays are ordered and indexed by nonnegative integers: $0, 1,
\dots, n$.  Using this indexing, an orbit or cone corresponds to a sublist of
$\{ 0, 1, \dots, n \}$; the entries index the rays that generate the cone.

The projective plane has three fixed points and three fixed curves (under the
action of its torus), and projective $3$-space has four fixed points, six fixed
curves, and four divisors.

+-----------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                   |
+-----------------------------------------------------+
|i2 : orbits (PP2,0)                                  |
|                                                     |
|o2 = {{0, 1}, {0, 2}, {1, 2}}                        |
|                                                     |
|o2 : List                                            |
+-----------------------------------------------------+
|i3 : orbits (PP2,1)                                  |
|                                                     |
|o3 = {{0}, {1}, {2}}                                 |
|                                                     |
|o3 : List                                            |
+-----------------------------------------------------+
|i4 : orbits (PP2,2)                                  |
|                                                     |
|o4 = {{}}                                            |
|                                                     |
|o4 : List                                            |
+-----------------------------------------------------+
|i5 : PP3 = toricProjectiveSpace 3;                   |
+-----------------------------------------------------+
|i6 : orbits (PP3,0)                                  |
|                                                     |
|o6 = {{0, 1, 2}, {0, 1, 3}, {0, 2, 3}, {1, 2, 3}}    |
|                                                     |
|o6 : List                                            |
+-----------------------------------------------------+
|i7 : orbits (PP3,1)                                  |
|                                                     |
|o7 = {{0, 1}, {0, 2}, {0, 3}, {1, 2}, {1, 3}, {2, 3}}|
|                                                     |
|o7 : List                                            |
+-----------------------------------------------------+
|i8 : orbits (PP3,2)                                  |
|                                                     |
|o8 = {{0}, {1}, {2}, {3}}                            |
|                                                     |
|o8 : List                                            |
+-----------------------------------------------------+
|i9 : orbits (PP3,3)                                  |
|                                                     |
|o9 = {{}}                                            |
|                                                     |
|o9 : List                                            |
+-----------------------------------------------------+

Here is a non-simplicial example.  Since it is nondegenerate, the fixed points
correspond to the maximal cones in the fan.  The rays always correspond to the
divisors.

+-----------------------------------------------------------------------------+
|i10 : X = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));                       |
+-----------------------------------------------------------------------------+
|i11 : orbits (X,0)                                                           |
|                                                                             |
|o11 = {{0, 1, 2, 3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, {2, 3, 6, 7}, |
|      -----------------------------------------------------------------------|
|      {4, 5, 6, 7}}                                                          |
|                                                                             |
|o11 : List                                                                   |
+-----------------------------------------------------------------------------+
|i12 : assert (orbits (X,0) === max X)                                        |
+-----------------------------------------------------------------------------+
|i13 : orbits (X,1)                                                           |
|                                                                             |
|o13 = {{0, 1}, {0, 2}, {0, 4}, {1, 3}, {1, 5}, {2, 3}, {2, 6}, {3, 7}, {4,   |
|      -----------------------------------------------------------------------|
|      5}, {4, 6}, {5, 7}, {6, 7}}                                            |
|                                                                             |
|o13 : List                                                                   |
+-----------------------------------------------------------------------------+
|i14 : orbits (X,2)                                                           |
|                                                                             |
|o14 = {{0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}}                               |
|                                                                             |
|o14 : List                                                                   |
+-----------------------------------------------------------------------------+
|i15 : assert (orbits (X,2) === apply (#rays X, i -> {i}))                    |
+-----------------------------------------------------------------------------+
|i16 : orbits (X,3)                                                           |
|                                                                             |
|o16 = {{}}                                                                   |
|                                                                             |
|o16 : List                                                                   |
+-----------------------------------------------------------------------------+
|i17 : assert (orbits (X,3) === {{}})                                         |
+-----------------------------------------------------------------------------+

The following degenerate example has no fixed points.

+----------------------------------------------------------+
|i18 : U = normalToricVariety ({{4,-1,0},{0,1,0}},{{0,1}});|
+----------------------------------------------------------+
|i19 : assert isDegenerate U                               |
+----------------------------------------------------------+
|i20 : orbits (U,0)                                        |
|                                                          |
|o20 = {}                                                  |
|                                                          |
|o20 : List                                                |
+----------------------------------------------------------+
|i21 : orbits (U,1)                                        |
|                                                          |
|o21 = {{0, 1}}                                            |
|                                                          |
|o21 : List                                                |
+----------------------------------------------------------+
|i22 : orbits (U,2)                                        |
|                                                          |
|o22 = {{0}, {1}}                                          |
|                                                          |
|o22 : List                                                |
+----------------------------------------------------------+
|i23 : orbits (U,3)                                        |
|                                                          |
|o23 = {{}}                                                |
|                                                          |
|o23 : List                                                |
+----------------------------------------------------------+
|i24 : dim U                                               |
|                                                          |
|o24 = 3                                                   |
+----------------------------------------------------------+

To routine extracts the requested list from hashTable returned by
orbits(NormalToricVariety).

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * orbits(NormalToricVariety) -- make a
    hashtable indexing the torus orbits (a.k.a. cones in the fan)

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

  * orbits(NormalToricVariety,ZZ),
    -- get a list of the torus orbits (a.k.a. cones in the fan) of a given
    dimension
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1986:0.

picardGroup(NormalToricVariety) -- make the Picard group
********************************************************

  * Function: picardGroup,
  * Usage:
        picardGroup X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a module (Macaulay2Doc), a finitely generated abelian
        group

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

The Picard group of a variety is the group of Cartier divisors divided by the
subgroup of principal divisors.  For a normal toric variety, the Picard group
has a presentation defined by the map from the group of torus-characters to the
group of torus-invariant Cartier divisors.  For more information, see Theorem
4.2.1 in Cox-Little-Schenck's Toric Varieties.

When the normal toric variety is smooth,
the Picard group is isomorphic to the
class group.

+-----------------------------------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;                                           |
+-----------------------------------------------------------------------------+
|i2 : assert (isSmooth PP3 and isProjective PP3)                              |
+-----------------------------------------------------------------------------+
|i3 : picardGroup PP3                                                         |
|                                                                             |
|       1                                                                     |
|o3 = ZZ                                                                      |
|                                                                             |
|o3 : ZZ-module, free                                                         |
+-----------------------------------------------------------------------------+
|i4 : assert (picardGroup PP3 === classGroup PP3 and isFreeModule picardGroup |
|-----------------------------------------------------------------------------|
|PP3)                                                                         |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i5 : X = smoothFanoToricVariety (4,90);                                      |
+-----------------------------------------------------------------------------+
|i6 : assert (isSmooth X and isProjective X and isFano X)                     |
+-----------------------------------------------------------------------------+
|i7 : picardGroup X                                                           |
|                                                                             |
|       5                                                                     |
|o7 = ZZ                                                                      |
|                                                                             |
|o7 : ZZ-module, free                                                         |
+-----------------------------------------------------------------------------+
|i8 : assert (fromCDivToPic X === fromWDivToCl X and isFreeModule picardGroup |
|-----------------------------------------------------------------------------|
|X)                                                                           |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i9 : U = normalToricVariety ({{4,-1},{0,1}},{{0},{1}});                      |
+-----------------------------------------------------------------------------+
|i10 : assert (isSmooth U and not isComplete U and # max U =!= 1)             |
+-----------------------------------------------------------------------------+
|i11 : picardGroup U                                                          |
|                                                                             |
|o11 = cokernel | 4 |                                                         |
|                                                                             |
|                               1                                             |
|o11 : ZZ-module, quotient of ZZ                                              |
+-----------------------------------------------------------------------------+
|i12 : assert (classGroup U === picardGroup U and not isFreeModule picardGroup|
|-----------------------------------------------------------------------------|
|U)                                                                           |
+-----------------------------------------------------------------------------+

For an affine toric variety, the Picard group is trivial.

+--------------------------------------------------------------------+
|i13 : AA3 = affineSpace 3                                           |
|                                                                    |
|o13 = AA3                                                           |
|                                                                    |
|o13 : NormalToricVariety                                            |
+--------------------------------------------------------------------+
|i14 : assert (isSimplicial AA3 and isSmooth AA3 and # max AA3 === 1)|
+--------------------------------------------------------------------+
|i15 : picardGroup AA3                                               |
|                                                                    |
|o15 = 0                                                             |
|                                                                    |
|o15 : ZZ-module                                                     |
+--------------------------------------------------------------------+
|i16 : assert (picardGroup AA3 == 0 and isFreeModule picardGroup AA3)|
+--------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i17 : Q = normalToricVariety                                                 |
|-----------------------------------------------------------------------------|
|({{1,0,0},{0,1,0},{0,0,1},{1,1,-1}},{{0,1,2,3}});                            |
+-----------------------------------------------------------------------------+
|i18 : assert (not isSimplicial Q and not isComplete Q and # max Q === 1)     |
+-----------------------------------------------------------------------------+
|i19 : picardGroup Q                                                          |
|                                                                             |
|o19 = 0                                                                      |
|                                                                             |
|o19 : ZZ-module                                                              |
+-----------------------------------------------------------------------------+
|i20 : assert (picardGroup Q == 0 and isFreeModule picardGroup Q)             |
+-----------------------------------------------------------------------------+

If the fan associated to $X$ contains a cone of dimension $dim(X)$, then the
Picard group is free.

+----------------------------------------------------------------------+
|i21 : Y = normalToricVariety (id_(ZZ^3) | -id_(ZZ^3));                |
+----------------------------------------------------------------------+
|i22 : assert (not isSimplicial Y and isProjective Y)                  |
+----------------------------------------------------------------------+
|i23 : picardGroup Y                                                   |
|                                                                      |
|        1                                                             |
|o23 = ZZ                                                              |
|                                                                      |
|o23 : ZZ-module, free                                                 |
+----------------------------------------------------------------------+
|i24 : assert (rank picardGroup Y === 1 and isFreeModule picardGroup Y)|
+----------------------------------------------------------------------+

To avoid duplicate computations, the attribute is cached in the normal toric
variety.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * classGroup(NormalToricVariety),
    -- make the class group
  * cartierDivisorGroup(NormalToricVariety)
    -- compute the group of
    torus-invariant Cartier divisors
  * fromCDivToPic(NormalToricVariety)
    -- get the map from Cartier divisors
    to the Picard group
  * fromPicToCl(NormalToricVariety),
    -- get the map from Picard group to class group
  * picardGroup(ToricMap) -- make the induced
    map between Picard groups

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

  * picardGroup(NormalToricVariety),
    -- make the Picard group
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:472:0.

picardGroup(ToricMap) -- make the induced map between Picard groups
*******************************************************************

  * Function: picardGroup,
  * Usage:
        picardGroup f
  * Inputs:
      * f, a toric map,
  * Outputs:
      * a matrix (Macaulay2Doc), representing the map of abelian
        groups between the corresponding Picard groups

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

Given a toric map $f : X \to Y$, this method returns the induced map of abelian
groups from the Picard group of $Y$ to the Picard group of $X$.  In other
words, see picardGroup, is a
contravariant functor on the category of normal toric varieties.

We illustrate this method on the projection from the first Hirzebruch surface,
to the projective line.

+---------------------------------------------------------------+
|i1 : X = hirzebruchSurface 1;                                  |
+---------------------------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;                               |
+---------------------------------------------------------------+
|i3 : f = map(Y, X, matrix {{1, 0}})                            |
|                                                               |
|o3 = | 1 0 |                                                   |
|                                                               |
|o3 : ToricMap Y <--- X                                         |
+---------------------------------------------------------------+
|i4 : f' = picardGroup f                                        |
|                                                               |
|o4 = | 1 |                                                     |
|     | 0 |                                                     |
|                                                               |
|              2       1                                        |
|o4 : Matrix ZZ  <-- ZZ                                         |
+---------------------------------------------------------------+
|i5 : assert (isWellDefined f and source f' == picardGroup Y and|
|         target f' == picardGroup X)                           |
+---------------------------------------------------------------+

The induced map between the Picard groups is compatible with the induced map
between the groups of torus-invariant Cartier divisors.

+------------------------------------------------------------+
|i6 : f'' = cartierDivisorGroup f                            |
|                                                            |
|o6 = | 0 1 |                                                |
|     | 0 0 |                                                |
|     | 1 0 |                                                |
|     | 0 0 |                                                |
|                                                            |
|              4       2                                     |
|o6 : Matrix ZZ  <-- ZZ                                      |
+------------------------------------------------------------+
|i7 : assert(f' * fromCDivToPic Y  == fromCDivToPic X  * f'')|
+------------------------------------------------------------+

Neither the source nor the target of the toric map needs to be smooth.

+---------------------------------------------------------------------------+
|i8 : W = weightedProjectiveSpace {1, 1, 2};                                |
+---------------------------------------------------------------------------+
|i9 : Z = toricBlowup({0, 1, 4}, (W ** toricProjectiveSpace 1), {0, -2, 1});|
+---------------------------------------------------------------------------+
|i10 : assert (not isSmooth W and not isSmooth Z)                           |
+---------------------------------------------------------------------------+
|i11 : g = map(W, Z, matrix{{1,0,0},{0,1,0}})                               |
|                                                                           |
|o11 = | 1 0 0 |                                                            |
|      | 0 1 0 |                                                            |
|                                                                           |
|o11 : ToricMap W <--- Z                                                    |
+---------------------------------------------------------------------------+
|i12 : g' = picardGroup g                                                   |
|                                                                           |
|o12 = | 0  |                                                               |
|      | -1 |                                                               |
|      | 0  |                                                               |
|                                                                           |
|               3       1                                                   |
|o12 : Matrix ZZ  <-- ZZ                                                    |
+---------------------------------------------------------------------------+
|i13 : assert (isWellDefined g and source g' == picardGroup W and           |
|          target g' == picardGroup Z)                                      |
+---------------------------------------------------------------------------+
|i14 : g'' = cartierDivisorGroup g                                          |
|                                                                           |
|o14 = | 0 0  0 |                                                           |
|      | 0 0  0 |                                                           |
|      | 1 0  0 |                                                           |
|      | 0 -1 0 |                                                           |
|      | 0 1  1 |                                                           |
|      | 0 0  0 |                                                           |
|                                                                           |
|               6       3                                                   |
|o14 : Matrix ZZ  <-- ZZ                                                    |
+---------------------------------------------------------------------------+
|i15 : assert(g' * fromCDivToPic W  == fromCDivToPic Z  * g'')              |
+---------------------------------------------------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * picardGroup(NormalToricVariety),
    -- make the Picard group
  * cartierDivisorGroup(ToricMap), --
    make the induced map between groups of Cartier divisors.
  * classGroup(ToricMap) -- make the induced
    map between class groups
  * pullback(ToricMap,ToricDivisor)
    -- make the pullback of a Cartier
    divisor under a toric map

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

  * picardGroup(ToricMap) -- make the induced
    map between Picard groups
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1331:0.

polytope(ToricDivisor) -- makes the associated 'Polyhedra' polyhedron
*********************************************************************

  * Function: polytope (Polyhedra),
  * Usage:
        polytope D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a convex polyhedron (Polyhedra),

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

For a torus-invariant Weil divisors $D = \sum_i a_i D_i$ the associated
polyhedron is $\{ m \in M : (m, v_i) \geq -a_i \forall i \}$. Given a
torus-invariant Weil divisor, this methods makes the associated polyhedra as an
object in Polyhedra.

+----------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;|
+----------------------------------+
|i2 : P0 = polytope (-PP2_0)       |
|                                  |
|o2 = P0                           |
|                                  |
|o2 : Polyhedron                   |
+----------------------------------+
|i3 : assert (dim P0 === -1)       |
+----------------------------------+
|i4 : P1 = polytope (0*PP2_0)      |
|                                  |
|o4 = P1                           |
|                                  |
|o4 : Polyhedron                   |
+----------------------------------+
|i5 : assert (dim P1 == 0)         |
+----------------------------------+
|i6 : assert (vertices P1 == 0)    |
+----------------------------------+
|i7 : P2 = polytope (PP2_0)        |
|                                  |
|o7 = P2                           |
|                                  |
|o7 : Polyhedron                   |
+----------------------------------+
|i8 : vertices P2                  |
|                                  |
|o8 = | 0 1 0 |                    |
|     | 0 0 1 |                    |
|                                  |
|              2       3           |
|o8 : Matrix QQ  <-- QQ            |
+----------------------------------+
|i9 : halfspaces P2                |
|                                  |
|o9 = (| -1 0  |, | 0 |)           |
|      | 0  -1 |  | 0 |            |
|      | 1  1  |  | 1 |            |
|                                  |
|o9 : Sequence                     |
+----------------------------------+

This method works with $\QQ$-Cartier divisors.

+-----------------------------------------------------------------------------+
|i10 : Y = normalToricVariety matrix                                          |
|-----------------------------------------------------------------------------|
|{{0,1,0,0,1},{0,0,1,0,1},{0,0,0,1,1},{0,0,0,0,3}};                           |
+-----------------------------------------------------------------------------+
|i11 : assert not isCartier Y_0                                               |
+-----------------------------------------------------------------------------+
|i12 : assert isQQCartier Y_0                                                 |
+-----------------------------------------------------------------------------+
|i13 : P3 = polytope Y_0;                                                     |
+-----------------------------------------------------------------------------+
|i14 : vertices P3                                                            |
|                                                                             |
|o14 = | 0 1/3 0   0   1/3 |                                                  |
|      | 0 0   1/3 0   1/3 |                                                  |
|      | 0 0   0   1/3 1/3 |                                                  |
|      | 0 0   0   0   1   |                                                  |
|                                                                             |
|               4       5                                                     |
|o14 : Matrix QQ  <-- QQ                                                      |
+-----------------------------------------------------------------------------+
|i15 : vertices polytope Y_0                                                  |
|                                                                             |
|o15 = | 0 1/3 0   0   1/3 |                                                  |
|      | 0 0   1/3 0   1/3 |                                                  |
|      | 0 0   0   1/3 1/3 |                                                  |
|      | 0 0   0   0   1   |                                                  |
|                                                                             |
|               4       5                                                     |
|o15 : Matrix QQ  <-- QQ                                                      |
+-----------------------------------------------------------------------------+
|i16 : halfspaces P3                                                          |
|                                                                             |
|o16 = (| 3  3  3  -2 |, | 1 |)                                               |
|       | 0  0  0  -1 |  | 0 |                                                |
|       | -3 0  0  1  |  | 0 |                                                |
|       | 0  -3 0  1  |  | 0 |                                                |
|       | 0  0  -3 1  |  | 0 |                                                |
|                                                                             |
|o16 : Sequence                                                               |
+-----------------------------------------------------------------------------+

It also works divisors on non-complete toric varieties.

+------------------------------------------------------------------+
|i17 : Z = normalToricVariety ({{1,0},{1,1},{0,1}}, {{0,1},{1,2}});|
+------------------------------------------------------------------+
|i18 : assert not isComplete Z                                     |
+------------------------------------------------------------------+
|i19 : D = - toricDivisor Z                                        |
|                                                                  |
|o19 = Z  + Z  + Z                                                 |
|       0    1    2                                                |
|                                                                  |
|o19 : ToricDivisor on Z                                           |
+------------------------------------------------------------------+
|i20 : P4 = polytope D;                                            |
+------------------------------------------------------------------+
|i21 : rays P4                                                     |
|                                                                  |
|o21 = | 1 0 |                                                     |
|      | 0 1 |                                                     |
|                                                                  |
|               2       2                                          |
|o21 : Matrix QQ  <-- QQ                                           |
+------------------------------------------------------------------+
|i22 : vertices P4                                                 |
|                                                                  |
|o22 = | -1 0  |                                                   |
|      | 0  -1 |                                                   |
|                                                                  |
|               2       2                                          |
|o22 : Matrix QQ  <-- QQ                                           |
+------------------------------------------------------------------+
|i23 : halfspaces P4                                               |
|                                                                  |
|o23 = (| -1 0  |, | 1 |)                                          |
|       | 0  -1 |  | 1 |                                           |
|       | -1 -1 |  | 1 |                                           |
|                                                                  |
|o23 : Sequence                                                    |
+------------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * normalToricVariety(Matrix) -- make a
    normal toric variety from a polytope
  * vertices(ToricDivisor) -- compute the
    vertices of the associated polytope

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

  * polytope(ToricDivisor) -- makes the
    associated 'Polyhedra' polyhedron
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:2119:0.

projective space -- information about various constructions of projective space
*******************************************************************************

There are several different methods for creating projective $n$-space in
Macaulay2.

To generate projective space as a ProjectiveVariety (Varieties),
we use the Proj-construction.

+---------------------------------------------------+
|i1 : X0 = Proj (QQ[x_0..x_3])                      |
|                                                   |
|o1 = X0                                            |
|                                                   |
|o1 : ProjectiveVariety                             |
+---------------------------------------------------+
|i2 : assert (3 === dim X0)                         |
+---------------------------------------------------+
|i3 : ring X0                                       |
|                                                   |
|o3 = QQ[x ..x ]                                    |
|         0   3                                     |
|                                                   |
|o3 : PolynomialRing                                |
+---------------------------------------------------+
|i4 : hilbertPolynomial(X0, Projective => false)    |
|                                                   |
|     1 3    2   11                                 |
|o4 = -i  + i  + --i + 1                            |
|     6           6                                 |
|                                                   |
|o4 : QQ[i]                                         |
+---------------------------------------------------+
|i5 : for d to 10 list rank HH^0 (OO_X0(d))         |
|                                                   |
|o5 = {1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286}|
|                                                   |
|o5 : List                                          |
+---------------------------------------------------+

To work with projective space as a NormalToricVariety,
we simply use the method toricProjectiveSpace.

+----------------------------------------------------+
|i6 : X1 = toricProjectiveSpace 3                    |
|                                                    |
|o6 = X1                                             |
|                                                    |
|o6 : NormalToricVariety                             |
+----------------------------------------------------+
|i7 : assert (3 === dim X1)                          |
+----------------------------------------------------+
|i8 : rays X1                                        |
|                                                    |
|o8 = {{-1, -1, -1}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}|
|                                                    |
|o8 : List                                           |
+----------------------------------------------------+
|i9 : max X1                                         |
|                                                    |
|o9 = {{0, 1, 2}, {0, 1, 3}, {0, 2, 3}, {1, 2, 3}}   |
|                                                    |
|o9 : List                                           |
+----------------------------------------------------+
|i10 : ring X1                                       |
|                                                    |
|o10 = QQ[x ..x ]                                    |
|          0   3                                     |
|                                                    |
|o10 : PolynomialRing                                |
+----------------------------------------------------+
|i11 : intersectionRing X1                           |
|                                                    |
|                      QQ[][t ..t ]                  |
|                            0   3                   |
|o11 = -------------------------------------------   |
|      (t t t t , - t  + t , - t  + t , - t  + t )   |
|        0 1 2 3     0    1     0    2     0    3    |
|                                                    |
|o11 : QuotientRing                                  |
+----------------------------------------------------+
|i12 : hilbertPolynomial (X1)                        |
|                                                    |
|      1 3    2   11                                 |
|o12 = -i  + i  + --i  + 1                           |
|      6 0    0    6 0                               |
|                                                    |
|o12 : QQ[i ]                                        |
|          0                                         |
+----------------------------------------------------+
|i13 : for d to 10 list rank HH^0 (X1, OO_X1(d))     |
|                                                    |
|o13 = {1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286}|
|                                                    |
|o13 : List                                          |
+----------------------------------------------------+
|i14 : assert (X0 =!= X1)                            |
+----------------------------------------------------+

To manipulate projective space as an AbstractVariety (Schubert2),
we employ the method
abstractProjectiveSpace (Schubert2).

+-------------------------------------------------------------+
|i15 : X2 = abstractProjectiveSpace (3, base(symbol i))       |
|                                                             |
|o15 = X2                                                     |
|                                                             |
|o15 : a flag bundle with subquotient ranks {1, 3}            |
+-------------------------------------------------------------+
|i16 : assert (3 === dim X2)                                  |
+-------------------------------------------------------------+
|i17 : intersectionRing X2                                    |
|                                                             |
|                        QQ[i][h, H   ..H   ]                 |
|                                  2,1   2,3                  |
|o17 = -------------------------------------------------------|
|      (- h - H   , - h*H    - H   , - h*H    - H   , -h*H   )|
|              2,1       2,1    2,2       2,2    2,3      2,3 |
|                                                             |
|o17 : QuotientRing                                           |
+-------------------------------------------------------------+
|i18 : chi (OO_X2(i))                                         |
|                                                             |
|      1 3    2   11                                          |
|o18 = -i  + i  + --i + 1                                     |
|      6           6                                          |
|                                                             |
|o18 : QQ[i]                                                  |
+-------------------------------------------------------------+
|i19 : assert (X2 =!= X0)                                     |
+-------------------------------------------------------------+
|i20 : assert (X2 =!= X1)                                     |
+-------------------------------------------------------------+

If you prefer a shorter name for your favourite method of constructing
projective space, then make one.

+-------------------------------------------------+
|i21 : projectiveSpace = n -> Proj (QQ[x_0..x_n]);|
+-------------------------------------------------+
|i22 : projectiveSpace 2                          |
|                                                 |
|o22 = Proj(QQ[x ..x ])                           |
|               0   2                             |
|                                                 |
|o22 : ProjectiveVariety                          |
+-------------------------------------------------+
+-----------------------------------------------------------------------------+
|i23 : PP = toricProjectiveSpace;                                             |
+-----------------------------------------------------------------------------+
|i24 : PP 2                                                                   |
|                                                                             |
|o24 = normalToricVariety ({{-1, -1}, {1, 0}, {0, 1}}, {{0, 1}, {0, 2}, {1,   |
|                                                                             |
|o24 : NormalToricVariety                                                     |
|-----------------------------------------------------------------------------|
|2}})                                                                         |
+-----------------------------------------------------------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * Proj (Varieties) -- make a projective variety
  * toricProjectiveSpace -- make a
    projective space as a normal toric variety
  * abstractProjectiveSpace (Schubert2) -- make
    a projective space
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:644:0.

pullback(ToricMap,CoherentSheaf) -- make the pullback of a coherent sheaf under a toric map
*******************************************************************************************

  * Function: pullback (Macaulay2Doc),
  * Usage:
        F' = pullback(f, F)
        M' = pullback(f, M)
  * Inputs:
      * f, a toric map, where the target is smooth
      * F, a coherent sheaf (Varieties), on the target of
        f or module representing such a coherent sheaf
  * Outputs:
      * F', a coherent sheaf (Varieties), the pullback of
        F under f, or the module M' representing such a sheaf

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

The category of coherent sheaves,
on a normal toric variety is equivalent to the quotient category of finitely
generated modules over the total coordinate ring,
by the full subcategory of torsion modules with
respect to the irrelevant ideal. In
particular, each finitely generated module over the total coordinate ring
corresponds to coherent sheaf on the normal toric variety and every coherent
sheaf arises in this manner. For more information, see Subsection 5.3 in
Cox-Little-Schenck.

A toric morphism $f : X \to Y$ where $Y$ is smooth induces,
a map $g : S \to R$ from total coordinate ring $S$ of
$Y$ to the total coordinate ring $R$ of $X$.  Given a coherent sheaf $F$ on $Y$
corresponding to the $S$-module $M$, the pullback of $F$ along $f$ is the
coherent sheaf corresponding to the $R$-module $M ** g$.  For more information,
see Tomasz Mańdziuk's "Cox rings and algebraic maps", Mathematische Nachrichten
292 (2019) 389-401, arXiv:1703.04794 (see https://arxiv.org/abs/1703.04794 ).
This method returns the sheaf (or module) corresponding to the pullback along
the toric map.

As first example, we compute the pullback of the cotangent sheaf (Varieties),
on the projective plane,
to the first Hirzebruch surface.

+---------------------------------------------------------+
|i1 : X = hirzebruchSurface 1;                            |
+---------------------------------------------------------+
|i2 : Y = toricProjectiveSpace 2;                         |
+---------------------------------------------------------+
|i3 : f = map(Y, X, matrix{{1,0},{0,-1}})                 |
|                                                         |
|o3 = | 1 0  |                                            |
|     | 0 -1 |                                            |
|                                                         |
|o3 : ToricMap Y <--- X                                   |
+---------------------------------------------------------+
|i4 : Omega = cotangentSheaf Y                            |
|                                                         |
|o4 = cokernel {2} | x_2  |                               |
|              {2} | x_0  |                               |
|              {2} | -x_1 |                               |
|                                                         |
|                                         3               |
|o4 : coherent sheaf on Y, quotient of OO  (-2)           |
|                                        Y                |
+---------------------------------------------------------+
|i5 : F = pullback(f, Omega)                              |
|                                                         |
|o5 = cokernel {0, 2} | x_3     |                         |
|              {0, 2} | x_1x_2  |                         |
|              {0, 2} | -x_0x_1 |                         |
|                                                         |
|                                         3               |
|o5 : coherent sheaf on X, quotient of OO   (0, -2)       |
|                                        X                |
+---------------------------------------------------------+
|i6 : (R = ring X, S = ring Y);                           |
+---------------------------------------------------------+
|i7 : inducedMap f                                        |
|                                                         |
|o7 = map (R, S, {x x , x x , x })                        |
|                  1 2   0 1   3                          |
|                                                         |
|o7 : RingMap R <-- S                                     |
+---------------------------------------------------------+
|i8 : presentation module Omega                           |
|                                                         |
|o8 = {2} | x_2  |                                        |
|     {2} | x_0  |                                        |
|     {2} | -x_1 |                                        |
|                                                         |
|             3      1                                    |
|o8 : Matrix S  <-- S                                     |
+---------------------------------------------------------+
|i9 : presentation module F                               |
|                                                         |
|o9 = {0, 2} | x_3     |                                  |
|     {0, 2} | x_1x_2  |                                  |
|     {0, 2} | -x_0x_1 |                                  |
|                                                         |
|             3      1                                    |
|o9 : Matrix R  <-- R                                     |
+---------------------------------------------------------+
|i10 : assert (isWellDefined f and isHomogeneous module F)|
+---------------------------------------------------------+

For toric divisors, the operations of pullback and taking the associated sheaf
OO commute.

+----------------------------------------------------------+
|i11 : D = Y_0 + 2*Y_1 + 3*Y_2                             |
|                                                          |
|o11 = Y  + 2*Y  + 3*Y                                     |
|       0      1      2                                    |
|                                                          |
|o11 : ToricDivisor on Y                                   |
+----------------------------------------------------------+
|i12 : L = pullback(f, OO D)                               |
|                                                          |
|         1                                                |
|o12 = OO   (0, 6)                                         |
|        X                                                 |
|                                                          |
|o12 : coherent sheaf on X, free of rank 1                 |
+----------------------------------------------------------+
|i13 : D' = pullback(f, D)                                 |
|                                                          |
|o13 = 2*X  + 3*X  + X  + 3*X                              |
|         0      1    2      3                             |
|                                                          |
|o13 : ToricDivisor on X                                   |
+----------------------------------------------------------+
|i14 : OO D'                                               |
|                                                          |
|         1                                                |
|o14 = OO   (0, 6)                                         |
|        X                                                 |
|                                                          |
|o14 : coherent sheaf on X, free of rank 1                 |
+----------------------------------------------------------+
|i15 : assert (isWellDefined f and L === OO pullback(f, D))|
+----------------------------------------------------------+

Caveat
======

This method assumes that the target is smooth. One may verify this by using
isSmooth(NormalToricVariety).

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * inducedMap(ToricMap) -- make the induced
    map between total coordinate rings (a.k.a. Cox rings)
  * OO ToricDivisor -- make the associated rank-one
    reflexive sheaf
  * pullback(ToricMap,ToricDivisor)
    -- make the pullback of a Cartier
    divisor under a toric map

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

  * pullback(ToricMap,CoherentSheaf)
    -- make the pullback of a coherent
    sheaf under a toric map
  * "pullback(ToricMap,Module)"
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1526:0.

pullback(ToricMap,ToricDivisor) -- make the pullback of a Cartier divisor under a toric map
*******************************************************************************************

  * Function: pullback (Macaulay2Doc),
  * Usage:
        pullback(f, D)
  * Inputs:
      * f, a toric map,
      * D, a toric divisor, on the target of f that is
        Cartier
  * Outputs:
      * a toric divisor, the pullback of the divisor D
        under the map f

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

Torus-invariant Cartier divisors pullback under a toric map by composing the
toric map with the support function of the divisor. For more information, see
Proposition 6.2.7 in Cox-Little-Schenck's Toric Varieties.

As a first example, we consider the projection,
from a product, of
two projective lines, onto the first
factor.  The pullback of a point is just a fibre in the product.

+----------------------------------------------------------------+
|i1 : P = toricProjectiveSpace 1;                                |
+----------------------------------------------------------------+
|i2 : X = P ** P;                                                |
+----------------------------------------------------------------+
|i3 : f = X^[0]                                                  |
|                                                                |
|o3 = | 1 0 |                                                    |
|                                                                |
|o3 : ToricMap P <--- X                                          |
+----------------------------------------------------------------+
|i4 : pullback(f, P_0)                                           |
|                                                                |
|o4 = X                                                          |
|      0                                                         |
|                                                                |
|o4 : ToricDivisor on X                                          |
+----------------------------------------------------------------+
|i5 : pullback(f, 2*P_0 - 6*P_1)                                 |
|                                                                |
|o5 = 2*X  - 6*X                                                 |
|        0      1                                                |
|                                                                |
|o5 : ToricDivisor on X                                          |
+----------------------------------------------------------------+
|i6 : assert (isWellDefined f and f == map(P, X, matrix {{1,0}}))|
+----------------------------------------------------------------+

The next example illustrates that the pullback of a line through the origin in
affine plane, under the blowup map,
is a line together with the
exceptional divisor.

+---------------------------------+
|i7 : A = affineSpace 2, max A    |
|                                 |
|o7 = (A, {{0, 1}})               |
|                                 |
|o7 : Sequence                    |
+---------------------------------+
|i8 : B = toricBlowup({0,1}, A);  |
+---------------------------------+
|i9 : g = B^[]                    |
|                                 |
|o9 = | 1 0 |                     |
|     | 0 1 |                     |
|                                 |
|o9 : ToricMap A <--- B           |
+---------------------------------+
|i10 : pullback(g, A_0)           |
|                                 |
|o10 = B  + B                     |
|       0    2                    |
|                                 |
|o10 : ToricDivisor on B          |
+---------------------------------+
|i11 : pullback(g, -3*A_0 + 7*A_1)|
|                                 |
|o11 = - 3*B  + 7*B  + 4*B        |
|           0      1      2       |
|                                 |
|o11 : ToricDivisor on B          |
+---------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * isCartier(ToricDivisor) -- whether a
    torus-invariant Weil divisor is Cartier
  * pullback(ToricMap,CoherentSheaf)
    -- make the pullback of a coherent
    sheaf under a toric map

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

  * pullback(ToricMap,ToricDivisor)
    -- make the pullback of a Cartier
    divisor under a toric map
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1446:0.

rays(NormalToricVariety) -- get the rays of the associated fan
**************************************************************

  * Function: rays (Macaulay2Doc),
  * Usage:
        rays X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a list (Macaulay2Doc), of lists of integers; each entry
        corresponds to a minimal nonzero lattice point on the ray in the
        underlying fan

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

A normal toric variety corresponds to a strongly convex rational polyhedral fan
in affine space.  In this package, the fan associated to a normal
$d$-dimensional toric variety lies in the rational vector space $\QQ^d$ with
underlying lattice $N = {\ZZ}^d$.  As a result, each ray in the fan is
determined by the minimal nonzero lattice point it contains.  Each such lattice
point is given as a list (Macaulay2Doc), of $d$ See integers (Macaulay2Doc).

The examples show the rays for the projective plane, see projective $3$-space,
a Hirzebruch surface,
and a weighted projective space.
There is a canonical bijection between the
rays and torus-invariant Weil divisor on the toric variety.

+----------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;|
+----------------------------------+
|i2 : rays PP2                     |
|                                  |
|o2 = {{-1, -1}, {1, 0}, {0, 1}}   |
|                                  |
|o2 : List                         |
+----------------------------------+
|i3 : dim PP2                      |
|                                  |
|o3 = 2                            |
+----------------------------------+
|i4 : weilDivisorGroup PP2         |
|                                  |
|       3                          |
|o4 = ZZ                           |
|                                  |
|o4 : ZZ-module, free              |
+----------------------------------+
|i5 : PP2_0                        |
|                                  |
|o5 = PP2                          |
|        0                         |
|                                  |
|o5 : ToricDivisor on PP2          |
+----------------------------------+
+----------------------------------------------------+
|i6 : PP3 = toricProjectiveSpace 3;                  |
+----------------------------------------------------+
|i7 : rays PP3                                       |
|                                                    |
|o7 = {{-1, -1, -1}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}|
|                                                    |
|o7 : List                                           |
+----------------------------------------------------+
|i8 : dim PP3                                        |
|                                                    |
|o8 = 3                                              |
+----------------------------------------------------+
|i9 : weilDivisorGroup PP3                           |
|                                                    |
|       4                                            |
|o9 = ZZ                                             |
|                                                    |
|o9 : ZZ-module, free                                |
+----------------------------------------------------+
+----------------------------------------+
|i10 : FF7 = hirzebruchSurface 7;        |
+----------------------------------------+
|i11 : rays FF7                          |
|                                        |
|o11 = {{1, 0}, {0, 1}, {-1, 7}, {0, -1}}|
|                                        |
|o11 : List                              |
+----------------------------------------+
|i12 : dim FF7                           |
|                                        |
|o12 = 2                                 |
+----------------------------------------+
|i13 : weilDivisorGroup FF7              |
|                                        |
|        4                               |
|o13 = ZZ                                |
|                                        |
|o13 : ZZ-module, free                   |
+----------------------------------------+
+------------------------------------------+
|i14 : X = weightedProjectiveSpace {1,2,3};|
+------------------------------------------+
|i15 : rays X                              |
|                                          |
|o15 = {{-2, -3}, {1, 0}, {0, 1}}          |
|                                          |
|o15 : List                                |
+------------------------------------------+
|i16 : weilDivisorGroup X                  |
|                                          |
|        3                                 |
|o16 = ZZ                                  |
|                                          |
|o16 : ZZ-module, free                     |
+------------------------------------------+

When the normal toric variety is nondegenerate, the number of rays equals the
number of variables in the total coordinate ring.

+-------------------------------+
|i17 : #rays X == numgens ring X|
|                               |
|o17 = true                     |
+-------------------------------+

In this package, an ordered list of the minimal nonzero lattice points on the
rays in the fan is part of the defining data of a toric variety, so this method
does no computation.

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * max(NormalToricVariety) -- get the
    maximal cones in the associated fan
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)

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

  * rays(NormalToricVariety) -- get the
    rays of the associated fan
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1444:0.

resolving singularities -- information about find a smooth proper birational surjection
***************************************************************************************

A variety $X$ has a resolution of singularities if one can find a nonsingular
variety $Y$ and a proper birational map from $Y$ to $X$.  Every normal toric
variety has a resolution of singularities given by another normal toric
variety.

The following methods related to resolutions of singularities are currently
available in this package.

Methods for resolving singularities
===================================

  * makeSmooth(NormalToricVariety),
    -- make a birational smooth toric variety
  * makeSimplicial(NormalToricVariety)
    -- make a birational simplicial
    toric variety
  * toricBlowup(List,NormalToricVariety)
    -- makes the toricBlowup
    of a normal toric variety along a torus orbit closure

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * working with toric maps -- information
    about toric maps and the induced operations
  * working with divisors -- information about
    toric divisors and their related groups
  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:2020:0.

ring(NormalToricVariety) -- make the total coordinate ring (a.k.a. Cox ring)
****************************************************************************

  * Function: ring (Macaulay2Doc),
  * Usage:
        ring X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a polynomial ring (Macaulay2Doc), the total
        coordinate ring

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

The total coordinate ring, which is also known as the Cox ring, of a normal
toric variety is a polynomial ring in which the variables correspond to the
rays in the fan.  The map from the group of torus-invariant Weil divisors to
the class group endows this ring with a grading by the class group.
For more information, see Subsection 5.2
in Cox-Little-Schenck's Toric Varieties.

The total coordinate ring for projective space,
is the standard graded polynomial ring.

+----------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;                  |
+----------------------------------------------------+
|i2 : S = ring PP3;                                  |
+----------------------------------------------------+
|i3 : assert (isPolynomialRing S and isCommutative S)|
+----------------------------------------------------+
|i4 : gens S                                         |
|                                                    |
|o4 = {x , x , x , x }                               |
|       0   1   2   3                                |
|                                                    |
|o4 : List                                           |
+----------------------------------------------------+
|i5 : degrees S                                      |
|                                                    |
|o5 = {{1}, {1}, {1}, {1}}                           |
|                                                    |
|o5 : List                                           |
+----------------------------------------------------+
|i6 : assert (numgens S == #rays PP3)                |
+----------------------------------------------------+
|i7 : coefficientRing S                              |
|                                                    |
|o7 = QQ                                             |
|                                                    |
|o7 : Ring                                           |
+----------------------------------------------------+

For a product, of
projective spaces, the total coordinate ring has a bigrading.

+--------------------------------------------------------------+
|i8 : X = toricProjectiveSpace(2) ** toricProjectiveSpace(3);  |
+--------------------------------------------------------------+
|i9 : gens ring X                                              |
|                                                              |
|o9 = {x , x , x , x , x , x , x }                             |
|       0   1   2   3   4   5   6                              |
|                                                              |
|o9 : List                                                     |
+--------------------------------------------------------------+
|i10 : degrees ring X                                          |
|                                                              |
|o10 = {{1, 0}, {1, 0}, {1, 0}, {0, 1}, {0, 1}, {0, 1}, {0, 1}}|
|                                                              |
|o10 : List                                                    |
+--------------------------------------------------------------+

A Hirzebruch surface, also has a
$\ZZ^2$-grading.

+---------------------------------------+
|i11 : FF3 = hirzebruchSurface 3;       |
+---------------------------------------+
|i12 : gens ring FF3                    |
|                                       |
|o12 = {x , x , x , x }                 |
|        0   1   2   3                  |
|                                       |
|o12 : List                             |
+---------------------------------------+
|i13 : degrees ring FF3                 |
|                                       |
|o13 = {{1, 0}, {-3, 1}, {1, 0}, {0, 1}}|
|                                       |
|o13 : List                             |
+---------------------------------------+

To avoid duplicate computations, the attribute is cached in the normal toric
variety.  The variety is also cached in the ring.

Caveat
======

The total coordinate ring is not yet implemented when the toric variety is
degenerate, and is experimental when the class group has torsion.

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * classGroup -- make the class
    group
  * WeilToClass -- make a normal
    toric variety
  * fromWDivToCl(NormalToricVariety)
    -- get the map from the group of Weil
    divisors to the class group
  * ideal(NormalToricVariety) -- make the
    irrelevant ideal
  * sheaf(NormalToricVariety,Module)
    -- make a coherent sheaf

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

  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/SheavesDocumentation.m2:126:0.

sheaf(NormalToricVariety,Module) -- make a coherent sheaf
*********************************************************

  * Function: sheaf (Varieties),
  * Usage:
        sheaf (X, M)
  * Inputs:
      * X, a normal toric variety,
      * M, a module (Macaulay2Doc), a graded module over the
        total coordinate ring
  * Outputs:
      * a coherent sheaf (Varieties), the coherent sheaf
        on X corresponding to M

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

The category of coherent sheaves on a normal toric variety is equivalent to the
quotient category of finitely generated modules over the total coordinate ring,
by the full subcategory of torsion modules
with respect to the irrelevant ideal.  In
particular, each finitely generated module over the total coordinate ring
corresponds to coherent sheaf on the normal toric variety and every coherent
sheaf arises in this manner.  For more information, see Subsection 5.3 in
Cox-Little-Schenck's Toric Varieties.

Free modules correspond to reflexive sheaves.

+----------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;            |
+----------------------------------------------+
|i2 : F = sheaf (PP3, (ring PP3)^{{1},{2},{3}})|
|                                              |
|          1            1            1         |
|o2 = OO    (1) ++ OO    (2) ++ OO    (3)      |
|       PP3          PP3          PP3          |
|                                              |
|o2 : coherent sheaf on PP3, free of rank 3    |
+----------------------------------------------+
|i3 : FF7 = hirzebruchSurface 7;               |
+----------------------------------------------+
|i4 : G = sheaf (FF7, (ring FF7)^{{1,0},{0,1}})|
|                                              |
|          1                1                  |
|o4 = OO     (1, 0) ++ OO     (0, 1)           |
|       FF7              FF7                   |
|                                              |
|o4 : coherent sheaf on FF7, free of rank 2    |
+----------------------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
  * ideal(NormalToricVariety) -- make the
    irrelevant ideal
  * sheaf(NormalToricVariety), --
    make a coherent sheaf of rings

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

  * sheaf(NormalToricVariety,Module)
    -- make a coherent sheaf
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/SheavesDocumentation.m2:295:0.

sheaf(NormalToricVariety,Ring) -- make a coherent sheaf of rings
****************************************************************

  * Function: sheaf (Varieties),
  * Usage:
        sheaf (X, S)
  * Inputs:
      * X, a normal toric variety,
      * S, a ring (Macaulay2Doc), the total coordinate ring of X
  * Outputs:
      * a sheaf of rings (Varieties), the structure sheaf
        on X

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

The category of coherent sheaves on a normal toric variety is equivalent to the
quotient category of finitely generated modules over the total coordinate ring
by the full subcategory of torsion modules with respect to the irrelevant
ideal.  In particular, the total coordinate ring corresponds to the structure
sheaf. For more information, see Subsection 5.3 in Cox-Little-Schenck's Toric
Varieties.

On projective space, we can make the
structure sheaf in a few ways.

+----------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;|
+----------------------------------+
|i2 : F = sheaf (PP3, ring PP3)    |
|                                  |
|o2 = OO                           |
|       PP3                        |
|                                  |
|o2 : SheafOfRings                 |
+----------------------------------+
|i3 : G = sheaf PP3                |
|                                  |
|o3 = OO                           |
|       PP3                        |
|                                  |
|o3 : SheafOfRings                 |
+----------------------------------+
|i4 : assert (F === G)             |
+----------------------------------+
|i5 : H = OO_PP3                   |
|                                  |
|o5 = OO                           |
|       PP3                        |
|                                  |
|o5 : SheafOfRings                 |
+----------------------------------+
|i6 : assert (F === H)             |
+----------------------------------+

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
  * sheaf(NormalToricVariety,Module)
    -- make a coherent sheaf

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

  * "sheaf(NormalToricVariety)"
  * sheaf(NormalToricVariety,Ring),
    -- make a coherent sheaf of rings
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/SheavesDocumentation.m2:337:0.

smallAmpleToricDivisor(ZZ,ZZ) -- get a very ample toric divisor from the database
*********************************************************************************

  * Function: smallAmpleToricDivisor,
  * Usage:
        smallAmpleToricDivisor (d, i)
  * Inputs:
      * d, an integer (Macaulay2Doc), equal to dimension of the
        underlying toric variety
      * i, an integer (Macaulay2Doc), indexing the toric divisor in
        the database
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        that specifies the coefficient ring of the total coordinate ring
      * Variable => a symbol (Macaulay2Doc), default value x,
        that specifies the base symbol for the indexed variables in the total
        coordinate ring
      * WeilToClass => a matrix (Macaulay2Doc), default value
        null, that specifies the map from the group of torus-invariant Weil
        divisors to the class group of the underlying normal toric variety
  * Outputs:
      * a toric divisor, representing a very ample divisor
        that embeds the underlying smooth toric variety into a low-dimensional
        projective space

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

This method function accesses a database of equivalence classes of very ample
divisors that embed their underlying smooth toric varieties into
low-dimensional projective spaces.

The enumeration of the $41$ smooth projective toric surfaces embedding into at
most projective $11$-space follows the classification in [Tristram Bogart,
Christian Haase, Milena Hering, Benjamin Lorenz, Benjamin Nill Andreas
Paffenholz, Günter Rote, Francisco Santos, and Hal Schenck, Finitely many
smooth d-polytopes with n lattice points (see
https://dx.doi.org/10.1007/s11856-015-1175-7 ), Israel J. Math., 207 (2015)
301-329].

The enumeration of the $103$ smooth projective toric threefolds embedding into
at most projective $15$-space follows [Anders Lundman, A classification of
smooth convex 3-polytopes with at most 16 lattice points (see
https://dx.doi.org/10.1007/10.1007/s10801-012-0363-3 ), J. Algebr. Comb., 37
(2013) 139-165].

The first $2$ toric divisors over a surface lie over a product of projective
lines.

+-----------------------------------------------------------------------------+
|i1 : D1 = smallAmpleToricDivisor(2,0)                                        |
|                                                                             |
|o1 = 2*D  + 2*D                                                              |
|        1      3                                                             |
|                                                                             |
|o1 : ToricDivisor on normalToricVariety ({{1, 0}, {-1, 0}, {0, 1}, {0, -1}}, |
|-----------------------------------------------------------------------------|
|{{0, 2}, {0, 3}, {1, 2}, {1, 3}})                                            |
+-----------------------------------------------------------------------------+
|i2 : assert isVeryAmple D1                                                   |
+-----------------------------------------------------------------------------+
|i3 : X1 = variety D1;                                                        |
+-----------------------------------------------------------------------------+
|i4 : assert (isSmooth X1 and isProjective X1)                                |
+-----------------------------------------------------------------------------+
|i5 : rays X1                                                                 |
|                                                                             |
|o5 = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}                                      |
|                                                                             |
|o5 : List                                                                    |
+-----------------------------------------------------------------------------+
|i6 : D1                                                                      |
|                                                                             |
|o6 = 2*X1  + 2*X1                                                            |
|         1       3                                                           |
|                                                                             |
|o6 : ToricDivisor on X1                                                      |
+-----------------------------------------------------------------------------+
|i7 : latticePoints D1                                                        |
|                                                                             |
|o7 = | 0 1 2 0 1 2 0 1 2 |                                                   |
|     | 0 0 0 1 1 1 2 2 2 |                                                   |
|                                                                             |
|              2       9                                                      |
|o7 : Matrix ZZ  <-- ZZ                                                       |
+-----------------------------------------------------------------------------+
|i8 : D2 = smallAmpleToricDivisor (2,1);                                      |
|                                                                             |
|o8 : ToricDivisor on normalToricVariety ({{1, 0}, {-1, 0}, {0, 1}, {0, -1}}, |
|-----------------------------------------------------------------------------|
|{{0, 2}, {0, 3}, {1, 2}, {1, 3}})                                            |
+-----------------------------------------------------------------------------+
|i9 : assert isVeryAmple D2                                                   |
+-----------------------------------------------------------------------------+
|i10 : X2 = variety D2;                                                       |
+-----------------------------------------------------------------------------+
|i11 : assert (isSmooth X2 and isProjective X2)                               |
+-----------------------------------------------------------------------------+
|i12 : rays X2                                                                |
|                                                                             |
|o12 = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}}                                     |
|                                                                             |
|o12 : List                                                                   |
+-----------------------------------------------------------------------------+
|i13 : D2                                                                     |
|                                                                             |
|o13 = 3*X2  + 2*X2                                                           |
|          1       3                                                          |
|                                                                             |
|o13 : ToricDivisor on X2                                                     |
+-----------------------------------------------------------------------------+
|i14 : latticePoints D2                                                       |
|                                                                             |
|o14 = | 0 1 2 3 0 1 2 3 0 1 2 3 |                                            |
|      | 0 0 0 0 1 1 1 1 2 2 2 2 |                                            |
|                                                                             |
|               2       12                                                    |
|o14 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+

The $15$-th toric divisors on a surface lies over normal toric varieties with
$8$ irreducible torus-invariant divisors.

+-----------------------------------------------------------------------------+
|i15 : D3 = smallAmpleToricDivisor (2,15);                                    |
|                                                                             |
|o15 : ToricDivisor on normalToricVariety ({{1, 0}, {-1, 0}, {1, 2}, {0, 1},  |
|-----------------------------------------------------------------------------|
|{1, 1}, {0, -1}, {-1, -1}, {-1, -2}}, {{0, 4}, {0, 5}, {1, 3}, {1, 6}, {2,   |
|-----------------------------------------------------------------------------|
|3}, {2, 4}, {5, 7}, {6, 7}})                                                 |
+-----------------------------------------------------------------------------+
|i16 : assert isVeryAmple D3                                                  |
+-----------------------------------------------------------------------------+
|i17 : X3 = variety D3;                                                       |
+-----------------------------------------------------------------------------+
|i18 : assert (isSmooth X3 and isProjective X3)                               |
+-----------------------------------------------------------------------------+
|i19 : rays X3                                                                |
|                                                                             |
|o19 = {{1, 0}, {-1, 0}, {1, 2}, {0, 1}, {1, 1}, {0, -1}, {-1, -1}, {-1, -2}} |
|                                                                             |
|o19 : List                                                                   |
+-----------------------------------------------------------------------------+
|i20 : D3                                                                     |
|                                                                             |
|o20 = 3*X3  + X3  + X3  + 3*X3  + 2*X3  + 4*X3                               |
|          0     1     4       5       6       7                              |
|                                                                             |
|o20 : ToricDivisor on X3                                                     |
+-----------------------------------------------------------------------------+
|i21 : latticePoints D3                                                       |
|                                                                             |
|o21 = | 0 1 0 -2 -1 1 0 -3 -2 -1 -3 -2 |                                     |
|      | 0 0 1 1  1  1 2 2  2  2  3  3  |                                     |
|                                                                             |
|               2       12                                                    |
|o21 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+

Last, $25$ toric divisors on a surface lies over Hirzebruch surfaces.

+-----------------------------------------------------------------------------+
|i22 : D4 = smallAmpleToricDivisor (2,30);                                    |
|                                                                             |
|o22 : ToricDivisor on normalToricVariety ({{1, 0}, {-1, 0}, {0, 1}, {5, -1}},|
|-----------------------------------------------------------------------------|
|{{0, 2}, {0, 3}, {1, 2}, {1, 3}})                                            |
+-----------------------------------------------------------------------------+
|i23 : assert isVeryAmple D4                                                  |
+-----------------------------------------------------------------------------+
|i24 : X4 = variety D4;                                                       |
+-----------------------------------------------------------------------------+
|i25 : assert (isSmooth X4 and isProjective X4)                               |
+-----------------------------------------------------------------------------+
|i26 : rays X4                                                                |
|                                                                             |
|o26 = {{1, 0}, {-1, 0}, {0, 1}, {5, -1}}                                     |
|                                                                             |
|o26 : List                                                                   |
+-----------------------------------------------------------------------------+
|i27 : D4                                                                     |
|                                                                             |
|o27 = X4  + 2*X4                                                             |
|        1       3                                                            |
|                                                                             |
|o27 : ToricDivisor on X4                                                     |
+-----------------------------------------------------------------------------+
|i28 : latticePoints D4                                                       |
|                                                                             |
|o28 = | 0 1 0 1 0 1 1 1 1 1 1 |                                              |
|      | 0 0 1 1 2 2 3 4 5 6 7 |                                              |
|                                                                             |
|               2       11                                                    |
|o28 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+

The first $99$ toric divisors on a threefold embed a projective bundle into
projective space.

+-----------------------------------------------------------------------------+
|i29 : D5 = smallAmpleToricDivisor(3,75);                                     |
|                                                                             |
|o29 : ToricDivisor on normalToricVariety ({{1, 0, 0}, {-1, 0, 0}, {0, 1, 0}, |
|-----------------------------------------------------------------------------|
|{1, 1, 0}, {0, -1, 0}, {-1, -1, 0}, {0, 0, 1}, {0, 0, -1}}, {{0, 3, 6}, {0,  |
|-----------------------------------------------------------------------------|
|3, 7}, {0, 4, 6}, {0, 4, 7}, {1, 2, 6}, {1, 2, 7}, {1, 5, 6}, {1, 5, 7}, {2, |
|-----------------------------------------------------------------------------|
|3, 6}, {2, 3, 7}, {4, 5, 6}, {4, 5, 7}})                                     |
+-----------------------------------------------------------------------------+
|i30 : assert isVeryAmple D5                                                  |
+-----------------------------------------------------------------------------+
|i31 : X5 = variety D5;                                                       |
+-----------------------------------------------------------------------------+
|i32 : assert (isSmooth X5 and isProjective X5)                               |
+-----------------------------------------------------------------------------+
|i33 : assert (# rays X5 === 8)                                               |
+-----------------------------------------------------------------------------+
|i34 : D5                                                                     |
|                                                                             |
|o34 = 2*X5  + X5  + 2*X5  + X5  + X5                                         |
|          0     3       4     5     7                                        |
|                                                                             |
|o34 : ToricDivisor on X5                                                     |
+-----------------------------------------------------------------------------+
|i35 : latticePoints D5                                                       |
|                                                                             |
|o35 = | 0 -1 0 -2 -1 -2 -1 0 -1 0 -2 -1 -2 -1 |                              |
|      | 0 0  1 1  1  2  2  0 0  1 1  1  2  2  |                              |
|      | 0 0  0 0  0  0  0  1 1  1 1  1  1  1  |                              |
|                                                                             |
|               3       14                                                    |
|o35 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+

The last $4$ toric divisors on a threefold embed a blow-up of a projective
bundle at few points into projective space.

+-----------------------------------------------------------------------------+
|i36 : D6 = smallAmpleToricDivisor (3,102);                                   |
|                                                                             |
|o36 : ToricDivisor on normalToricVariety ({{1, 0, 0}, {0, 1, 0}, {0, -1, 0}, |
|-----------------------------------------------------------------------------|
|{0, 0, 1}, {1, 1, 1}, {-1, 0, -1}, {-1, -1, -1}}, {{0, 1, 4}, {0, 1, 5}, {0, |
|-----------------------------------------------------------------------------|
|2, 3}, {0, 2, 6}, {0, 3, 4}, {0, 5, 6}, {1, 3, 4}, {1, 3, 5}, {2, 3, 6}, {3, |
|-----------------------------------------------------------------------------|
|5, 6}})                                                                      |
+-----------------------------------------------------------------------------+
|i37 : assert(isVeryAmple D6)                                                 |
+-----------------------------------------------------------------------------+
|i38 : X6 = variety D6;                                                       |
+-----------------------------------------------------------------------------+
|i39 : assert (isSmooth X6 and isProjective X6)                               |
+-----------------------------------------------------------------------------+
|i40 : assert (# rays X6 === 7)                                               |
+-----------------------------------------------------------------------------+
|i41 : D6                                                                     |
|                                                                             |
|o41 = X6  + 2*X6  + X6  + 2*X6                                               |
|        0       2     5       6                                              |
|                                                                             |
|o41 : ToricDivisor on X6                                                     |
+-----------------------------------------------------------------------------+
|i42 : latticePoints D6                                                       |
|                                                                             |
|o42 = | 0 1 0 -1 1 0 -1 0 -1 0 -1 -1 -1 -1 |                                 |
|      | 0 0 1 1  1 2 2  0 0  1 1  2  0  1  |                                 |
|      | 0 0 0 0  0 0 0  1 1  1 1  1  2  2  |                                 |
|                                                                             |
|               3       14                                                    |
|o42 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+

Acknowledgements
================

We thank Milena Hering (see http://www.maths.ed.ac.uk/~mhering/ ) for her help
creating the database.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * toricDivisor(List,NormalToricVariety)
    -- make a torus-invariant Weil
    divisor
  * variety(ToricDivisor) -- get the
    underlying normal toric variety

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

  * smallAmpleToricDivisor(ZZ,ZZ),
    -- get a very ample toric divisor from the database
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1394:0.

smoothFanoToricVariety(ZZ,ZZ) -- get a smooth Fano toric variety from database
******************************************************************************

  * Function: smoothFanoToricVariety,
  * Usage:
        smoothFanoToricVariety (d,i)
  * Inputs:
      * d, an integer (Macaulay2Doc), equal to dimension of toric
        variety
      * i, an integer (Macaulay2Doc), indexing a normal toric variety
        in database
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        that specifies the coefficient ring of the total coordinate ring,
      * Variable => a symbol (Macaulay2Doc), default value x,
        that specifies the base name (Macaulay2Doc), for the
        indexed variables in the total coordinate ring
  * Outputs:
      * a normal toric variety, a smooth Fano toric
        variety

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

This function accesses a database of all smooth Fano toric varieties of
dimension at most $6$.  The enumeration of the toric varieties follows Victor
V. Batyrev's classification ( "On the classification of toric Fano", Journal of
Mathematical Sciences (New York), 94 (1999) 1021-1050, arXiv:math/9801107v2
(see http://arxiv.org/abs/math/9801107 ) and Hiroshi Sato's "Toward the
classification of higher-dimensional toric Fano varieties", The Tohoku
Mathematical Journal. Second Series, 52 (2000) 383-413, arXiv:math/9011022 (see
http://arxiv.org/abs/math/9911022 )) for dimension at most $4$ and Mikkel
Øbro's classification ( "An algorithm for the classification of smooth Fano
polytopes" arXiv:math/0704.0049v1 (see http://arxiv.org/abs/0704.0049 )) for
dimensions $5$ and $6$.

There is a unique smooth Fano toric curve, five smooth Fano toric surfaces,
eighteen smooth Fano toric threefolds, $124$ smooth Fano toric fourfolds, $866$
smooth Fano toric fivefolds, and $7622$ smooth Fano toric sixfolds.

For all $d$, smoothFanoToricVariety (d,0) yields projective $d$-space.

+-----------------------------------------------------------------------------+
|i1 : PP1 = smoothFanoToricVariety (1,0);                                     |
+-----------------------------------------------------------------------------+
|i2 : assert (rays PP1 === rays toricProjectiveSpace 1)                       |
+-----------------------------------------------------------------------------+
|i3 : assert (max PP1 === max toricProjectiveSpace 1)                         |
+-----------------------------------------------------------------------------+
|i4 : PP4 = smoothFanoToricVariety (4,0, CoefficientRing => ZZ/32003, Variable|
|-----------------------------------------------------------------------------|
|=> y);                                                                       |
+-----------------------------------------------------------------------------+
|i5 : assert (rays PP4 === rays toricProjectiveSpace 4)                       |
+-----------------------------------------------------------------------------+
|i6 : assert (max PP4 === max toricProjectiveSpace 4)                         |
+-----------------------------------------------------------------------------+

The following example was missing from Batyrev's table.

+-----------------------------------------------------------------------------+
|i7 : W = smoothFanoToricVariety (4,123);                                     |
+-----------------------------------------------------------------------------+
|i8 : rays W                                                                  |
|                                                                             |
|o8 = {{1, 0, 0, 0}, {0, 1, 0, 0}, {-1, -1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1},|
|     ------------------------------------------------------------------------|
|     {0, 0, -1, -1}, {1, 0, 1, 0}, {0, 1, 0, 1}, {-1, -1, -1, -1}}           |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : max W                                                                   |
|                                                                             |
|o9 = {{0, 1, 5, 6}, {0, 1, 5, 7}, {0, 1, 6, 7}, {0, 2, 4, 6}, {0, 2, 4, 8},  |
|     ------------------------------------------------------------------------|
|     {0, 2, 6, 8}, {0, 4, 5, 7}, {0, 4, 5, 8}, {0, 4, 6, 7}, {0, 5, 6, 8},   |
|     ------------------------------------------------------------------------|
|     {1, 2, 3, 7}, {1, 2, 3, 8}, {1, 2, 7, 8}, {1, 3, 5, 6}, {1, 3, 5, 8},   |
|     ------------------------------------------------------------------------|
|     {1, 3, 6, 7}, {1, 5, 7, 8}, {2, 3, 4, 6}, {2, 3, 4, 7}, {2, 3, 6, 8},   |
|     ------------------------------------------------------------------------|
|     {2, 4, 7, 8}, {3, 4, 6, 7}, {3, 5, 6, 8}, {4, 5, 7, 8}}                 |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+

Acknowledgements
================

We thank Gavin Brown (see http://homepages.warwick.ac.uk/staff/G.Brown/ ) and
Alexander Kasprzyk (see http://magma.maths.usyd.edu.au/users/kasprzyk/ ) for
their help extracting the data for the smooth Fano toric five and sixfolds from
their Graded Rings Database (see http://www.grdb.co.uk ).

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * normalToricVariety -- make a
    normal toric variety
  * isFano(NormalToricVariety), --
    whether a normal toric variety is Fano

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

  * smoothFanoToricVariety(ZZ,ZZ),
    -- get a smooth Fano toric variety from database
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:1181:0.

source(ToricMap) -- get the source of the map
*********************************************

  * Function: source (Macaulay2Doc),
  * Usage:
        X = source f
  * Inputs:
      * f, a toric map,
  * Outputs:
      * X, a normal toric variety, that is the
        source of the map f

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

Given a toric map $f : X \to Y$, this method returns the normal toric variety
$X$.

We illustrate how to access this defining feature of a toric map with the
projection from the second Hirzebruch surface,
to the projective line.

+------------------------------------------------+
|i1 : X = hirzebruchSurface 2;                   |
+------------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;                |
+------------------------------------------------+
|i3 : f = map(Y, X, matrix {{1, 0}})             |
|                                                |
|o3 = | 1 0 |                                    |
|                                                |
|o3 : ToricMap Y <--- X                          |
+------------------------------------------------+
|i4 : source f                                   |
|                                                |
|o4 = X                                          |
|                                                |
|o4 : NormalToricVariety                         |
+------------------------------------------------+
|i5 : assert (isWellDefined f and source f === X)|
+------------------------------------------------+

Any normal toric variety is the source of its diagonal map.

+-----------------------------------------------------------------------------+
|i6 : delta = diagonalToricMap X;                                             |
|                                                                             |
|o6 : ToricMap normalToricVariety ({{1, 0, 0, 0}, {0, 1, 0, 0}, {-1, 2, 0, 0},|
|-----------------------------------------------------------------------------|
|{0, -1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, 1}, {0, 0, -1, 2}, {0, 0, 0, -1}},    |
|-----------------------------------------------------------------------------|
|{{0, 1, 4, 5}, {0, 1, 4, 7}, {0, 1, 5, 6}, {0, 1, 6, 7}, {0, 3, 4, 5}, {0, 3,|
|-----------------------------------------------------------------------------|
|4, 7}, {0, 3, 5, 6}, {0, 3, 6, 7}, {1, 2, 4, 5}, {1, 2, 4, 7}, {1, 2, 5, 6}, |
|-----------------------------------------------------------------------------|
|{1, 2, 6, 7}, {2, 3, 4, 5}, {2, 3, 4, 7}, {2, 3, 5, 6}, {2, 3, 6, 7}}) <--- X|
+-----------------------------------------------------------------------------+
|i7 : source delta                                                            |
|                                                                             |
|o7 = X                                                                       |
|                                                                             |
|o7 : NormalToricVariety                                                      |
+-----------------------------------------------------------------------------+
|i8 : assert (isWellDefined delta and source delta === X)                     |
+-----------------------------------------------------------------------------+

In a well-defined toric map, the number of columns in the underlying matrix
equals the dimension of the source.

+----------------------------------------------+
|i9 : assert (numColumns matrix delta == dim X)|
+----------------------------------------------+

Since this is a defining attribute of a toric map, no computation is required.

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * target(ToricMap) -- get the target of the map
  * matrix(ToricMap) -- get the underlying map of
    lattices
  * isWellDefined(ToricMap) -- whether a
    toric map is well defined
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties

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

  * source(ToricMap) -- get the source of the map
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:155:0.

support(ToricDivisor) -- make the list of irreducible divisors with nonzero coefficients
****************************************************************************************

  * Function: support (Macaulay2Doc),
  * Usage:
        support D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a list (Macaulay2Doc), indexing the irreducible
        torus-invariant divisors whose coefficient in D are nonzero

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

The support of a torus-invariant Weil divisor is the set of irreducible
torus-invariant divisors which appear with nonzero coefficients in the unique
expression for this divisor.  In this package, we encode this information by
indexing the irreducible torus-invariantdivisors that appear with a nonzero
coefficient. The indexing of the irreducible torus-invariant divisors is
inherited from the indexing of the rays in the associated fan.

+-------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;   |
+-------------------------------------+
|i2 : D1 = 2*PP2_0 - 7*PP2_1 + 3*PP2_2|
|                                     |
|o2 = 2*PP2  - 7*PP2  + 3*PP2         |
|          0        1        2        |
|                                     |
|o2 : ToricDivisor on PP2             |
+-------------------------------------+
|i3 : support D1                      |
|                                     |
|o3 = {0, 1, 2}                       |
|                                     |
|o3 : List                            |
+-------------------------------------+
|i4 : D2 = PP2_0-5*PP2_2              |
|                                     |
|o4 = PP2  - 5*PP2                    |
|        0        2                   |
|                                     |
|o4 : ToricDivisor on PP2             |
+-------------------------------------+
|i5 : support D2                      |
|                                     |
|o5 = {0, 2}                          |
|                                     |
|o5 : List                            |
+-------------------------------------+
|i6 : support (6*PP2_1)               |
|                                     |
|o6 = {1}                             |
|                                     |
|o6 : List                            |
+-------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * rays(NormalToricVariety) -- get the
    rays of the associated fan
  * entries(ToricDivisor) -- get the list of
    coefficients

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

  * support(ToricDivisor) -- make the list of
    irreducible divisors with nonzero coefficients
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:927:0.

target(ToricMap) -- get the target of the map
*********************************************

  * Function: target (Macaulay2Doc),
  * Usage:
        Y = target f
  * Inputs:
      * f, a toric map,
  * Outputs:
      * Y, a normal toric variety, that is the
        target of the map f

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

Given a toric map $f : X \to Y$, this method returns the normal toric variety
$Y$.

We illustrate how to access this defining feature of a toric map with the
projection from the second Hirzebruch surface,
to the projective line.

+------------------------------------------------+
|i1 : X = hirzebruchSurface 2;                   |
+------------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;                |
+------------------------------------------------+
|i3 : f = map(Y, X, matrix {{1, 0}})             |
|                                                |
|o3 = | 1 0 |                                    |
|                                                |
|o3 : ToricMap Y <--- X                          |
+------------------------------------------------+
|i4 : target f                                   |
|                                                |
|o4 = Y                                          |
|                                                |
|o4 : NormalToricVariety                         |
+------------------------------------------------+
|i5 : assert (isWellDefined f and target f === Y)|
+------------------------------------------------+

Any normal toric variety is the target of the projection,
onto a factor of its Cartesian square.

+-----------------------------------------------------+
|i6 : X2 = X ** X                                     |
|                                                     |
|o6 = X2                                              |
|                                                     |
|o6 : NormalToricVariety                              |
+-----------------------------------------------------+
|i7 : pi0 = X2^[0]                                    |
|                                                     |
|o7 = | 1 0 0 0 |                                     |
|     | 0 1 0 0 |                                     |
|                                                     |
|o7 : ToricMap X <--- X2                              |
+-----------------------------------------------------+
|i8 : target pi0                                      |
|                                                     |
|o8 = X                                               |
|                                                     |
|o8 : NormalToricVariety                              |
+-----------------------------------------------------+
|i9 : assert (isWellDefined pi0 and target pi0 === X) |
+-----------------------------------------------------+
|i10 : pi1 = X2^[1]                                   |
|                                                     |
|o10 = | 0 0 1 0 |                                    |
|      | 0 0 0 1 |                                    |
|                                                     |
|o10 : ToricMap X <--- X2                             |
+-----------------------------------------------------+
|i11 : target pi1                                     |
|                                                     |
|o11 = X                                              |
|                                                     |
|o11 : NormalToricVariety                             |
+-----------------------------------------------------+
|i12 : assert (isWellDefined pi1 and target pi1 === X)|
+-----------------------------------------------------+

In a well-defined toric map, the number of rows in the underlying matrix equals
the dimension of the target.

+----------------------------------------+
|i13 : assert (numRows matrix f == dim Y)|
+----------------------------------------+

Since this is a defining attribute of a toric map, no computation is required.

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * source(ToricMap) -- get the source of the map
  * matrix(ToricMap) -- get the underlying map of
    lattices
  * isWellDefined(ToricMap) -- whether a
    toric map is well defined
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties
  * NormalToricVariety ^ Array -- make a
    canonical projection map

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

  * target(ToricMap) -- get the target of the map
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:213:0.

todd(CoherentSheaf) -- compute the Todd class of a coherent sheaf
*****************************************************************

  * Function: todd (Schubert2),
  * Usage:
        todd F
  * Inputs:
      * F, a coherent sheaf (Varieties), on a complete
        simplicial normal toric variety
  * Outputs:
      * a ring element (Macaulay2Doc), in the intersection
        ring of the underlying variety

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

Given a locally-free sheaf $E$ of rank $r$ on a smooth variety such that its
Chern class formally factor as chern $E = \prod_{j=1}^r (1 + \alpha_j)$, we
define its Todd class to be todd $E := \prod_{j=1}^r \alpha_j / [1-
exp(-\alpha_j)]$ written as a polynomial in the elementary symmetric functions
chern $(i, E)$ of the $\alpha_j$.

The first few components of the Todd class are easily related to Chern classes.

+-----------------------------------------------------------------------------+
|i1 : X0 = kleinschmidt(4, {1,3,5});                                          |
+-----------------------------------------------------------------------------+
|i2 : E0 = cotangentSheaf X0                                                  |
|                                                                             |
|o2 = cokernel {2, 0}  | 2x_2x_3 4x_1x_3 5x_0x_3 0     0    2x_1x_2 0         |
|              {-7, 2} | x_4     0       0       0     x_1  0       0         |
|              {-7, 2} | -x_5    0       0       0     0    0       0         |
|              {-5, 2} | 0       x_4     0       x_2   0    0       0         |
|              {-5, 2} | 0       -x_5    0       0     0    0       x_2       |
|              {-4, 2} | 0       0       x_4     0     0    0       0         |
|              {-4, 2} | 0       0       -x_5    0     0    0       0         |
|              {-3, 2} | 0       0       0       -2x_3 -x_3 x_4     0         |
|              {-9, 3} | 0       0       0       -x_5  -x_5 0       -x_4      |
|              {-3, 2} | 0       0       0       0     0    -x_5    -2x_3     |
|              {-2, 2} | 0       0       0       0     0    0       0         |
|              {-8, 3} | 0       0       0       0     0    0       0         |
|              {-2, 2} | 0       0       0       0     0    0       0         |
|              {0, 2}  | 0       0       0       0     0    0       0         |
|              {-6, 3} | 0       0       0       0     0    0       0         |
|              {0, 2}  | 0       0       0       0     0    0       0         |
|              {-4, 3} | 0       0       0       0     0    0       0         |
|                                                                             |
|                                           1                2                |
|o2 : coherent sheaf on X0, quotient of OO    (-2, 0) ++ OO    (7, -2) ++     |
|                                         X0               X0                 |
|-----------------------------------------------------------------------------|
|0    0     0     3x_0x_2 0     0     0     0     x_0x_1 0     0     0        |
|0    0     3x_0  0       0     0     0     0     0      0     0     0        |
|x_1  0     0     0       0     3x_0  0     0     0      0     0     0        |
|0    0     0     0       0     0     0     x_0   0      0     0     0        |
|0    0     0     0       0     0     0     0     0      0     x_0   0        |
|0    3x_2  0     0       0     0     x_1   0     0      0     0     0        |
|0    0     0     0       3x_2  0     0     0     0      x_1   0     0        |
|0    0     0     0       0     0     0     0     0      0     0     0        |
|-x_4 0     0     0       0     0     0     0     0      0     0     0        |
|-x_3 0     0     0       0     0     0     0     0      0     0     0        |
|0    -5x_3 -2x_3 x_4     0     0     0     0     0      0     0     x_1      |
|0    -x_5  -x_5  0       -x_4  -x_4  0     0     0      0     0     0        |
|0    0     0     -x_5    -5x_3 -2x_3 0     0     0      0     0     0        |
|0    0     0     0       0     0     -5x_3 -4x_3 x_4    0     0     -3x_2    |
|0    0     0     0       0     0     -x_5  -x_5  0      -x_4  -x_4  0        |
|0    0     0     0       0     0     0     0     -x_5   -5x_3 -4x_3 0        |
|0    0     0     0       0     0     0     0     0      0     0     -x_5     |
|                                                                             |
|    2                2                1                1                1    |
|OO    (5, -2) ++ OO    (4, -2) ++ OO    (3, -2) ++ OO    (9, -3) ++ OO       |
|  X0               X0               X0               X0               X0     |
|-----------------------------------------------------------------------------|
|0     0     0     0    0     |                                               |
|0     0     0     0    0     |                                               |
|0     0     0     0    0     |                                               |
|0     0     0     0    0     |                                               |
|0     0     0     0    0     |                                               |
|0     0     0     0    0     |                                               |
|0     0     0     0    0     |                                               |
|x_0   0     0     0    0     |                                               |
|0     0     0     x_0  0     |                                               |
|0     0     x_0   0    0     |                                               |
|0     0     0     0    0     |                                               |
|0     0     0     0    x_1   |                                               |
|0     x_1   0     0    0     |                                               |
|-2x_2 0     0     0    0     |                                               |
|0     0     0     -x_2 -3x_2 |                                               |
|0     -3x_2 -2x_2 0    0     |                                               |
|-x_5  -x_4  -x_4  2x_3 5x_3  |                                               |
|                                                                             |
|               1                1                1                1          |
|(3, -2) ++ OO    (2, -2) ++ OO    (8, -3) ++ OO    (2, -2) ++ OO    (0, -2)  |
|             X0               X0               X0               X0           |
|-----------------------------------------------------------------------------|
|       1                1                1                                   |
|++ OO    (6, -3) ++ OO    (0, -2) ++ OO    (4, -3)                           |
|     X0               X0               X0                                    |
+-----------------------------------------------------------------------------+
|i3 : A0 = intersectionRing X0;                                               |
+-----------------------------------------------------------------------------+
|i4 : todd E0                                                                 |
|                                                                             |
|                  13       11 2   145            3   121 2       3           |
|o4 = 1 + (- 2t  - --t ) + (--t  + ---t t ) + (- t  - ---t t ) + t t          |
|              3    2 5      6 3    12 3 5        3    12 3 5     3 5         |
|                                                                             |
|o4 : A0                                                                      |
+-----------------------------------------------------------------------------+
|i5 : assert (part (0, todd E0) == 1)                                         |
+-----------------------------------------------------------------------------+
|i6 : assert (part (1, todd E0) === (1/2) * chern (1, E0))                    |
+-----------------------------------------------------------------------------+
|i7 : assert (part (2, todd E0) === (1/12)*((chern (1, E0))^2 + chern (2,     |
|-----------------------------------------------------------------------------|
|E0)))                                                                        |
+-----------------------------------------------------------------------------+

On a complete smooth normal toric variety, the Todd class of the tangent bundle
factors as a product over the irreducible torus-invariant divisors.

+-----------------------------------------------------------------------------+
|i8 : X1 = smoothFanoToricVariety (3, 12);                                    |
+-----------------------------------------------------------------------------+
|i9 : E1 = dual cotangentSheaf X1                                             |
|                                                                             |
|o9 = image {0, 0, -2, 0} | 0          0                                      |
|           {0, -2, 0, 0} | 0          -x_6                                   |
|           {-2, 0, 0, 0} | -x_3x_6    0                                      |
|           {-2, 0, 0, 0} | x_2x_6     0                                      |
|           {0, 0, 0, -2} | -x_1x_3x_4 -x_0x_3x_5                             |
|           {0, 0, 0, -2} | x_1x_2x_4  x_0x_2x_5                              |
|                                                                             |
|                                           1                                 |
|o9 : coherent sheaf on X1, subsheaf of OO    (0,                             |
|                                         X1                                  |
|-----------------------------------------------------------------------------|
|0          x_2          x_3          |                                       |
|x_1x_4     0            0            |                                       |
|-x_0x_3x_5 x_0x_5x_6    0            |                                       |
|x_0x_2x_5  0            x_0x_5x_6    |                                       |
|0          x_0x_1x_4x_5 0            |                                       |
|0          0            x_0x_1x_4x_5 |                                       |
|                                                                             |
|                1                     2                     2                |
|0, 2, 0) ++ OO    (0, 2, 0, 0) ++ OO    (2, 0, 0, 0) ++ OO    (0, 0, 0, 2)   |
|              X1                    X1                    X1                 |
+-----------------------------------------------------------------------------+
|i10 : A1 = intersectionRing X1;                                              |
+-----------------------------------------------------------------------------+
|i11 : f1 = todd E1                                                           |
|                                                                             |
|           3               1       3        2   2       2 2     3            |
|o11 = 1 + (-t  + t  + t  + -t ) + (-t t  - t  - -t t  - -t ) + t             |
|           2 3    4    5   2 6     2 3 4    5   3 5 6   3 6     6            |
|                                                                             |
|o11 : A1                                                                     |
+-----------------------------------------------------------------------------+
|i12 : assert (f1 === product(# rays X1, i -> todd OO (X1_i)))                |
+-----------------------------------------------------------------------------+

Applying todd to a normal toric variety is the same as applying it to the
tangent sheaf of the variety.

See also
========

  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * chi(CoherentSheaf) (missing documentation)
  * hilbertPolynomial(NormalToricVariety,CoherentSheaf)
    -- compute the
    multivariate Hilbert polynomial
  * intersectionRing(NormalToricVariety) -- make the rational
    Chow ring

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

  * todd(CoherentSheaf) -- compute the Todd
    class of a coherent sheaf
  * "todd(NormalToricVariety)"
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ChowDocumentation.m2:501:0.

toricBlowup(List,NormalToricVariety,List) -- makes the toricBlowup of a normal toric variety along a torus orbit closure
************************************************************************************************************************

  * Function: toricBlowup,
  * Usage:
        toricBlowup (s, X, v)
  * Inputs:
      * s, a list (Macaulay2Doc), of integers indexing a proper
        torus orbit
      * X, a normal toric variety,
      * v, a list (Macaulay2Doc), of integers giving a vector in
        the relative interior of the cone corresponding to s (optional)
  * Optional inputs (Macaulay2Doc),:
      * WeilToClass (missing documentation) => ..., default value null,
  * Outputs:
      * a normal toric variety, obtained by blowing
        up X along the torus orbit indexed by s

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

Roughly speaking, the toricBlowup replaces a subspace of a given space with all
the directions pointing out of that subspace.  The metaphor is inflation of a
balloon rather than an explosion.  A toricBlowup is the universal way to turn a
subvariety into a Cartier divisor.

The toricBlowup of a normal toric variety along a torus orbit closure is also a
normal toric variety.  The fan associated to the toricBlowup is star
subdivision or stellar subdivision of the fan of the original toric variety.
More precisely, we throw out the star of the cone corresponding to s and join a
vector v lying the relative interior to the boundary of the star.  When the
vector v is not specified, the ray corresponding to the sum of all rays in the
cone corresponding to s is used.

The simplest example is toricBlowup of the origin in the affine plane. Note
that the new ray has the largest index.

+------------------------------------+
|i1 : AA2 = affineSpace 2;           |
+------------------------------------+
|i2 : rays AA2                       |
|                                    |
|o2 = {{1, 0}, {0, 1}}               |
|                                    |
|o2 : List                           |
+------------------------------------+
|i3 : max AA2                        |
|                                    |
|o3 = {{0, 1}}                       |
|                                    |
|o3 : List                           |
+------------------------------------+
|i4 : Bl0 = toricBlowup ({0,1}, AA2);|
+------------------------------------+
|i5 : rays Bl0                       |
|                                    |
|o5 = {{1, 0}, {0, 1}, {1, 1}}       |
|                                    |
|o5 : List                           |
+------------------------------------+
|i6 : max Bl0                        |
|                                    |
|o6 = {{0, 2}, {1, 2}}               |
|                                    |
|o6 : List                           |
+------------------------------------+

Here are a few different toricBlowups of a non-simplicial affine toric variety

+-----------------------------------------------------------------------------+
|i7 : C = normalToricVariety ({{1,0,0},{1,1,0},{1,0,1},{1,1,1}}, {{0,1,2,3}});|
+-----------------------------------------------------------------------------+
|i8 : assert not isSimplicial C                                               |
+-----------------------------------------------------------------------------+
|i9 : Bl1 = toricBlowup ({0,1,2,3}, C);                                       |
+-----------------------------------------------------------------------------+
|i10 : rays Bl1                                                               |
|                                                                             |
|o10 = {{1, 0, 0}, {1, 1, 0}, {1, 0, 1}, {1, 1, 1}, {2, 1, 1}}                |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+
|i11 : max Bl1                                                                |
|                                                                             |
|o11 = {{0, 1, 4}, {0, 2, 4}, {1, 3, 4}, {2, 3, 4}}                           |
|                                                                             |
|o11 : List                                                                   |
+-----------------------------------------------------------------------------+
|i12 : assert isSimplicial Bl1                                                |
+-----------------------------------------------------------------------------+
|i13 : Bl2 = toricBlowup ({0,1}, C);                                          |
+-----------------------------------------------------------------------------+
|i14 : rays Bl2                                                               |
|                                                                             |
|o14 = {{1, 0, 0}, {1, 1, 0}, {1, 0, 1}, {1, 1, 1}, {2, 1, 0}}                |
|                                                                             |
|o14 : List                                                                   |
+-----------------------------------------------------------------------------+
|i15 : max Bl2                                                                |
|                                                                             |
|o15 = {{0, 2, 4}, {1, 3, 4}, {2, 3, 4}}                                      |
|                                                                             |
|o15 : List                                                                   |
+-----------------------------------------------------------------------------+
|i16 : assert isSimplicial Bl2                                                |
+-----------------------------------------------------------------------------+
|i17 : assert (rays Bl1 =!= rays Bl2 and max Bl1 =!= max Bl2)                 |
+-----------------------------------------------------------------------------+
|i18 : Bl3 = toricBlowup ({0,1,2,3}, C, {5,3,4});                             |
+-----------------------------------------------------------------------------+
|i19 : rays Bl3                                                               |
|                                                                             |
|o19 = {{1, 0, 0}, {1, 1, 0}, {1, 0, 1}, {1, 1, 1}, {5, 3, 4}}                |
|                                                                             |
|o19 : List                                                                   |
+-----------------------------------------------------------------------------+
|i20 : max Bl3                                                                |
|                                                                             |
|o20 = {{0, 1, 4}, {0, 2, 4}, {1, 3, 4}, {2, 3, 4}}                           |
|                                                                             |
|o20 : List                                                                   |
+-----------------------------------------------------------------------------+
|i21 : assert isSimplicial Bl3                                                |
+-----------------------------------------------------------------------------+
|i22 : Bl4 = toricBlowup ({0}, C);                                            |
+-----------------------------------------------------------------------------+
|i23 : rays Bl4                                                               |
|                                                                             |
|o23 = {{1, 0, 0}, {1, 1, 0}, {1, 0, 1}, {1, 1, 1}}                           |
|                                                                             |
|o23 : List                                                                   |
+-----------------------------------------------------------------------------+
|i24 : max Bl4                                                                |
|                                                                             |
|o24 = {{0, 1, 3}, {0, 2, 3}}                                                 |
|                                                                             |
|o24 : List                                                                   |
+-----------------------------------------------------------------------------+
|i25 : assert isSimplicial Bl4                                                |
+-----------------------------------------------------------------------------+

The third collection of examples illustrate some toricBlowups of a
non-simplicial projective toric variety.

+-----------------------------------------------------------------------------+
|i26 : X = normalToricVariety (id_(ZZ^3) | (-id_(ZZ^3)));                     |
+-----------------------------------------------------------------------------+
|i27 : rays X                                                                 |
|                                                                             |
|o27 = {{1, 1, 1}, {-1, 1, 1}, {1, -1, 1}, {-1, -1, 1}, {1, 1, -1}, {-1, 1,   |
|      -----------------------------------------------------------------------|
|      -1}, {1, -1, -1}, {-1, -1, -1}}                                        |
|                                                                             |
|o27 : List                                                                   |
+-----------------------------------------------------------------------------+
|i28 : max X                                                                  |
|                                                                             |
|o28 = {{0, 1, 2, 3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, {2, 3, 6, 7}, |
|      -----------------------------------------------------------------------|
|      {4, 5, 6, 7}}                                                          |
|                                                                             |
|o28 : List                                                                   |
+-----------------------------------------------------------------------------+
|i29 : assert (not isSimplicial X and isProjective X)                         |
+-----------------------------------------------------------------------------+
|i30 : orbits (X,1)                                                           |
|                                                                             |
|o30 = {{0, 1}, {0, 2}, {0, 4}, {1, 3}, {1, 5}, {2, 3}, {2, 6}, {3, 7}, {4,   |
|      -----------------------------------------------------------------------|
|      5}, {4, 6}, {5, 7}, {6, 7}}                                            |
|                                                                             |
|o30 : List                                                                   |
+-----------------------------------------------------------------------------+
|i31 : Bl5 = toricBlowup ({0,2}, X);                                          |
+-----------------------------------------------------------------------------+
|i32 : Bl6 = toricBlowup ({6,7}, Bl5);                                        |
+-----------------------------------------------------------------------------+
|i33 : Bl7 = toricBlowup ({1,5}, Bl6);                                        |
+-----------------------------------------------------------------------------+
|i34 : rays Bl7                                                               |
|                                                                             |
|o34 = {{1, 1, 1}, {-1, 1, 1}, {1, -1, 1}, {-1, -1, 1}, {1, 1, -1}, {-1, 1,   |
|      -----------------------------------------------------------------------|
|      -1}, {1, -1, -1}, {-1, -1, -1}, {1, 0, 1}, {0, -1, -1}, {-1, 1, 0}}    |
|                                                                             |
|o34 : List                                                                   |
+-----------------------------------------------------------------------------+
|i35 : max Bl7                                                                |
|                                                                             |
|o35 = {{0, 1, 8}, {0, 1, 10}, {0, 4, 8}, {0, 4, 10}, {1, 3, 8}, {1, 3, 10},  |
|      -----------------------------------------------------------------------|
|      {2, 3, 8}, {2, 3, 9}, {2, 6, 8}, {2, 6, 9}, {3, 7, 9}, {3, 7, 10}, {4, |
|      -----------------------------------------------------------------------|
|      5, 9}, {4, 5, 10}, {4, 6, 8}, {4, 6, 9}, {5, 7, 9}, {5, 7, 10}}        |
|                                                                             |
|o35 : List                                                                   |
+-----------------------------------------------------------------------------+
|i36 : assert (isSimplicial Bl7 and isProjective Bl7)                         |
+-----------------------------------------------------------------------------+
|i37 : Bl8 = toricBlowup ({0}, X);                                            |
+-----------------------------------------------------------------------------+
|i38 : Bl9 = toricBlowup ({7}, Bl8);                                          |
+-----------------------------------------------------------------------------+
|i39 : assert (rays Bl9 === rays X)                                           |
+-----------------------------------------------------------------------------+
|i40 : assert (isSimplicial Bl9 and isProjective Bl9)                         |
+-----------------------------------------------------------------------------+

Caveat
======

The method assumes that the list v corresponds to a primitive vector.  In other
words, the greatest common divisor of its entries is one.  The method also
assumes that v lies in the relative interior of the cone corresponding to s.
If either of these conditions fail, then the output will not necessarily be a
well-defined normal toric variety.

See also
========

  * resolving singularities -- information
    about find a smooth proper birational surjection
  * orbits(NormalToricVariety) -- make a
    hashtable indexing the torus orbits (a.k.a. cones in the fan)
  * isWellDefined(NormalToricVariety)
    -- whether a toric variety is
    well-defined
  * makeSmooth(NormalToricVariety),
    -- make a birational smooth toric variety

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

  * "toricBlowup(List,NormalToricVariety)"
  * toricBlowup(List,NormalToricVariety,List)
    -- makes the toricBlowup
    of a normal toric variety along a torus orbit closure
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:2192:0.

ToricDivisor -- the class of all torus-invariant Weil divisors
**************************************************************

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

A torus-invariant Weil divisor on a normal toric variety is an integral linear
combination of the irreducible torus-invariant divisors.  The irreducible
torus-invariant divisors correspond to the rays.  In this package, the rays are
ordered and indexed by the nonnegative integers.

The first examples illustrates some torus-invariant Weil divisors on projective
$2$-space.

+--------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;    |
+--------------------------------------+
|i2 : D1 = toricDivisor ({2,-7,3}, PP2)|
|                                      |
|o2 = 2*PP2  - 7*PP2  + 3*PP2          |
|          0        1        2         |
|                                      |
|o2 : ToricDivisor on PP2              |
+--------------------------------------+
|i3 : D2 = 2*PP2_0 + 4*PP2_2           |
|                                      |
|o3 = 2*PP2  + 4*PP2                   |
|          0        2                  |
|                                      |
|o3 : ToricDivisor on PP2              |
+--------------------------------------+
|i4 : D1+D2                            |
|                                      |
|o4 = 4*PP2  - 7*PP2  + 7*PP2          |
|          0        1        2         |
|                                      |
|o4 : ToricDivisor on PP2              |
+--------------------------------------+
|i5 : D1-D2                            |
|                                      |
|o5 = - 7*PP2  - PP2                   |
|            1      2                  |
|                                      |
|o5 : ToricDivisor on PP2              |
+--------------------------------------+
|i6 : K = toricDivisor PP2             |
|                                      |
|o6 = - PP2  - PP2  - PP2              |
|          0      1      2             |
|                                      |
|o6 : ToricDivisor on PP2              |
+--------------------------------------+

One can easily extract individual coefficients or the list of coefficients.

+------------------+
|i7 : D1#0         |
|                  |
|o7 = 2            |
+------------------+
|i8 : D1#1         |
|                  |
|o8 = -7           |
+------------------+
|i9 : D1#2         |
|                  |
|o9 = 3            |
+------------------+
|i10 : entries D1  |
|                  |
|o10 = {2, -7, 3}  |
|                  |
|o10 : List        |
+------------------+
|i11 : entries K   |
|                  |
|o11 = {-1, -1, -1}|
|                  |
|o11 : List        |
+------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * weilDivisorGroup(NormalToricVariety)
    -- make the group of
    torus-invariant Weil divisors
  * toricDivisor(List,NormalToricVariety)
    -- make a torus-invariant Weil
    divisor
  * toricDivisor(NormalToricVariety)
    -- make the canonical divisor
  * NormalToricVariety _ ZZ -- make an
    irreducible torus-invariant divisor
  * expression(ToricDivisor) -- get the
    expression used to format for printing
  * normalToricVariety(ToricDivisor) -- get
    the underlying normal toric variety
  * support(ToricDivisor) -- make the list of
    irreducible divisors with nonzero coefficients
  * ToricDivisor + ToricDivisor -- perform
    arithmetic on toric divisors

Functions and methods returning a toric divisor:
================================================

  * "- ToricDivisor" -- see divisor arithmetic, --
    perform arithmetic on toric divisors
  * "ToricDivisor + ToricDivisor" -- see divisor arithmetic,
    -- perform arithmetic on toric divisors
  * "ToricDivisor - ToricDivisor" -- see divisor arithmetic,
    -- perform arithmetic on toric divisors
  * "ZZ * ToricDivisor" -- see divisor arithmetic, --
    perform arithmetic on toric divisors
  * NormalToricVariety _ ZZ -- make an
    irreducible torus-invariant divisor
  * pullback(ToricMap,ToricDivisor)
    -- make the pullback of a Cartier
    divisor under a toric map
  * smallAmpleToricDivisor(ZZ,ZZ),
    -- get a very ample toric divisor from the database
  * "toricDivisor" -- see toricDivisor(List,NormalToricVariety),
    -- make a torus-invariant Weil
    divisor
  * toricDivisor(List,NormalToricVariety)
    -- make a torus-invariant Weil
    divisor
  * toricDivisor(NormalToricVariety)
    -- make the canonical divisor
  * toricDivisor(Polyhedron) -- make the
    toric divisor associated to a polyhedron

Methods that use a toric divisor:
=================================

  * abstractSheaf(NormalToricVariety,AbstractVariety,ToricDivisor),
    --
    make the corresponding abstract sheaf
  * "abstractSheaf(NormalToricVariety,ToricDivisor)" -- see
    abstractSheaf(NormalToricVariety,AbstractVariety,ToricDivisor),
    --
    make the corresponding abstract sheaf
  * degree(ToricDivisor) -- make the degree of
    the associated rank-one reflexive sheaf
  * entries(ToricDivisor) -- get the list of
    coefficients
  * expression(ToricDivisor) -- get the
    expression used to format for printing
  * isAmple(ToricDivisor) -- whether a
    torus-invariant Weil divisor is ample
  * isCartier(ToricDivisor) -- whether a
    torus-invariant Weil divisor is Cartier
  * isEffective(ToricDivisor) -- whether
    a torus-invariant Weil divisor is effective
  * isNef(ToricDivisor) -- whether a
    torus-invariant Weil divisor is nef
  * isQQCartier(ToricDivisor) -- whether
    a torus-invariant Weil divisor is QQ-Cartier
  * isVeryAmple(ToricDivisor) -- whether
    a torus-invariant Weil divisor is very ample
  * isWellDefined(ToricDivisor), --
    whether a toric divisor is well-defined
  * latticePoints(ToricDivisor), --
    compute the lattice points in the associated polytope
  * monomials(ToricDivisor) -- list the
    monomials that span the linear series
  * OO ToricDivisor -- make the associated rank-one
    reflexive sheaf
  * polytope(ToricDivisor) -- makes the
    associated 'Polyhedra' polyhedron
  * support(ToricDivisor) -- make the list of
    irreducible divisors with nonzero coefficients
  * ToricDivisor == ToricDivisor, --
    equality of toric divisors
  * "ToricDivisor == ZZ" -- see ToricDivisor == ToricDivisor,
    -- equality of toric divisors
  * "ZZ == ToricDivisor" -- see ToricDivisor == ToricDivisor,
    -- equality of toric divisors
  * "normalToricVariety(ToricDivisor)" -- see variety(ToricDivisor),
    -- get the underlying normal toric variety
  * variety(ToricDivisor) -- get the
    underlying normal toric variety
  * vector(ToricDivisor) -- make the vector of
    coefficients
  * vertices(ToricDivisor) -- compute the
    vertices of the associated polytope

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

The object ToricDivisor, is a type (Macaulay2Doc),
with ancestor classes HashTable (Macaulay2Doc),
< Thing (Macaulay2Doc).

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

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:730:0.

ToricDivisor == ToricDivisor -- equality of toric divisors
**********************************************************

  * Operator: == (Macaulay2Doc),
  * Usage:
        D1 == D2
  * Inputs:
      * D1, a toric divisor,
      * D2, a toric divisor,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the underlying varieties are equal and lists of
        coefficients are equal

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

Two torus-invariant Weil divisors are equal when their underlying normal toric
varieties are equal and, for each irreducible torus-invariant divisor, the
corresponding coefficients are equal.

+-----------------------------------------------------------------------------+
|i1 : X = normalToricVariety(id_(ZZ^3) | -id_(ZZ^3));                         |
+-----------------------------------------------------------------------------+
|i2 : D1 = toricDivisor({2,-7,3,0,7,5,8,-8}, X)                               |
|                                                                             |
|o2 = 2*X  - 7*X  + 3*X  + 7*X  + 5*X  + 8*X  - 8*X                           |
|        0      1      2      4      5      6      7                          |
|                                                                             |
|o2 : ToricDivisor on X                                                       |
+-----------------------------------------------------------------------------+
|i3 : D2 = 2 * X_0 - 7 * X_1 + 3 * X_2 + 7 * X_4 + 5 * X_5 + 8 * X_6 - 8 * X_7|
|                                                                             |
|o3 = 2*X  - 7*X  + 3*X  + 7*X  + 5*X  + 8*X  - 8*X                           |
|        0      1      2      4      5      6      7                          |
|                                                                             |
|o3 : ToricDivisor on X                                                       |
+-----------------------------------------------------------------------------+
|i4 : D1 == D2                                                                |
|                                                                             |
|o4 = true                                                                    |
+-----------------------------------------------------------------------------+
|i5 : D1 == - D2                                                              |
|                                                                             |
|o5 = false                                                                   |
+-----------------------------------------------------------------------------+
|i6 : assert (D1 == D2 and D2 == D1 and D1 =!= - D2)                          |
+-----------------------------------------------------------------------------+

Since the group of torus-equivariant Weil divisors form an abelian group, it
also makes sense to compare a toric divisor with the zero integer (which we
identify with the toric divisor whose coefficients are equal to zero).

+--------------------------------------------------+
|i7 : D1 == 0                                      |
|                                                  |
|o7 = false                                        |
+--------------------------------------------------+
|i8 : 0*D1 == 0                                    |
|                                                  |
|o8 = true                                         |
+--------------------------------------------------+
|i9 : assert (D1 =!= 0 and 0*D1 == 0 and 0 == 0*D2)|
+--------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * ToricDivisor + ToricDivisor -- perform
    arithmetic on toric divisors

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

  * ToricDivisor == ToricDivisor, --
    equality of toric divisors
  * "ToricDivisor == ZZ"
  * "ZZ == ToricDivisor"
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1441:0.

toricDivisor(List,NormalToricVariety) -- make a torus-invariant Weil divisor
****************************************************************************

  * Function: toricDivisor,
  * Usage:
        toricDivisor(L, X)
  * Inputs:
      * L, a list (Macaulay2Doc), of integers coefficients for the
        irreducible torus-invariant divisors on X
      * X, a normal toric variety,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing, => ..., default
        value QQ, make the toric divisor associated to a polyhedron
      * Variable, => ..., default value x,
        make the toric divisor associated to a polyhedron
      * WeilToClass, => ..., default value
        null, make the toric divisor associated to a polyhedron
  * Outputs:
      * a toric divisor,

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

Given a list of integers and a normal toric variety, this method returns the
torus-invariant Weil divisor such the coefficient of the $i$-th irreducible
torus-invariant divisor is the $i$-th entry in the list.  The indexing of the
irreducible torus-invariant divisors is inherited from the indexing of the rays
in the associated fan.  In this package, the rays are ordered and indexed by
the nonnegative integers.

+----------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                  |
+----------------------------------------------------+
|i2 : D = toricDivisor({2,-7,3},PP2)                 |
|                                                    |
|o2 = 2*PP2  - 7*PP2  + 3*PP2                        |
|          0        1        2                       |
|                                                    |
|o2 : ToricDivisor on PP2                            |
+----------------------------------------------------+
|i3 : assert(D == 2* PP2_0 - 7*PP2_1 + 3*PP2_2)      |
+----------------------------------------------------+
|i4 : assert(D == toricDivisor(entries D, variety D))|
+----------------------------------------------------+

Although this is a general method for making a torus-invariant Weil divisor, it
is typically more convenient to simple enter the appropriate linear combination
of torus-invariant Weil divisors.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * toricDivisor(NormalToricVariety)
    -- make the canonical divisor
  * NormalToricVariety _ ZZ -- make an
    irreducible torus-invariant divisor

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

  * toricDivisor(List,NormalToricVariety)
    -- make a torus-invariant Weil
    divisor
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1059:0.

toricDivisor(NormalToricVariety) -- make the canonical divisor
**************************************************************

  * Function: toricDivisor,
  * Usage:
        toricDivisor X
  * Inputs:
      * X, a normal toric variety,
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing, => ..., default
        value QQ, make the toric divisor associated to a polyhedron
      * Variable, => ..., default value x,
        make the toric divisor associated to a polyhedron
      * WeilToClass, => ..., default value
        null, make the toric divisor associated to a polyhedron
  * Outputs:
      * a toric divisor, specifically minus the sum of all
        the irreducible torus-invariant divisors

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

On a smooth normal toric variety, the canonical divisor equals minus the sum of
all the torus-invariant irreducible divisors. For a singular toric variety,
this divisor may not be Cartier or even $\QQ$-Cartier.  Nevertheless, the
associated coherent sheaf, whose local sections are rational functions with at
least simple zeros along the irreducible divisors, is the dualizing sheaf.

The first example illustrates the canonical divisor on projective space.

+--------------------------------------------------------------------+
|i1 : PP3 = toricProjectiveSpace 3;                                  |
+--------------------------------------------------------------------+
|i2 : assert(isSmooth PP3 and isProjective PP3)                      |
+--------------------------------------------------------------------+
|i3 : K = toricDivisor PP3                                           |
|                                                                    |
|o3 = - PP3  - PP3  - PP3  - PP3                                     |
|          0      1      2      3                                    |
|                                                                    |
|o3 : ToricDivisor on PP3                                            |
+--------------------------------------------------------------------+
|i4 : assert(all(entries K, i -> i === -1) and isWellDefined K)      |
+--------------------------------------------------------------------+
|i5 : omega = OO K                                                   |
|                                                                    |
|          1                                                         |
|o5 = OO    (-4)                                                     |
|       PP3                                                          |
|                                                                    |
|o5 : coherent sheaf on PP3, free of rank 1                          |
+--------------------------------------------------------------------+
|i6 : assert(HH^3(PP3, OO_PP3(-7) ** omega) === HH^0(PP3, OO_PP3(7)))|
+--------------------------------------------------------------------+

The second example illustrates that duality also holds on complete singular
nonprojective toric varieties.

+-----------------------------------------------------------------------------+
|i7 : X = normalToricVariety({{1,0,0},{0,1,0},{0,0,1},{0,-1,-1},{-1,0,-1},{-2 |
|-----------------------------------------------------------------------------|
|,-1,0}},{{0,1,2},{0,1,3},{1,3,4},{1,2,4},{2,4,5},{0,2,5},{0,3,5},{3,4,5}});  |
+-----------------------------------------------------------------------------+
|i8 : assert(isComplete X and not isProjective X and not isSmooth X)          |
+-----------------------------------------------------------------------------+
|i9 : KX = toricDivisor X                                                     |
|                                                                             |
|o9 = - X  - X  - X  - X  - X  - X                                            |
|        0    1    2    3    4    5                                           |
|                                                                             |
|o9 : ToricDivisor on X                                                       |
+-----------------------------------------------------------------------------+
|i10 : assert(all(entries KX, i -> i === -1) and isWellDefined KX)            |
+-----------------------------------------------------------------------------+
|i11 : isCartier KX                                                           |
|                                                                             |
|o11 = false                                                                  |
+-----------------------------------------------------------------------------+
|i12 : omegaX = OO KX                                                         |
|                                                                             |
|         1                                                                   |
|o12 = OO   (-3, -3, -4)                                                      |
|        X                                                                    |
|                                                                             |
|o12 : coherent sheaf on X, free of rank 1                                    |
+-----------------------------------------------------------------------------+
|i13 : assert( HH^0(X, OO_X(1,2,5)) === HH^3(X, OO_X(-1,-2,-5) ** omegaX) )   |
+-----------------------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * toricDivisor -- make a
    torus-invariant Weil divisor
  * OO ToricDivisor -- make the associated rank-one
    reflexive sheaf
  * HH^ZZ(NormalToricVariety,CoherentSheaf)
    -- compute the cohomology of
    a coherent sheaf

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

  * toricDivisor(NormalToricVariety)
    -- make the canonical divisor
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1109:0.

toricDivisor(Polyhedron) -- make the toric divisor associated to a polyhedron
*****************************************************************************

  * Function: toricDivisor,
  * Usage:
        toricDivisor P
  * Inputs:
      * P, a convex polyhedron (Polyhedra), whose vertices
        are lattice points
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        that determines the coefficient ring of the total coordinate ring of
        the underlying normal toric variety
      * Variable => a symbol (Macaulay2Doc), default value x,
        that specifies the base symbol for the indexed variables in the total
        coordinate ring of the underlying normal toric variety
      * WeilToClass => a matrix (Macaulay2Doc), default value
        null, that specifies the map from the group of torus-invariant Weil
        divisors to the class group of the underlying normal toric variety
  * Outputs:
      * a toric divisor, corresponding to the given convex
        lattice polytope on the normal toric variety defined by the inner
        normal fan

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

A convex lattice polytope corresponds to a pair: the normal toric variety
determined by its normal fan and toric divisor.  The coefficient of the $i$-th
irreducible torus-invariant divisor is determined by the supporting hyperplane
to the polytope whose normal vector is the minimal lattice point on the $i$-th
ray.

Our example demonstrates how different triangles correspond to toric divisors
on the projective plane.

+-----------------------------------------------------------------------------+
|i1 : P1 = convexHull matrix{{0,1,0},{0,0,1}};                                |
+-----------------------------------------------------------------------------+
|i2 : D1 = toricDivisor P1                                                    |
|                                                                             |
|o2 = D                                                                       |
|      2                                                                      |
|                                                                             |
|o2 : ToricDivisor on normalToricVariety ({{1, 0}, {0, 1}, {-1, -1}}, {{0, 1},|
|-----------------------------------------------------------------------------|
|{0, 2}, {1, 2}})                                                             |
+-----------------------------------------------------------------------------+
|i3 : X = variety D1;                                                         |
+-----------------------------------------------------------------------------+
|i4 : D1                                                                      |
|                                                                             |
|o4 = X                                                                       |
|      2                                                                      |
|                                                                             |
|o4 : ToricDivisor on X                                                       |
+-----------------------------------------------------------------------------+
|i5 : P2 = convexHull matrix{{-1,0,-1},{0,0,1}};                              |
+-----------------------------------------------------------------------------+
|i6 : D2 = toricDivisor P2                                                    |
|                                                                             |
|o6 = D                                                                       |
|      0                                                                      |
|                                                                             |
|o6 : ToricDivisor on normalToricVariety ({{1, 0}, {0, 1}, {-1, -1}}, {{0, 1},|
|-----------------------------------------------------------------------------|
|{0, 2}, {1, 2}})                                                             |
+-----------------------------------------------------------------------------+
|i7 : P3 = convexHull matrix{{0,1,0},{-1,-1,0}};                              |
+-----------------------------------------------------------------------------+
|i8 : D3 = toricDivisor P3                                                    |
|                                                                             |
|o8 = D                                                                       |
|      1                                                                      |
|                                                                             |
|o8 : ToricDivisor on normalToricVariety ({{1, 0}, {0, 1}, {-1, -1}}, {{0, 1},|
|-----------------------------------------------------------------------------|
|{0, 2}, {1, 2}})                                                             |
+-----------------------------------------------------------------------------+
|i9 : P4 = convexHull matrix{{-1,2,-1},{-1,-1,2}};                            |
+-----------------------------------------------------------------------------+
|i10 : D4 = toricDivisor(P4, CoefficientRing => ZZ/2)                         |
|                                                                             |
|o10 = D  + D  + D                                                            |
|       0    1    2                                                           |
|                                                                             |
|o10 : ToricDivisor on normalToricVariety ({{1, 0}, {0, 1}, {-1, -1}}, {{0,   |
|-----------------------------------------------------------------------------|
|1}, {0, 2}, {1, 2}})                                                         |
+-----------------------------------------------------------------------------+
|i11 : ring variety D4                                                        |
|                                                                             |
|      ZZ                                                                     |
|o11 = --[x ..x ]                                                             |
|       2  0   2                                                              |
|                                                                             |
|o11 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+

This method function creates both the toric divisor and the underlying normal
toric variety.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * normalToricVariety(Polyhedron),
    -- make a normal toric variety from a 'Polyhedra' polyhedron

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

  * toricDivisor(Polyhedron) -- make the
    toric divisor associated to a polyhedron
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:1166:0.

ToricMap -- the class of all torus-equivariant maps between normal toric varieties
**********************************************************************************

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

Let $X$ and $Y$ be normal toric varieties whose underlying lattices are $N_X$
and $N_Y$ respectively.  A toric map is a morphism $f : X \to Y$ that induces a
morphism of algebraic groups $g : T_X \to T_Y$ such that $f$ is
$T_X$-equivariant with respect to the $T_X$-action on $Y$ induced by $g$.
Every toric map $f : X \to Y$ corresponds to a unique map $f_N : N_X \to N_Y$
between the underlying lattices such that, for every cone $\sigma$ in the fan
of $X$, there is a cone in the fan of $Y$ that contains the image
$f_N(\sigma)$. For details see Theorem 3.3.4 in Cox-Little-Schenck.

To specify a map of normal toric varieties, the target and source normal toric
varieties need to be specified as well as a matrix which maps from $N_X$ to
$N_Y$.

The primary constructor of a toric map is
map(NormalToricVariety,NormalToricVariety,Matrix).

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * NormalToricVariety -- the class of all normal
    toric varieties
  * id _ NormalToricVariety -- make the
    identity map from a NormalToricVariety to itself
  * isWellDefined(ToricMap) -- whether a
    toric map is well defined

Functions and methods returning a toric map:
============================================

  * "diagonalToricMap(NormalToricVariety)" -- see diagonalToricMap,
    -- make a diagonal map into a Cartesian product
  * "diagonalToricMap(NormalToricVariety,ZZ)" -- see diagonalToricMap,
    -- make a diagonal map into a Cartesian product
  * "diagonalToricMap(NormalToricVariety,ZZ,Array)" -- see
    diagonalToricMap, -- make a diagonal map into a Cartesian
    product
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * map(NormalToricVariety,NormalToricVariety,ZZ)
    -- make a
    torus-equivariant map between normal toric varieties
  * NormalToricVariety ^ Array -- make a
    canonical projection map
  * NormalToricVariety _ Array -- make a
    canonical inclusion into a product
  * ToricMap * ToricMap -- make the composition
    of two toric maps

Methods that use a toric map:
=============================

  * cartierDivisorGroup(ToricMap), --
    make the induced map between groups of Cartier divisors.
  * classGroup(ToricMap) -- make the induced
    map between class groups
  * ideal(ToricMap) -- make the ideal defining the
    closure of the image
  * inducedMap(ToricMap) -- make the induced
    map between total coordinate rings (a.k.a. Cox rings)
  * isDominant(ToricMap) -- whether a toric
    map is dominant
  * isFibration(ToricMap) -- whether a toric
    map is a fibration
  * isProper(ToricMap) -- whether a toric map is
    proper
  * isSurjective(ToricMap) -- whether a
    toric map is surjective
  * isWellDefined(ToricMap) -- whether a
    toric map is well defined
  * matrix(ToricMap) -- get the underlying map of
    lattices
  * picardGroup(ToricMap) -- make the induced
    map between Picard groups
  * pullback(ToricMap,CoherentSheaf)
    -- make the pullback of a coherent
    sheaf under a toric map
  * "pullback(ToricMap,Module)" -- see pullback(ToricMap,CoherentSheaf),
    -- make the pullback of a coherent
    sheaf under a toric map
  * pullback(ToricMap,ToricDivisor)
    -- make the pullback of a Cartier
    divisor under a toric map
  * source(ToricMap) -- get the source of the map
  * target(ToricMap) -- get the target of the map
  * ToricMap == ToricMap -- whether to toric maps
    are equal
  * weilDivisorGroup(ToricMap) -- make
    the induced map between groups of Weil divisors

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

The object ToricMap, is a type (Macaulay2Doc), with
ancestor classes HashTable (Macaulay2Doc), < Thing (Macaulay2Doc).

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

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:103:0.

ToricMap * ToricMap -- make the composition of two toric maps
*************************************************************

  * Operator: * (Macaulay2Doc),
  * Usage:
        g * f
  * Inputs:
      * f, a toric map, a toric map between toric varieties
      * g, a toric map, a toric map between toric varieties
  * Outputs:
      * a toric map, the composition g * f from source f to
        target g

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

Given two toric maps with the target of first equal to the source of second,
this method returns the composite map from source of the first to target of the
second.

We illustrate this construction with the projection from a smooth Fano Toric threefold,
to the first
Hirzebruch surface, and a projection from this
Hirzebruch surface to the projective line.

+-------------------------------------------------------------------+
|i1 : X = smoothFanoToricVariety(3,14);                             |
+-------------------------------------------------------------------+
|i2 : Y = hirzebruchSurface 1;                                      |
+-------------------------------------------------------------------+
|i3 : f = map(Y, X, matrix{{1,0,0},{0,1,0}})                        |
|                                                                   |
|o3 = | 1 0 0 |                                                     |
|     | 0 1 0 |                                                     |
|                                                                   |
|o3 : ToricMap Y <--- X                                             |
+-------------------------------------------------------------------+
|i4 : assert (isWellDefined f and source f === X and target f === Y)|
+-------------------------------------------------------------------+
|i5 : Z = toricProjectiveSpace 1;                                   |
+-------------------------------------------------------------------+
|i6 : g = map(Z, Y, matrix{{1, 0}})                                 |
|                                                                   |
|o6 = | 1 0 |                                                       |
|                                                                   |
|o6 : ToricMap Z <--- Y                                             |
+-------------------------------------------------------------------+
|i7 : assert (isWellDefined g and source g === Y and target g === Z)|
+-------------------------------------------------------------------+
|i8 : h = g * f                                                     |
|                                                                   |
|o8 = | 1 0 0 |                                                     |
|                                                                   |
|o8 : ToricMap Z <--- X                                             |
+-------------------------------------------------------------------+
|i9 : assert (isWellDefined h and source h === X and target h === Z)|
+-------------------------------------------------------------------+
|i10 : X = hirzebruchSurface 1;                                     |
+-------------------------------------------------------------------+

Composing diagonal maps, and canonical
projections, yields identity maps.

+----------------------------------------------------------------+
|i11 : X2 = X ** X;                                              |
+----------------------------------------------------------------+
|i12 : delta = diagonalToricMap X                                |
|                                                                |
|o12 = | 1 0 |                                                   |
|      | 0 1 |                                                   |
|      | 1 0 |                                                   |
|      | 0 1 |                                                   |
|                                                                |
|o12 : ToricMap X2 <--- X                                        |
+----------------------------------------------------------------+
|i13 : assert (X2^[0] * delta == id_X and X2^[1] * delta == id_X)|
+----------------------------------------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * NormalToricVariety ** NormalToricVariety
    -- make the Cartesian product of two normal toric
    varieties

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

  * ToricMap * ToricMap -- make the composition
    of two toric maps
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:616:0.

ToricMap == ToricMap -- whether to toric maps are equal
*******************************************************

  * Operator: == (Macaulay2Doc),
  * Usage:
        f == g
  * Inputs:
      * f, a toric map,
      * g, a toric map,
  * Outputs:
      * a Boolean value (Macaulay2Doc), that is true (Macaulay2Doc),
        if the toric maps have the same source, same
        target, and same underlying map of lattices

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

Two toric maps are equal if their three defining attributes (namely source,
target, and underlying matrix) are the same.

We illustrate this test with the projection,
from a blow-up, at a
point in the projective plane to the projective plane,
and various identity maps.

+-------------------------------------------------------------------+
|i1 : Y = toricProjectiveSpace 2;                                   |
+-------------------------------------------------------------------+
|i2 : X = toricBlowup({0, 2}, Y);                                   |
+-------------------------------------------------------------------+
|i3 : f = X^[]                                                      |
|                                                                   |
|o3 = | 1 0 |                                                       |
|     | 0 1 |                                                       |
|                                                                   |
|o3 : ToricMap Y <--- X                                             |
+-------------------------------------------------------------------+
|i4 : assert (isWellDefined f and f == map(Y, X, 1))                |
+-------------------------------------------------------------------+
|i5 : g = id_X                                                      |
|                                                                   |
|o5 = | 1 0 |                                                       |
|     | 0 1 |                                                       |
|                                                                   |
|o5 : ToricMap X <--- X                                             |
+-------------------------------------------------------------------+
|i6 : assert (g == map(X, X, 1))                                    |
+-------------------------------------------------------------------+
|i7 : assert (f != g)                                               |
+-------------------------------------------------------------------+
|i8 : assert (isWellDefined g and source g === X and target g === X)|
+-------------------------------------------------------------------+
|i9 : assert (matrix f == matrix g and source f === source g and    |
|         target f =!= target g)                                    |
+-------------------------------------------------------------------+

The second example shows that we can have more than one well-defined toric map
with the same source and target.

+--------------------------------------------------------------------------+
|i10 : Z = toricProjectiveSpace 1;                                         |
+--------------------------------------------------------------------------+
|i11 : pi1 = map(Z, X, matrix{{0, 1}})                                     |
|                                                                          |
|o11 = | 0 1 |                                                             |
|                                                                          |
|o11 : ToricMap Z <--- X                                                   |
+--------------------------------------------------------------------------+
|i12 : assert (isWellDefined pi1 and source pi1 === X and target pi1 === Z)|
+--------------------------------------------------------------------------+
|i13 : pi2 = map(Z, X, matrix{{0, 2}})                                     |
|                                                                          |
|o13 = | 0 2 |                                                             |
|                                                                          |
|o13 : ToricMap Z <--- X                                                   |
+--------------------------------------------------------------------------+
|i14 : assert (isWellDefined pi2 and source pi2 === X and target pi2 === Z)|
+--------------------------------------------------------------------------+
|i15 : assert (pi1 != pi2)                                                 |
+--------------------------------------------------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * isWellDefined(ToricMap) -- whether a
    toric map is well defined
  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * map(NormalToricVariety,NormalToricVariety,ZZ)
    -- make a
    torus-equivariant map between normal toric varieties
  * id _ NormalToricVariety -- make the
    identity map from a NormalToricVariety to itself

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

  * ToricMap == ToricMap -- whether to toric maps
    are equal
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:670:0.

toricProjectiveSpace(ZZ) -- make a projective space as a normal toric variety
*****************************************************************************

  * Function: toricProjectiveSpace,
  * Usage:
        toricProjectiveSpace d
  * Inputs:
      * d, an integer (Macaulay2Doc), a positive integer
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        that specifies the coefficient ring of the total coordinate ring,
      * Variable => a symbol (Macaulay2Doc), default value x,
        that specifies base name (Macaulay2Doc), for the indexed
        variables in the total coordinate ring
  * Outputs:
      * a normal toric variety, that is projective
        $d$-space

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

Projective $d$-space is a smooth complete normal toric variety. The rays are
generated by the standard basis $e_1, e_2, \dots,e_d$ of $\ZZ^d$ together with
vector $-e_1-e_2-\dots-e_d$.  The maximal cones in the fan correspond to the
$d$-element subsets of $\{ 0,1, \dots,d\}$.

The examples illustrate the projective line and projective $3$-space.

+-------------------------------------------------------------------+
|i1 : PP1 = toricProjectiveSpace 1;                                 |
+-------------------------------------------------------------------+
|i2 : rays PP1                                                      |
|                                                                   |
|o2 = {{-1}, {1}}                                                   |
|                                                                   |
|o2 : List                                                          |
+-------------------------------------------------------------------+
|i3 : max PP1                                                       |
|                                                                   |
|o3 = {{0}, {1}}                                                    |
|                                                                   |
|o3 : List                                                          |
+-------------------------------------------------------------------+
|i4 : dim PP1                                                       |
|                                                                   |
|o4 = 1                                                             |
+-------------------------------------------------------------------+
|i5 : ring PP1                                                      |
|                                                                   |
|o5 = QQ[x ..x ]                                                    |
|         0   1                                                     |
|                                                                   |
|o5 : PolynomialRing                                                |
+-------------------------------------------------------------------+
|i6 : ideal PP1                                                     |
|                                                                   |
|o6 = ideal (x , x )                                                |
|             1   0                                                 |
|                                                                   |
|o6 : Ideal of QQ[x ..x ]                                           |
|                  0   1                                            |
+-------------------------------------------------------------------+
|i7 : assert (isWellDefined PP1 and isSmooth PP1 and isComplete PP1)|
+-------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i8 : PP3 = toricProjectiveSpace (3, CoefficientRing => ZZ/32003, Variable => |
|-----------------------------------------------------------------------------|
|y);                                                                          |
+-----------------------------------------------------------------------------+
|i9 : rays PP3                                                                |
|                                                                             |
|o9 = {{-1, -1, -1}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}                         |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+
|i10 : max PP3                                                                |
|                                                                             |
|o10 = {{0, 1, 2}, {0, 1, 3}, {0, 2, 3}, {1, 2, 3}}                           |
|                                                                             |
|o10 : List                                                                   |
+-----------------------------------------------------------------------------+
|i11 : dim PP3                                                                |
|                                                                             |
|o11 = 3                                                                      |
+-----------------------------------------------------------------------------+
|i12 : ring PP3                                                               |
|                                                                             |
|        ZZ                                                                   |
|o12 = -----[y ..y ]                                                          |
|      32003  0   3                                                           |
|                                                                             |
|o12 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i13 : ideal PP3                                                              |
|                                                                             |
|o13 = ideal (y , y , y , y )                                                 |
|              3   2   1   0                                                  |
|                                                                             |
|                 ZZ                                                          |
|o13 : Ideal of -----[y ..y ]                                                 |
|               32003  0   3                                                  |
+-----------------------------------------------------------------------------+
|i14 : assert (isWellDefined PP3 and isSmooth PP3 and isComplete PP3)         |
+-----------------------------------------------------------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * isComplete(NormalToricVariety),
    -- whether a toric variety is complete
  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
  * ideal(NormalToricVariety) -- make the
    irrelevant ideal

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

  * toricProjectiveSpace(ZZ) -- make a
    projective space as a normal toric variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:700:0.

variety(ToricDivisor) -- get the underlying normal toric variety
****************************************************************

  * Function: variety (Varieties),
  * Usage:
        variety D
        normalToricVariety D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a normal toric variety, namely the
        underlying variety for D

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

This function allows one to easily access the normal toric variety over which
the torus-invariant Weil divisor is defined.

+-----------------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                               |
+-----------------------------------------------------------------+
|i2 : D1 = 2*PP2_0 - 7*PP2_1 + 3*PP2_2                            |
|                                                                 |
|o2 = 2*PP2  - 7*PP2  + 3*PP2                                     |
|          0        1        2                                    |
|                                                                 |
|o2 : ToricDivisor on PP2                                         |
+-----------------------------------------------------------------+
|i3 : variety D1                                                  |
|                                                                 |
|o3 = PP2                                                         |
|                                                                 |
|o3 : NormalToricVariety                                          |
+-----------------------------------------------------------------+
|i4 : normalToricVariety D1                                       |
|                                                                 |
|o4 = PP2                                                         |
|                                                                 |
|o4 : NormalToricVariety                                          |
+-----------------------------------------------------------------+
|i5 : assert(variety D1 === PP2 and normalToricVariety D1 === PP2)|
+-----------------------------------------------------------------+
+-------------------------------------------------------------+
|i6 : X = normalToricVariety(id_(ZZ^3) | - id_(ZZ^3));        |
+-------------------------------------------------------------+
|i7 : D2 = X_0 - 5 * X_3                                      |
|                                                             |
|o7 = X  - 5*X                                                |
|      0      3                                               |
|                                                             |
|o7 : ToricDivisor on X                                       |
+-------------------------------------------------------------+
|i8 : variety D2                                              |
|                                                             |
|o8 = X                                                       |
|                                                             |
|o8 : NormalToricVariety                                      |
+-------------------------------------------------------------+
|i9 : assert(X === variety D2 and X === normalToricVariety D2)|
+-------------------------------------------------------------+

Since the underlying normal toric variety is a defining attribute of a toric
divisor, this method does not computation.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * NormalToricVariety -- the class of all normal
    toric varieties

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

  * variety(ToricDivisor) -- get the
    underlying normal toric variety
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:811:0.

vector(ToricDivisor) -- make the vector of coefficients
*******************************************************

  * Function: vector (Macaulay2Doc),
  * Usage:
        vector D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a vector (Macaulay2Doc), whose entries are the
        coefficients of D

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

This function returns the Vector (Macaulay2Doc), whose $i$-th
entry is the coefficient of $i$-th irreducible torus-invariant divisor.  The
indexing of the irreducible torus-invariant divisors is inherited from the
indexing of the rays in the associated fan.  This list can be viewed as an
element of the group of torus-invariant Weil divisors.

Here are two simple examples.

+---------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;           |
+---------------------------------------------+
|i2 : D1 = 2*PP2_0 - 7*PP2_1 + 3*PP2_2        |
|                                             |
|o2 = 2*PP2  - 7*PP2  + 3*PP2                 |
|          0        1        2                |
|                                             |
|o2 : ToricDivisor on PP2                     |
+---------------------------------------------+
|i3 : vector D1                               |
|                                             |
|o3 = |  2 |                                  |
|     | -7 |                                  |
|     |  3 |                                  |
|                                             |
|       3                                     |
|o3 : ZZ                                      |
+---------------------------------------------+
|i4 : assert(entries vector D1 === entries D1)|
+---------------------------------------------+
+-----------------------------------------------------------------------------+
|i5 : D2 = toricDivisor convexHull (id_(ZZ^3) | - id_(ZZ^3))                  |
|                                                                             |
|o5 = D  + D  + D  + D  + D  + D  + D  + D                                    |
|      0    1    2    3    4    5    6    7                                   |
|                                                                             |
|o5 : ToricDivisor on normalToricVariety ({{1, 1, 1}, {-1, 1, 1}, {1, -1, 1}, |
|-----------------------------------------------------------------------------|
|{-1, -1, 1}, {1, 1, -1}, {-1, 1, -1}, {1, -1, -1}, {-1, -1, -1}}, {{0, 1, 2, |
|-----------------------------------------------------------------------------|
|3}, {0, 1, 4, 5}, {0, 2, 4, 6}, {1, 3, 5, 7}, {2, 3, 6, 7}, {4, 5, 6, 7}})   |
+-----------------------------------------------------------------------------+
|i6 : vector D2                                                               |
|                                                                             |
|o6 = | 1 |                                                                   |
|     | 1 |                                                                   |
|     | 1 |                                                                   |
|     | 1 |                                                                   |
|     | 1 |                                                                   |
|     | 1 |                                                                   |
|     | 1 |                                                                   |
|     | 1 |                                                                   |
|                                                                             |
|       8                                                                     |
|o6 : ZZ                                                                      |
+-----------------------------------------------------------------------------+
|i7 : assert(entries vector D2 === entries D2)                                |
+-----------------------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * ToricDivisor -- the class of all torus-invariant Weil
    divisors
  * entries(ToricDivisor) -- get the list of
    coefficients
  * rays(NormalToricVariety) -- get the
    rays of the associated fan

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

  * vector(ToricDivisor) -- make the vector of
    coefficients
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:891:0.

vertices(ToricDivisor) -- compute the vertices of the associated polytope
*************************************************************************

  * Function: vertices (Polyhedra),
  * Usage:
        vertices D
  * Inputs:
      * D, a toric divisor,
  * Outputs:
      * a matrix (Macaulay2Doc), whose columns are the vertices
        of the associated polytope

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

On a complete normal toric variety, the polyhedron associated to a Cartier
divisor is a lattice polytope.  Given a torus-invariant Cartier divisor on a
normal toric variety, this method returns an integer matrix whose columns
correspond to the vertices of the associated lattice polytope.  For a
non-effective Cartier divisor, this methods returns null (Macaulay2Doc).
When the divisor is ample, the normal fan the
corresponding polytope equals the fan associated to the normal toric variety.

On the projective plane, the associate polytope is either empty, a point, or a
triangle.

+-----------------------------------------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;                               |
+-----------------------------------------------------------------+
|i2 : assert (null === vertices (-PP2_0))                         |
+-----------------------------------------------------------------+
|i3 : vertices (0*PP2_0)                                          |
|                                                                 |
|o3 = 0                                                           |
|                                                                 |
|              2       1                                          |
|o3 : Matrix ZZ  <-- ZZ                                           |
+-----------------------------------------------------------------+
|i4 : assert isAmple PP2_0                                        |
+-----------------------------------------------------------------+
|i5 : V1 = vertices (PP2_0)                                       |
|                                                                 |
|o5 = | 0 1 0 |                                                   |
|     | 0 0 1 |                                                   |
|                                                                 |
|              2       3                                          |
|o5 : Matrix ZZ  <-- ZZ                                           |
+-----------------------------------------------------------------+
|i6 : X1 = normalToricVariety V1;                                 |
+-----------------------------------------------------------------+
|i7 : assert (set rays X1 === set rays PP2 and max X1 === max PP2)|
+-----------------------------------------------------------------+
|i8 : assert isAmple (2*PP2_0)                                    |
+-----------------------------------------------------------------+
|i9 : V2 = vertices (2*PP2_0)                                     |
|                                                                 |
|o9 = | 0 2 0 |                                                   |
|     | 0 0 2 |                                                   |
|                                                                 |
|              2       3                                          |
|o9 : Matrix ZZ  <-- ZZ                                           |
+-----------------------------------------------------------------+
|i10 : X2 = normalToricVariety V2;                                |
+-----------------------------------------------------------------+
|i11 : assert (rays X2 === rays X1 and max X2 === max X1)         |
+-----------------------------------------------------------------+

On a Hirzebruch surface, the polytopes associated to non-ample Cartier divisors
give rise to other normal toric varieties.

+-----------------------------------------------------------------------------+
|i12 : FF2 = hirzebruchSurface 2;                                             |
+-----------------------------------------------------------------------------+
|i13 : assert not isAmple FF2_2                                               |
+-----------------------------------------------------------------------------+
|i14 : V3 = vertices FF2_2                                                    |
|                                                                             |
|o14 = | 0 1 |                                                                |
|      | 0 0 |                                                                |
|                                                                             |
|               2       2                                                     |
|o14 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i15 : normalToricVariety V3  -- a degenerated version of the projective line |
|                                                                             |
|o15 = normalToricVariety ({{1, 0}, {-1, 0}}, {{0}, {1}})                     |
|                                                                             |
|o15 : NormalToricVariety                                                     |
+-----------------------------------------------------------------------------+
|i16 : assert isDegenerate normalToricVariety V3                              |
+-----------------------------------------------------------------------------+
|i17 : assert not isAmple FF2_3                                               |
+-----------------------------------------------------------------------------+
|i18 : V4 = vertices FF2_3                                                    |
|                                                                             |
|o18 = | 0 0 2 |                                                              |
|      | 0 1 1 |                                                              |
|                                                                             |
|               2       3                                                     |
|o18 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i19 : normalToricVariety V4 -- a weighted projective space                   |
|                                                                             |
|o19 = normalToricVariety ({{1, 0}, {-1, 2}, {0, -1}}, {{0, 1}, {0, 2}, {1,   |
|                                                                             |
|o19 : NormalToricVariety                                                     |
|-----------------------------------------------------------------------------|
|2}})                                                                         |
+-----------------------------------------------------------------------------+
|i20 : vertices FF2_1                                                         |
|                                                                             |
|o20 = 0                                                                      |
|                                                                             |
|               2       1                                                     |
|o20 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i21 : assert isAmple (FF2_2 + FF2_3)                                         |
+-----------------------------------------------------------------------------+
|i22 : V5 = vertices (FF2_2 + FF2_3)                                          |
|                                                                             |
|o22 = | 0 1 0 3 |                                                            |
|      | 0 0 1 1 |                                                            |
|                                                                             |
|               2       4                                                     |
|o22 : Matrix ZZ  <-- ZZ                                                      |
+-----------------------------------------------------------------------------+
|i23 : X3 = normalToricVariety V5 -- isomorphic Hirzebruch surface            |
|                                                                             |
|o23 = X3                                                                     |
|                                                                             |
|o23 : NormalToricVariety                                                     |
+-----------------------------------------------------------------------------+
|i24 : assert (set rays X3 === set rays FF2)                                  |
+-----------------------------------------------------------------------------+

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * isComplete(NormalToricVariety),
    -- whether a toric variety is complete
  * isCartier(ToricDivisor) -- whether a
    torus-invariant Weil divisor is Cartier
  * isEffective(ToricDivisor) -- whether
    a torus-invariant Weil divisor is effective
  * normalToricVariety(Matrix) -- make a
    normal toric variety from a polytope
  * latticePoints(ToricDivisor), --
    compute the lattice points in the associated polytope

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

  * vertices(ToricDivisor) -- compute the
    vertices of the associated polytope
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:2014:0.

weightedProjectiveSpace(List) -- make a weighted projective space
*****************************************************************

  * Function: weightedProjectiveSpace,
  * Usage:
        weightedProjectiveSpace q
  * Inputs:
      * q, a list (Macaulay2Doc), of relatively prime positive
        integers
  * Optional inputs (Macaulay2Doc),:
      * CoefficientRing => a ring (Macaulay2Doc), default value QQ,
        that specifies the coefficient ring of the total coordinate ring,
      * Variable => a symbol (Macaulay2Doc), default value x,
        that specifies the base name (Macaulay2Doc), for the
        indexed variables in the total coordinate ring
  * Outputs:
      * a normal toric variety, that is a weighted
        projective space

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

The weighted projective space associated to a list $\{ q_0, q_1, \dots, q_d
\}$, where no $d$-element subset of $q_0, q_1, \dots, q_d$ has a nontrivial
common factor, is a projective simplicial normal toric variety built from a fan
in $N = \ZZ^{d+1}/\ZZ(q_0, q_1, \dots,q_d)$.  The rays are generated by the
images of the standard basis for $\ZZ^{d+1}$, and the maximal cones in the fan
correspond to the $d$-element subsets of $\{ 0, 1, ..., d \}$. A weighted
projective space is typically not smooth.

The first examples illustrate the defining data for three different weighted
projective spaces.

+---------------------------------------------------------------------+
|i1 : PP4 = weightedProjectiveSpace {1,1,1,1};                        |
+---------------------------------------------------------------------+
|i2 : rays PP4                                                        |
|                                                                     |
|o2 = {{-1, -1, -1}, {1, 0, 0}, {0, 1, 0}, {0, 0, 1}}                 |
|                                                                     |
|o2 : List                                                            |
+---------------------------------------------------------------------+
|i3 : max PP4                                                         |
|                                                                     |
|o3 = {{0, 1, 2}, {0, 1, 3}, {0, 2, 3}, {1, 2, 3}}                    |
|                                                                     |
|o3 : List                                                            |
+---------------------------------------------------------------------+
|i4 : dim PP4                                                         |
|                                                                     |
|o4 = 3                                                               |
+---------------------------------------------------------------------+
|i5 : assert (isWellDefined PP4 and isProjective PP4 and isSmooth PP4)|
+---------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i6 : X = weightedProjectiveSpace {1,2,3};                                    |
+-----------------------------------------------------------------------------+
|i7 : rays X                                                                  |
|                                                                             |
|o7 = {{-2, -3}, {1, 0}, {0, 1}}                                              |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : max X                                                                   |
|                                                                             |
|o8 = {{0, 1}, {0, 2}, {1, 2}}                                                |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : dim X                                                                   |
|                                                                             |
|o9 = 2                                                                       |
+-----------------------------------------------------------------------------+
|i10 : ring X                                                                 |
|                                                                             |
|o10 = QQ[x ..x ]                                                             |
|          0   2                                                              |
|                                                                             |
|o10 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i11 : assert (isWellDefined X and isProjective X and isSimplicial X and not  |
|-----------------------------------------------------------------------------|
|isSmooth X)                                                                  |
+-----------------------------------------------------------------------------+
+-----------------------------------------------------------------------------+
|i12 : Y = weightedProjectiveSpace ({1,2,2,3,4}, CoefficientRing => ZZ/32003, |
|-----------------------------------------------------------------------------|
|Variable => y);                                                              |
+-----------------------------------------------------------------------------+
|i13 : rays Y                                                                 |
|                                                                             |
|o13 = {{-2, -2, -3, -4}, {1, 0, 0, 0}, {0, 1, 0, 0}, {0, 0, 1, 0}, {0, 0, 0, |
|      -----------------------------------------------------------------------|
|      1}}                                                                    |
|                                                                             |
|o13 : List                                                                   |
+-----------------------------------------------------------------------------+
|i14 : max Y                                                                  |
|                                                                             |
|o14 = {{0, 1, 2, 3}, {0, 1, 2, 4}, {0, 1, 3, 4}, {0, 2, 3, 4}, {1, 2, 3, 4}} |
|                                                                             |
|o14 : List                                                                   |
+-----------------------------------------------------------------------------+
|i15 : dim Y                                                                  |
|                                                                             |
|o15 = 4                                                                      |
+-----------------------------------------------------------------------------+
|i16 : ring Y                                                                 |
|                                                                             |
|        ZZ                                                                   |
|o16 = -----[y ..y ]                                                          |
|      32003  0   4                                                           |
|                                                                             |
|o16 : PolynomialRing                                                         |
+-----------------------------------------------------------------------------+
|i17 : assert (isWellDefined Y and isProjective Y and isSimplicial Y and not  |
|-----------------------------------------------------------------------------|
|isSmooth Y)                                                                  |
+-----------------------------------------------------------------------------+

The grading of the total coordinate ring for weighted projective space is
determined by the weights.  In particular, the class group is $\ZZ$.

+-------------------------------+
|i18 : classGroup PP4           |
|                               |
|        1                      |
|o18 = ZZ                       |
|                               |
|o18 : ZZ-module, free          |
+-------------------------------+
|i19 : degrees ring PP4         |
|                               |
|o19 = {{1}, {1}, {1}, {1}}     |
|                               |
|o19 : List                     |
+-------------------------------+
|i20 : classGroup X             |
|                               |
|        1                      |
|o20 = ZZ                       |
|                               |
|o20 : ZZ-module, free          |
+-------------------------------+
|i21 : degrees ring X           |
|                               |
|o21 = {{1}, {2}, {3}}          |
|                               |
|o21 : List                     |
+-------------------------------+
|i22 : classGroup Y             |
|                               |
|        1                      |
|o22 = ZZ                       |
|                               |
|o22 : ZZ-module, free          |
+-------------------------------+
|i23 : degrees ring Y           |
|                               |
|o23 = {{1}, {2}, {2}, {3}, {4}}|
|                               |
|o23 : List                     |
+-------------------------------+

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * toricProjectiveSpace(ZZ) -- make a
    projective space as a normal toric variety
  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
  * classGroup(NormalToricVariety),
    -- make the class group
  * isSimplicial(NormalToricVariety)
    -- whether a normal toric variety is
    simplicial
  * isSmooth(NormalToricVariety), --
    whether a normal toric variety is smooth

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

  * weightedProjectiveSpace(List), --
    make a weighted projective space
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricVarietiesDocumentation.m2:776:0.

weilDivisorGroup(NormalToricVariety) -- make the group of torus-invariant Weil divisors
***************************************************************************************

  * Function: weilDivisorGroup,
  * Usage:
        weilDivisorGroup X
  * Inputs:
      * X, a normal toric variety,
  * Outputs:
      * a module (Macaulay2Doc), a finitely generated free
        abelian group

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

The group of torus-invariant Weil divisors on a normal toric variety is the
free abelian group generated by the torus-invariant irreducible divisors.  The
irreducible divisors correspond bijectively to rays in the associated fan.
Since the rays are indexed in this package by $0, 1, \dots, n-1$ the group of
torus-invariant Weil divisors is canonically isomorphic to $\ZZ^n$.  For more
information, see Theorem 4.1.3 in Cox-Little-Schenck's Toric Varieties.

The examples illustrate various possible Weil groups.

+----------------------------------+
|i1 : PP2 = toricProjectiveSpace 2;|
+----------------------------------+
|i2 : # rays PP2                   |
|                                  |
|o2 = 3                            |
+----------------------------------+
|i3 : weilDivisorGroup PP2         |
|                                  |
|       3                          |
|o3 = ZZ                           |
|                                  |
|o3 : ZZ-module, free              |
+----------------------------------+
+-------------------------------+
|i4 : FF7 = hirzebruchSurface 7;|
+-------------------------------+
|i5 : # rays FF7                |
|                               |
|o5 = 4                         |
+-------------------------------+
|i6 : weilDivisorGroup FF7      |
|                               |
|       4                       |
|o6 = ZZ                        |
|                               |
|o6 : ZZ-module, free           |
+-------------------------------+
+-----------------------------------------------------+
|i7 : U = normalToricVariety ({{4,-1},{0,1}},{{0,1}});|
+-----------------------------------------------------+
|i8 : # rays U                                        |
|                                                     |
|o8 = 2                                               |
+-----------------------------------------------------+
|i9 : weilDivisorGroup U                              |
|                                                     |
|       2                                             |
|o9 = ZZ                                              |
|                                                     |
|o9 : ZZ-module, free                                 |
+-----------------------------------------------------+

To avoid duplicate computations, the attribute is cached in the normal toric
variety.

See also
========

  * working with divisors -- information about
    toric divisors and their related groups
  * NormalToricVariety _ ZZ -- make an
    irreducible torus-invariant divisor
  * fromCDivToWDiv(NormalToricVariety)
    -- get the map from Cartier
    divisors to Weil divisors
  * fromWDivToCl(NormalToricVariety)
    -- get the map from the group of Weil
    divisors to the class group
  * ToricDivisor -- the class of all torus-invariant Weil
    divisors
  * weilDivisorGroup(ToricMap) -- make
    the induced map between groups of Weil divisors

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

  * weilDivisorGroup(NormalToricVariety)
    -- make the group of
    torus-invariant Weil divisors
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:240:0.

weilDivisorGroup(ToricMap) -- make the induced map between groups of Weil divisors
**********************************************************************************

  * Function: weilDivisorGroup,
  * Usage:
        weilDivisorGroup f
  * Inputs:
      * f, a toric map, with a smooth target
  * Outputs:
      * a matrix (Macaulay2Doc), representing the map of abelian
        groups between the corresponding groups of torus-invariant Weil
        divisors

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

Given a toric map $f : X \to Y$ where $Y$ a smooth toric variety, this method
returns the induced map of abelian groups from the group of torus-invariant
Weil divisors on $Y$ to the group of torus-invariant Weil divisors on $X$.  For
arbitrary normal toric varieties, the weilDivisorGroup,
is not a functor.  However, see
weilDivisorGroup, is a contravariant
functor on the category of smooth,
normal toric varieties.

We illustrate this method on the projection from the first Hirzebruch surface,
to the projective line.

+--------------------------------------------------------------------+
|i1 : X = hirzebruchSurface 1;                                       |
+--------------------------------------------------------------------+
|i2 : Y = toricProjectiveSpace 1;                                    |
+--------------------------------------------------------------------+
|i3 : f = map(Y, X, matrix {{1, 0}})                                 |
|                                                                    |
|o3 = | 1 0 |                                                        |
|                                                                    |
|o3 : ToricMap Y <--- X                                              |
+--------------------------------------------------------------------+
|i4 : f' = weilDivisorGroup f                                        |
|                                                                    |
|o4 = | 0 1 |                                                        |
|     | 0 0 |                                                        |
|     | 1 0 |                                                        |
|     | 0 0 |                                                        |
|                                                                    |
|              4       2                                             |
|o4 : Matrix ZZ  <-- ZZ                                              |
+--------------------------------------------------------------------+
|i5 : assert (isWellDefined f and source f' == weilDivisorGroup Y and|
|         target f' == weilDivisorGroup X)                           |
+--------------------------------------------------------------------+

The next example gives the induced map from the group of torus-invariant Weil
divisors on the projective plane to the group of torus-invariant Weil divisors
on the first Hirzebruch surface.

+--------------------------------------------------------------------+
|i6 : Z = toricProjectiveSpace 2;                                    |
+--------------------------------------------------------------------+
|i7 : g = map(Z, X, matrix {{1, 0}, {0, -1}})                        |
|                                                                    |
|o7 = | 1 0  |                                                       |
|     | 0 -1 |                                                       |
|                                                                    |
|o7 : ToricMap Z <--- X                                              |
+--------------------------------------------------------------------+
|i8 : g' = weilDivisorGroup g                                        |
|                                                                    |
|o8 = | 0 1 0 |                                                      |
|     | 1 1 0 |                                                      |
|     | 1 0 0 |                                                      |
|     | 0 0 1 |                                                      |
|                                                                    |
|              4       3                                             |
|o8 : Matrix ZZ  <-- ZZ                                              |
+--------------------------------------------------------------------+
|i9 : assert (isWellDefined g and source g' == weilDivisorGroup Z and|
|         target g' == weilDivisorGroup X)                           |
+--------------------------------------------------------------------+

The induced map between the groups of torus-invariant Weil divisors is
compatible with the induced map between the class groups.

+-----------------------------------------------------------+
|i10 : g'' = classGroup g                                   |
|                                                           |
|o10 = | 0 |                                                |
|      | 1 |                                                |
|                                                           |
|               2       1                                   |
|o10 : Matrix ZZ  <-- ZZ                                    |
+-----------------------------------------------------------+
|i11 : assert(g'' * fromWDivToCl Z  == fromWDivToCl X  * g')|
+-----------------------------------------------------------+

See also
========

  * working with toric maps -- information
    about toric maps and the induced operations
  * weilDivisorGroup(NormalToricVariety)
    -- make the group of
    torus-invariant Weil divisors
  * classGroup(ToricMap) -- make the induced
    map between class groups
  * cartierDivisorGroup(NormalToricVariety)
    -- compute the group of
    torus-invariant Cartier divisors
  * pullback(ToricMap,ToricDivisor)
    -- make the pullback of a Cartier
    divisor under a toric map

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

  * weilDivisorGroup(ToricMap) -- make
    the induced map between groups of Weil divisors
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:1211:0.

working with divisors -- information about toric divisors and their related groups
**********************************************************************************

The following methods allows one to make and manipulate torus-invariant Weil
divisors on a normal toric variety.

Operations on toric divisors
============================

  * ToricDivisor -- the class of all torus-invariant Weil
    divisors
  * toricDivisor(List,NormalToricVariety)
    -- make a torus-invariant Weil
    divisor
  * toricDivisor(NormalToricVariety)
    -- make the canonical divisor
  * toricDivisor(Polyhedron) -- make the
    toric divisor associated to a polyhedron
  * smallAmpleToricDivisor(ZZ,ZZ),
    -- get a very ample toric divisor from the database
  * NormalToricVariety _ ZZ -- make an
    irreducible torus-invariant divisor
  * normalToricVariety(ToricDivisor) -- get
    the underlying normal toric variety
  * expression(ToricDivisor) -- get the
    expression used to format for printing
  * support(ToricDivisor) -- make the list of
    irreducible divisors with nonzero coefficients
  * entries(ToricDivisor) -- get the list of
    coefficients
  * ToricDivisor + ToricDivisor -- perform
    arithmetic on toric divisors
  * OO ToricDivisor -- make the associated rank-one
    reflexive sheaf
  * isEffective(ToricDivisor) -- whether
    a torus-invariant Weil divisor is effective
  * isCartier(ToricDivisor) -- whether a
    torus-invariant Weil divisor is Cartier
  * isQQCartier(ToricDivisor) -- whether
    a torus-invariant Weil divisor is QQ-Cartier
  * isNef(ToricDivisor) -- whether a
    torus-invariant Weil divisor is nef
  * nefGenerators(NormalToricVariety)
    -- compute generators of the nef
    cone
  * isAmple(ToricDivisor) -- whether a
    torus-invariant Weil divisor is ample
  * isVeryAmple(ToricDivisor) -- whether
    a torus-invariant Weil divisor is very ample
  * vertices(ToricDivisor) -- compute the
    vertices of the associated polytope
  * latticePoints(ToricDivisor), --
    compute the lattice points in the associated polytope
  * monomials(ToricDivisor) -- list the
    monomials that span the linear series
  * polytope(ToricDivisor) -- makes the
    associated 'Polyhedra' polyhedron

One can also work with the various groups arising from torus-invariant and the
canonical maps between them.

Associated groups and maps
==========================

  * weilDivisorGroup(NormalToricVariety)
    -- make the group of
    torus-invariant Weil divisors
  * fromWDivToCl(NormalToricVariety)
    -- get the map from the group of Weil
    divisors to the class group
  * classGroup(NormalToricVariety),
    -- make the class group
  * cartierDivisorGroup(NormalToricVariety)
    -- compute the group of
    torus-invariant Cartier divisors
  * fromCDivToWDiv(NormalToricVariety)
    -- get the map from Cartier
    divisors to Weil divisors
  * fromCDivToPic(NormalToricVariety)
    -- get the map from Cartier divisors
    to the Picard group
  * picardGroup(NormalToricVariety),
    -- make the Picard group
  * fromPicToCl(NormalToricVariety),
    -- get the map from Picard group to class group

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * resolving singularities -- information
    about find a smooth proper birational surjection
  * working with toric maps -- information
    about toric maps and the induced operations
  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/DivisorsDocumentation.m2:64:0.

working with sheaves -- information about coherent sheaves and total coordinate rings (a.k.a. Cox rings)
********************************************************************************************************

David A. Cox (see http://www3.amherst.edu/~dacox/ ) introduced the total
coordinate ring $S$ of a normal toric variety $X$ and the irrelevant ideal $B$.
The polynomial ring $S$ has one variable for each ray in the associated fan and
a natural grading by the class group.  The monomial ideal $B$ encodes the
maximal cones.  The following results of Cox indicate the significance of the
pair $(S,B)$.

  * The variety X is a good categorical quotient of Spec(S) -  V(B) by a
    suitable group action.
  * The category of coherent sheaves on X is equivalent to the quotient of the
    category of finitely generated graded S-modules by the full subcategory of
    B-torsion modules.

In particular, we may represent any coherent sheaf on $X$ by giving a finitely
generated graded $S$-module.

The following methods allow one to make and manipulate coherent sheaves on
normal toric varieties.

Sheaf-theoretic methods
=======================

  * ring(NormalToricVariety) -- make the
    total coordinate ring (a.k.a. Cox ring)
  * ideal(NormalToricVariety) -- make the
    irrelevant ideal
  * sheaf(NormalToricVariety,Ring),
    -- make a coherent sheaf of rings
  * sheaf(NormalToricVariety,Module)
    -- make a coherent sheaf
  * OO ToricDivisor -- make the associated rank-one
    reflexive sheaf
  * cotangentSheaf(NormalToricVariety)
    -- make the sheaf of Zariski
    1-forms
  * HH^ZZ(NormalToricVariety,CoherentSheaf)
    -- compute the cohomology of
    a coherent sheaf
  * intersectionRing(NormalToricVariety) -- make the rational
    Chow ring
  * chern(CoherentSheaf) (missing documentation)
  * ctop(CoherentSheaf) (missing documentation)
  * ch(CoherentSheaf) (missing documentation)
  * chi(CoherentSheaf) (missing documentation)
  * todd(CoherentSheaf) (missing documentation)
  * hilbertPolynomial(NormalToricVariety,CoherentSheaf)
    -- compute the
    multivariate Hilbert polynomial

See also
========

  * making normal toric varieties, --
    information about the basic constructors
  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * resolving singularities -- information
    about find a smooth proper birational surjection
  * working with toric maps -- information
    about toric maps and the induced operations
  * working with divisors -- information about
    toric divisors and their related groups
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/SheavesDocumentation.m2:60:0.

working with toric maps -- information about toric maps and the induced operations
**********************************************************************************

A toric map is a morphism $f : X \to Y$ between normal toric varieties that
induces a morphism of algebraic groups $g : T_X \to T_Y$ such that $f$ is
$T_X$-equivariant with respect to the $T_X$-action on $Y$ induced by $g$.
Every toric map $f : X \to Y$ corresponds to a unique map $f_N : N_X \to N_Y$
between the underlying lattices.

Although the primary method for creating a toric map is
map(NormalToricVariety,NormalToricVariety,Matrix),
there are a few
other constructors.

Making toric maps
=================

  * map(NormalToricVariety,NormalToricVariety,Matrix)
    -- make a
    torus-equivariant map between normal toric varieties
  * id _ NormalToricVariety -- make the
    identity map from a NormalToricVariety to itself
  * NormalToricVariety ^ Array -- make a
    canonical projection map
  * NormalToricVariety _ Array -- make a
    canonical inclusion into a product
  * diagonalToricMap -- make a diagonal map into a
    Cartesian product
  * ToricMap -- the class of all torus-equivariant maps
    between normal toric varieties
  * isWellDefined(ToricMap) -- whether a
    toric map is well defined

Having made a toric map, one can access its basic invariants
or test for some elementary properties by using the following methods.

Determining attributes and properties of toric maps
===================================================

  * source(ToricMap) -- get the source of the map
  * target(ToricMap) -- get the target of the map
  * matrix(ToricMap) -- get the underlying map of
    lattices
  * ToricMap * ToricMap -- make the composition
    of two toric maps
  * isProper(ToricMap) -- whether a toric map is
    proper
  * isFibration(ToricMap) -- whether a toric
    map is a fibration
  * isDominant(ToricMap) -- whether a toric
    map is dominant
  * isSurjective(ToricMap) -- whether a
    toric map is surjective

Several functorial aspects of normal toric varieties are also available.

Functorial aspects of toric maps
================================

  * weilDivisorGroup(ToricMap) -- make
    the induced map between groups of Weil divisors
  * classGroup(ToricMap) -- make the induced
    map between class groups
  * cartierDivisorGroup(ToricMap), --
    make the induced map between groups of Cartier divisors.
  * picardGroup(ToricMap) -- make the induced
    map between Picard groups
  * pullback(ToricMap,ToricDivisor)
    -- make the pullback of a Cartier
    divisor under a toric map
  * pullback(ToricMap,CoherentSheaf)
    -- make the pullback of a coherent
    sheaf under a toric map
  * inducedMap(ToricMap) -- make the induced
    map between total coordinate rings (a.k.a. Cox rings)
  * ideal(ToricMap) -- make the ideal defining the
    closure of the image

See also
========

  * finding attributes and properties,
    -- information about accessing features of a normal toric variety
  * working with divisors -- information about
    toric divisors and their related groups
  * working with sheaves -- information about
    coherent sheaves and total coordinate rings (a.k.a. Cox rings)
  * resolving singularities -- information
    about find a smooth proper birational surjection
-------------------------------------------------------------------------------

The source of this document is in
NormalToricVarieties/ToricMapsDocumentation.m2:71:0.