This is CohomCalg.info, produced by Macaulay2, version 1.20

CohomCalg -- an interface to the CohomCalg software for computing cohomology of torus invariant divisors on a toric variety
***************************************************************************************************************************

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

CohomCalg is software written by Benjamin Jurke and Thorsten Rahn (in
collaboration with Ralph Blumenhagen and Helmut Roschy) for computing the
cohomology vectors of torus invariant divisors on a (normal) toric variety (see
https://github.com/BenjaminJurke/cohomCalg for more information).

CohomCalg is an efficient and careful implementation. One limitation is that
the number of rays in the fan and the number of generators of the
Stanley-Reisner ideal of the fan must both be no larger than 64.

Here is a sample usage of this package in Macaulay2.  Let's compute the
cohomology of some divisors on a smooth Fano toric variety.

+-----------------------------------------------------------------------------+
|i1 : needsPackage "NormalToricVarieties"                                     |
|                                                                             |
|o1 = NormalToricVarieties                                                    |
|                                                                             |
|o1 : Package                                                                 |
+-----------------------------------------------------------------------------+
|i2 : X = smoothFanoToricVariety(3,15)                                        |
|                                                                             |
|o2 = X                                                                       |
|                                                                             |
|o2 : NormalToricVariety                                                      |
+-----------------------------------------------------------------------------+
|i3 : rays X                                                                  |
|                                                                             |
|o3 = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}, {0, -1, -1}, {0, -1, 0}, {-1, 0, 0},  |
|     ------------------------------------------------------------------------|
|     {-1, 1, 0}}                                                             |
|                                                                             |
|o3 : List                                                                    |
+-----------------------------------------------------------------------------+
|i4 : max X                                                                   |
|                                                                             |
|o4 = {{0, 1, 2}, {0, 1, 3}, {0, 2, 4}, {0, 3, 4}, {1, 2, 6}, {1, 3, 6}, {2,  |
|     ------------------------------------------------------------------------|
|     4, 5}, {2, 5, 6}, {3, 4, 5}, {3, 5, 6}}                                 |
|                                                                             |
|o4 : List                                                                    |
+-----------------------------------------------------------------------------+
|i5 : S = ring X                                                              |
|                                                                             |
|o5 = S                                                                       |
|                                                                             |
|o5 : PolynomialRing                                                          |
+-----------------------------------------------------------------------------+
|i6 : SR = dual monomialIdeal X                                               |
|                                                                             |
|o6 = monomialIdeal (x x , x x , x x , x x , x x , x x )                      |
|                     2 3   1 4   0 5   1 5   0 6   4 6                       |
|                                                                             |
|o6 : MonomialIdeal of S                                                      |
+-----------------------------------------------------------------------------+
|i7 : KX = toricDivisor X                                                     |
|                                                                             |
|o7 = - X  - X  - X  - X  - X  - X  - X                                       |
|        0    1    2    3    4    5    6                                      |
|                                                                             |
|o7 : ToricDivisor on X                                                       |
+-----------------------------------------------------------------------------+
|i8 : assert isVeryAmple (-KX)                                                |
+-----------------------------------------------------------------------------+
|i9 : cohoms1 = for i from 0 to 6 list X_i => cohomCalg X_i                   |
|                                                                             |
|o9 = {X  => {2, 0, 0, 0}, X  => {1, 0, 0, 0}, X  => {2, 0, 0, 0}, X  => {2,  |
|       0                   1                   2                   3         |
|     ------------------------------------------------------------------------|
|     0, 0, 0}, X  => {1, 0, 0, 0}, X  => {1, 0, 0, 0}, X  => {1, 0, 0, 0}}   |
|                4                   5                   6                    |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+
|i10 : cohoms2 = for i from 0 to 6  list X_i => (                             |
|          for j from 0 to dim X list rank HH^j(X, OO_X(toSequence degree X_i)|
|          )                                                                  |
|                                                                             |
|o10 = {X  => {2, 0, 0, 0}, X  => {1, 0, 0, 0}, X  => {2, 0, 0, 0}, X  => {2, |
|        0                   1                   2                   3        |
|      -----------------------------------------------------------------------|
|      0, 0, 0}, X  => {1, 0, 0, 0}, X  => {1, 0, 0, 0}, X  => {1, 0, 0, 0}}  |
|                 4                   5                   6                   |
|                                                                             |
|o10 : List                                                                   |
|-----------------------------------------------------------------------------|
|)                                                                            |
+-----------------------------------------------------------------------------+
|i11 : assert(cohoms1 === cohoms2)                                            |
+-----------------------------------------------------------------------------+

For efficiency reasons, it is better, if this works for your use, to call
CohomCalg by batching together several cohomology requests.

+-----------------------------------------------------------------------------+
|i12 : needsPackage "ReflexivePolytopesDB"                                    |
|                                                                             |
|o12 = ReflexivePolytopesDB                                                   |
|                                                                             |
|o12 : Package                                                                |
+-----------------------------------------------------------------------------+
|i13 : topes = kreuzerSkarke(21, Limit => 20);                                |
|using offline data file: ks21-n100.txt                                       |
+-----------------------------------------------------------------------------+
|i14 : A = matrix topes_10                                                    |
|                                                                             |
|o14 = | 1 0 0 -1 2  0  0 -3 -2 1  |                                          |
|      | 0 1 0 1  -1 1  0 1  0  -1 |                                          |
|      | 0 0 1 1  -1 -1 0 4  2  -2 |                                          |
|      | 0 0 0 0  0  0  1 -1 -1 1  |                                          |
|                                                                             |
|               4        10                                                   |
|o14 : Matrix ZZ  <--- ZZ                                                     |
+-----------------------------------------------------------------------------+
|i15 : P = convexHull A                                                       |
|                                                                             |
|o15 = P                                                                      |
|                                                                             |
|o15 : Polyhedron                                                             |
+-----------------------------------------------------------------------------+
|i16 : X = normalToricVariety P                                               |
|                                                                             |
|o16 = X                                                                      |
|                                                                             |
|o16 : NormalToricVariety                                                     |
+-----------------------------------------------------------------------------+
|i17 : SR = dual monomialIdeal X                                              |
|                                                                             |
|o17 = monomialIdeal (x x , x x x , x x , x x x , x x x , x x x x , x x x ,   |
|                      1 2   0 1 3   0 4   0 2 6   0 3 6   1 3 5 6   1 3 7    |
|      -----------------------------------------------------------------------|
|      x x x , x x x x , x x x , x x x , x x x x , x x x x , x x x , x x x x ,|
|       1 4 7   0 3 5 7   2 4 8   2 6 8   3 5 6 8   4 5 6 8   4 7 8   2 5 7 8 |
|      -----------------------------------------------------------------------|
|      x x x x , x x x x , x x x , x x x , x x , x x x , x x x , x x x ,      |
|       3 5 7 8   3 6 7 8   0 1 9   2 4 9   5 9   0 6 9   2 6 9   1 7 9       |
|      -----------------------------------------------------------------------|
|      x x x )                                                                |
|       4 7 9                                                                 |
|                                                                             |
|o17 : MonomialIdeal of QQ[x ..x ]                                            |
|                           0   9                                             |
+-----------------------------------------------------------------------------+
|i18 : D2 = subsets(for i from 0 to #rays X - 1 list (-X_i), 2)               |
|                                                                             |
|o18 = {{- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }, |
|           0     1       0     2       1     2       0     3       1     3   |
|      -----------------------------------------------------------------------|
|      {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X },  |
|          2     3       0     4       1     4       2     4       3     4    |
|      -----------------------------------------------------------------------|
|      {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X },  |
|          0     5       1     5       2     5       3     5       4     5    |
|      -----------------------------------------------------------------------|
|      {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X },  |
|          0     6       1     6       2     6       3     6       4     6    |
|      -----------------------------------------------------------------------|
|      {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X },  |
|          5     6       0     7       1     7       2     7       3     7    |
|      -----------------------------------------------------------------------|
|      {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X },  |
|          4     7       5     7       6     7       0     8       1     8    |
|      -----------------------------------------------------------------------|
|      {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X },  |
|          2     8       3     8       4     8       5     8       6     8    |
|      -----------------------------------------------------------------------|
|      {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X },  |
|          7     8       0     9       1     9       2     9       3     9    |
|      -----------------------------------------------------------------------|
|      {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }, {- X , - X }}  |
|          4     9       5     9       6     9       7     9       8     9    |
|                                                                             |
|o18 : List                                                                   |
+-----------------------------------------------------------------------------+
|i19 : D2 = D2/sum/degree                                                     |
|                                                                             |
|o19 = {{0, 1, -2, -2, 4, 0}, {0, 1, -1, 1, 0, -2}, {2, 2, 3, 1, -4, -6}, {-1,|
|      -----------------------------------------------------------------------|
|      0, -4, -2, 5, 3}, {1, 1, 0, -2, 1, -1}, {1, 1, 1, 1, -3, -3}, {-2, 0,  |
|      -----------------------------------------------------------------------|
|      -3, -1, 4, 2}, {0, 1, 1, -1, 0, -2}, {0, 1, 2, 2, -4, -4}, {-1, 0, -1, |
|      -----------------------------------------------------------------------|
|      -1, 1, 1}, {-1, -1, -3, -1, 4, 2}, {1, 0, 1, -1, 0, -2}, {1, 0, 2, 2,  |
|      -----------------------------------------------------------------------|
|      -4, -4}, {0, -1, -1, -1, 1, 1}, {-1, -1, 0, 0, 0, 0}, {-1, 0, -4, -1,  |
|      -----------------------------------------------------------------------|
|      4, 2}, {1, 1, 0, -1, 0, -2}, {1, 1, 1, 2, -4, -4}, {0, 0, -2, -1, 1,   |
|      -----------------------------------------------------------------------|
|      1}, {-1, 0, -1, 0, 0, 0}, {0, -1, -1, 0, 0, 0}, {-1, 0, -3, -2, 4, 2}, |
|      -----------------------------------------------------------------------|
|      {1, 1, 1, -2, 0, -2}, {1, 1, 2, 1, -4, -4}, {0, 0, -1, -2, 1, 1}, {-1, |
|      -----------------------------------------------------------------------|
|      0, 0, -1, 0, 0}, {0, -1, 0, -1, 0, 0}, {0, 0, -1, -1, 0, 0}, {-1, 0,   |
|      -----------------------------------------------------------------------|
|      -3, -1, 3, 2}, {1, 1, 1, -1, -1, -2}, {1, 1, 2, 2, -5, -4}, {0, 0, -1, |
|      -----------------------------------------------------------------------|
|      -1, 0, 1}, {-1, 0, 0, 0, -1, 0}, {0, -1, 0, 0, -1, 0}, {0, 0, -1, 0,   |
|      -----------------------------------------------------------------------|
|      -1, 0}, {0, 0, 0, -1, -1, 0}, {-1, 0, -3, -1, 4, 1}, {1, 1, 1, -1, 0,  |
|      -----------------------------------------------------------------------|
|      -3}, {1, 1, 2, 2, -4, -5}, {0, 0, -1, -1, 1, 0}, {-1, 0, 0, 0, 0, -1}, |
|      -----------------------------------------------------------------------|
|      {0, -1, 0, 0, 0, -1}, {0, 0, -1, 0, 0, -1}, {0, 0, 0, -1, 0, -1}, {0,  |
|      -----------------------------------------------------------------------|
|      0, 0, 0, -1, -1}}                                                      |
|                                                                             |
|o19 : List                                                                   |
+-----------------------------------------------------------------------------+
|i20 : elapsedTime hvecs = cohomCalg(X, D2)                                   |
| -- 3.76463 seconds elapsed                                                  |
|                                                                             |
|o20 = {{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 1, 0, 0, 0}, {0, 0, 0, 0, 0},   |
|      -----------------------------------------------------------------------|
|      {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 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}, {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}, {0, 0, 0, 0, 0}, {0, 1, 0, 0, |
|      -----------------------------------------------------------------------|
|      0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}}                 |
|                                                                             |
|o20 : List                                                                   |
+-----------------------------------------------------------------------------+
|i21 : peek cohomCalg X                                                       |
|                                                                             |
|o21 = MutableHashTable{{-1, -1, -3, -1, 4, 2} => {{0, 0, 0, 0, 0}, {}}       |
|                       {-1, -1, 0, 0, 0, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {-1, 0, -1, -1, 1, 1} => {{0, 0, 0, 0, 0}, {}}        |
|                       {-1, 0, -1, 0, 0, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {-1, 0, -3, -1, 3, 2} => {{0, 0, 0, 0, 0}, {}}        |
|                       {-1, 0, -3, -1, 4, 1} => {{0, 0, 0, 0, 0}, {}}        |
|                       {-1, 0, -3, -2, 4, 2} => {{0, 0, 0, 0, 0}, {}}        |
|                       {-1, 0, -4, -1, 4, 2} => {{0, 0, 0, 0, 0}, {}}        |
|                       {-1, 0, -4, -2, 5, 3} => {{0, 0, 0, 0, 0}, {}}        |
|                       {-1, 0, 0, -1, 0, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {-1, 0, 0, 0, -1, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {-1, 0, 0, 0, 0, -1} => {{0, 0, 0, 0, 0}, {}}         |
|                       {-2, 0, -3, -1, 4, 2} => {{0, 1, 0, 0, 0}, {{1, 1x0   |
|                       {0, -1, -1, -1, 1, 1} => {{0, 0, 0, 0, 0}, {}}        |
|                       {0, -1, -1, 0, 0, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, -1, 0, -1, 0, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, -1, 0, 0, -1, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, -1, 0, 0, 0, -1} => {{0, 1, 0, 0, 0}, {{1, 1x5*   |
|                       {0, 0, -1, -1, 0, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 0, -1, -1, 0, 1} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 0, -1, -1, 1, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 0, -1, -2, 1, 1} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 0, -1, 0, -1, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 0, -1, 0, 0, -1} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 0, -2, -1, 1, 1} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 0, 0, -1, -1, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 0, 0, -1, 0, -1} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 0, 0, 0, -1, -1} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 1, -1, 1, 0, -2} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 1, -2, -2, 4, 0} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 1, 1, -1, 0, -2} => {{0, 0, 0, 0, 0}, {}}         |
|                       {0, 1, 2, 2, -4, -4} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 0, 1, -1, 0, -2} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 0, 2, 2, -4, -4} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 1, 0, -1, 0, -2} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 1, 0, -2, 1, -1} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 1, 1, -1, -1, -2} => {{0, 0, 0, 0, 0}, {}}        |
|                       {1, 1, 1, -1, 0, -3} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 1, 1, -2, 0, -2} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 1, 1, 1, -3, -3} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 1, 1, 2, -4, -4} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 1, 2, 1, -4, -4} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 1, 2, 2, -4, -5} => {{0, 0, 0, 0, 0}, {}}         |
|                       {1, 1, 2, 2, -5, -4} => {{0, 0, 0, 0, 0}, {}}         |
|                       {2, 2, 3, 1, -4, -6} => {{0, 1, 0, 0, 0}, {{1, 1x1*   |
|-----------------------------------------------------------------------------|
|      }                                                                      |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|*x4}}}                                                                       |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|x9}}}                                                                        |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|                                                                             |
|x2}}}                                                                        |
+-----------------------------------------------------------------------------+
|i22 : degree(X_3 + X_7 + X_8)                                                |
|                                                                             |
|o22 = {0, 0, 1, 2, 0, -1}                                                    |
|                                                                             |
|o22 : List                                                                   |
+-----------------------------------------------------------------------------+
|i23 : elapsedTime cohomvec1 = cohomCalg(X_3 + X_7 + X_8)                     |
| -- 1.18178 seconds elapsed                                                  |
|                                                                             |
|o23 = {1, 0, 0, 0, 0}                                                        |
|                                                                             |
|o23 : List                                                                   |
+-----------------------------------------------------------------------------+
|i24 : elapsedTime cohomvec2 = for j from 0 to dim X list rank HH^j(X,        |
| -- 30.1668 seconds elapsed                                                  |
|                                                                             |
|o24 = {1, 0, 0, 0, 0}                                                        |
|                                                                             |
|o24 : List                                                                   |
|-----------------------------------------------------------------------------|
|OO_X(0,0,1,2,0,-1))                                                          |
+-----------------------------------------------------------------------------+
|i25 : assert(cohomvec1 == cohomvec2)                                         |
+-----------------------------------------------------------------------------+
|i26 : degree(X_3 + X_7 - X_8)                                                |
|                                                                             |
|o26 = {0, 0, 1, 2, -2, -1}                                                   |
|                                                                             |
|o26 : List                                                                   |
+-----------------------------------------------------------------------------+
|i27 : elapsedTime cohomvec1 = cohomCalg(X_3 + X_7 - X_8)                     |
| -- 1.12609 seconds elapsed                                                  |
|                                                                             |
|o27 = {0, 0, 0, 0, 0}                                                        |
|                                                                             |
|o27 : List                                                                   |
+-----------------------------------------------------------------------------+
|i28 : elapsedTime cohomvec2 = elapsedTime for j from 0 to dim X list rank    |
| -- 1.53245 seconds elapsed                                                  |
| -- 1.53247 seconds elapsed                                                  |
|                                                                             |
|o28 = {0, 0, 0, 0, 0}                                                        |
|                                                                             |
|o28 : List                                                                   |
|-----------------------------------------------------------------------------|
|HH^j(X, OO_X(0,0,1,2,-2,-1))                                                 |
+-----------------------------------------------------------------------------+
|i29 : assert(cohomvec1 == cohomvec2)                                         |
+-----------------------------------------------------------------------------+

See cohomCalg, computes cohomology vectors by calling CohomCalg.
It also stashes it's results in the toric variety's cache table, so
computations need not be performed twice.

See also
========

  * cohomCalg -- compute cohomology vectors using the
    CohomCalg software

Author
======

  * Michael E. Stillman (see
    http://www.math.cornell.edu/People/Faculty/stillman.html )
    <mike@math.cornell.edu>

Version
=======

This documentation describes version 0.8 of CohomCalg.

Source code
===========

The source code from which this documentation is derived is in the file
CohomCalg.m2 (see common/share/Macaulay2/CohomCalg.m2 ). The auxiliary files
accompanying it are in the directory CohomCalg/ (see
common/share/Macaulay2/CohomCalg/ ).

Exports
=======

  * Functions and commands
      * cohomCalg -- compute cohomology vectors using the
        CohomCalg software
  * Methods
      * "cohomCalg(NormalToricVariety,List)" -- see cohomCalg,
        -- compute cohomology vectors using the CohomCalg software
      * "cohomCalg(NormalToricVariety,ToricDivisor)" -- see cohomCalg,
        -- compute cohomology vectors using the CohomCalg software
      * "cohomCalg(ToricDivisor)" -- see cohomCalg, -- compute
        cohomology vectors using the CohomCalg software
      * cohomCalg(NormalToricVariety),
        -- locally stashed cohomology vectors from CohomCalg
  * Symbols
      * "Silent" -- see cohomCalg, -- compute cohomology
        vectors using the CohomCalg software

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

The object CohomCalg, is a package (Macaulay2Doc).

cohomCalg -- compute cohomology vectors using the CohomCalg software
********************************************************************

Synopsis
========

  * Usage:
        cvecs = cohomCalg(X, L)
        cvecs = cohomCalg D
  * Inputs:
      * X, a normal toric variety (NormalToricVarieties),
      * L, a list (Macaulay2Doc), of toric divisors, or degrees, or
        a single degree, or a toric divisor
      * D, a toric divisor (NormalToricVarieties), a single
        toric divisor
  * Optional inputs (Macaulay2Doc),:
      * Silent (missing documentation) => a Boolean value (Macaulay2Doc),
        default value null, but if null, then the
        default value from the configuration file is overridden by this value.
        If true, then all output from CohomCalg is suppressed.
  * Outputs:
      * cvecs, a list (Macaulay2Doc), The list of cohomology
        vectors of the toric divisors in L (or a single list, if the input was
        a single degree or toric divisor)
  * Consequences:
      * The answers are stashed into the mutable hashtable X.cache#CohomCalg,
        and are not recomputed if possible.

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

Given a toric divisor D, or its degree d, its cohomology vector is the list
$\{h^0(X, OO_X(d)), h^1(X, OO_X(d)), \ldots, h^{dim X}(X, OO_X(d)) \}$.

Here is an example.

+-------------------------------------------+
|i1 : needsPackage "ReflexivePolytopesDB"   |
|                                           |
|o1 = ReflexivePolytopesDB                  |
|                                           |
|o1 : Package                               |
+-------------------------------------------+
|i2 : topes = kreuzerSkarke(5, Limit => 20);|
|using offline data file: ks5-n50.txt       |
+-------------------------------------------+
|i3 : A = matrix topes_15                   |
|                                           |
|o3 = | 1 1 0 1 -1 -2 1  |                  |
|     | 0 2 0 0 -4 0  6  |                  |
|     | 0 0 1 0 2  -1 -4 |                  |
|     | 0 0 0 2 -2 0  0  |                  |
|                                           |
|              4        7                   |
|o3 : Matrix ZZ  <--- ZZ                    |
+-------------------------------------------+
|i4 : P = convexHull A                      |
|                                           |
|o4 = P                                     |
|                                           |
|o4 : Polyhedron                            |
+-------------------------------------------+
|i5 : X = normalToricVariety P              |
|                                           |
|o5 = X                                     |
|                                           |
|o5 : NormalToricVariety                    |
+-------------------------------------------+
|i6 : D = 3 * X_0 - 5 * X_4                 |
|                                           |
|o6 = 3*X  - 5*X                            |
|        0      4                           |
|                                           |
|o6 : ToricDivisor on X                     |
+-------------------------------------------+
|i7 : cohomCalg(D, Silent => true)          |
|                                           |
|o7 = {0, 0, 0, 194, 0}                     |
|                                           |
|o7 : List                                  |
+-------------------------------------------+

We compare this to the results from NormalToricVarieties.

+-----------------------------------------------------------------------------+
|i8 : cohomCalg(X, D)                                                         |
|                                                                             |
|o8 = {0, 0, 0, 194, 0}                                                       |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : for i from 0 to dim X list rank HH^i(X, OO D)                           |
|                                                                             |
|o9 = {0, 0, 0, 194, 0}                                                       |
|                                                                             |
|o9 : List                                                                    |
+-----------------------------------------------------------------------------+
|i10 : peek cohomCalg X                                                       |
|                                                                             |
|o10 = MutableHashTable{{-22, 3, 17} => {{0, 0, 0, 194, 0}, {{3,              |
|      -----------------------------------------------------------------------|
|      1x1*x2*x4*x5}, {3, 1x1*x2*x3*x4*x5}, {3, 1x1*x2*x4*x5*x6}}}}           |
+-----------------------------------------------------------------------------+

See also
========

  * cohomCalg(NormalToricVariety), --
    locally stashed cohomology vectors from CohomCalg
  * ReflexivePolytopesDB -- simple access to
    Kreuzer-Skarke database of reflexive polytopes of dimensions 3 and 4

Ways to use cohomCalg :
=======================

  * "cohomCalg(NormalToricVariety,List)"
  * "cohomCalg(NormalToricVariety,ToricDivisor)"
  * "cohomCalg(ToricDivisor)"
  * cohomCalg(NormalToricVariety), --
    locally stashed cohomology vectors from CohomCalg

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

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

cohomCalg(NormalToricVariety) -- locally stashed cohomology vectors from CohomCalg
**********************************************************************************

Synopsis
========

  * Function: cohomCalg,
  * Usage:
        H = cohomCalg X
  * Inputs:
      * X, a normal toric variety (NormalToricVarieties),
  * Optional inputs (Macaulay2Doc),:
      * Silent (missing documentation) => a Boolean value (Macaulay2Doc),
        default value null, Not used in this particular
        method
  * Outputs:
      * H, a mutable hash table (Macaulay2Doc),
  * Consequences:
      * The mutable hash table is stashed into X.cache#CohomCalg.  If it
        doesn't exist yet, it is created.

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

The keys of this hash table are the divisor classes (degrees) whose cohomology
vector has already been computed.  The value of the hash table for this key is
a list of two things: the cohomology vector, and a list representing the
denominators which appear for this degree.

+-------------------------------------------+
|i1 : needsPackage "ReflexivePolytopesDB"   |
|                                           |
|o1 = ReflexivePolytopesDB                  |
|                                           |
|o1 : Package                               |
+-------------------------------------------+
|i2 : topes = kreuzerSkarke(5, Limit => 20);|
|using offline data file: ks5-n50.txt       |
+-------------------------------------------+
|i3 : A = matrix topes_15                   |
|                                           |
|o3 = | 1 1 0 1 -1 -2 1  |                  |
|     | 0 2 0 0 -4 0  6  |                  |
|     | 0 0 1 0 2  -1 -4 |                  |
|     | 0 0 0 2 -2 0  0  |                  |
|                                           |
|              4        7                   |
|o3 : Matrix ZZ  <--- ZZ                    |
+-------------------------------------------+
|i4 : P = convexHull A                      |
|                                           |
|o4 = P                                     |
|                                           |
|o4 : Polyhedron                            |
+-------------------------------------------+
|i5 : X = normalToricVariety P              |
|                                           |
|o5 = X                                     |
|                                           |
|o5 : NormalToricVariety                    |
+-------------------------------------------+
|i6 : H = cohomCalg X                       |
|                                           |
|o6 = MutableHashTable{}                    |
|                                           |
|o6 : MutableHashTable                      |
+-------------------------------------------+

Notice that the hash table H is empty, as we haven't tried computing any
cohomology vectors yet.

+-----------------------------------------------------------------------------+
|i7 : cohomCalg(X, {-4, 10, -9})                                              |
|                                                                             |
|o7 = {0, 0, 0, 12960, 0}                                                     |
|                                                                             |
|o7 : List                                                                    |
+-----------------------------------------------------------------------------+
|i8 : for i from 0 to dim X list rank HH^i(X, OO_X(-4, 10, -9))               |
|                                                                             |
|o8 = {0, 0, 0, 12960, 0}                                                     |
|                                                                             |
|o8 : List                                                                    |
+-----------------------------------------------------------------------------+
|i9 : peek cohomCalg X                                                        |
|                                                                             |
|o9 = MutableHashTable{{-4, 10, -9} => {{0, 0, 0, 12960, 0}, {{3,             |
|     ------------------------------------------------------------------------|
|     1x0*x1*x2*x6}, {3, 1x0*x1*x2*x3*x6}, {3, 1x0*x1*x2*x4*x6}}}}            |
+-----------------------------------------------------------------------------+

See also
========

  * cohomCalg -- compute cohomology vectors using the
    CohomCalg software

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

  * cohomCalg(NormalToricVariety), --
    locally stashed cohomology vectors from CohomCalg