Macaulay2 » Documentation
Packages » BoijSoederberg :: matrix(BettiTally,ZZ,ZZ)
next | previous | forward | backward | up | index | toc

# matrix(BettiTally,ZZ,ZZ) -- Betti diagram to matrix

- Function: matrix
- Usage:
    `matrix B`
    `matrix(B,lowDegree)`
    `matrix(B,lowDegree,highDegree)`
- Inputs:
  - B, a Betti tally
  - lowDegree, an integer
  - highDegree, an integer
- Optional inputs:
  - Degree => ..., default value null,
- Outputs:
  - a matrix, The Betti diagram as a matrix

## Description

If either lowDegree or highDegree is not given, then they are inferred from the Betti diagram itself. The result matrix has highDegree-lowDegree+1 rows, corresponding to these (slanted) degrees.

    i1 : B = pureBettiDiagram {0,1,4,7}

                0  1 2 3
    o1 = total: 9 14 7 2
             0: 9 14 . .
             1: .  . . .
             2: .  . 7 .
             3: .  . . .
             4: .  . . 2

    o1 : BettiTally

    i2 : matrix B

    o2 = | 9 14 0 0 |
         | 0 0  0 0 |
         | 0 0  7 0 |
         | 0 0  0 0 |
         | 0 0  0 2 |

                  5       4
    o2 : Matrix ZZ  <-- ZZ

    i3 : matrix(B,-2)

    o3 = | 0 0  0 0 |
         | 0 0  0 0 |
         | 9 14 0 0 |
         | 0 0  0 0 |
         | 0 0  7 0 |
         | 0 0  0 0 |
         | 0 0  0 2 |

                  7       4
    o3 : Matrix ZZ  <-- ZZ

    i4 : matrix(B,-2,5)

    o4 = | 0 0  0 0 |
         | 0 0  0 0 |
         | 9 14 0 0 |
         | 0 0  0 0 |
         | 0 0  7 0 |
         | 0 0  0 0 |
         | 0 0  0 2 |
         | 0 0  0 0 |

                  8       4
    o4 : Matrix ZZ  <-- ZZ

This function is essentially the inverse of mat2betti.

    i5 : R = ZZ/101[a..e];

    i6 : I = ideal borel monomialIdeal"abc,ad3,e4";

    o6 : Ideal of R

    i7 : B = betti res I

                0  1   2   3   4  5
    o7 = total: 1 56 182 232 135 30
             0: 1  .   .   .   .  .
             1: .  .   .   .   .  .
             2: .  5   6   2   .  .
             3: . 51 176 230 135 30

    o7 : BettiTally

    i8 : C = matrix B

    o8 = | 1 0  0   0   0   0  |
         | 0 0  0   0   0   0  |
         | 0 5  6   2   0   0  |
         | 0 51 176 230 135 30 |

                  4       6
    o8 : Matrix ZZ  <-- ZZ

    i9 : B == mat2betti C

    o9 = true

If the lowest degree of the matrix is not 0, then this information must be supplied in order to obtain the inverse operation.

    i10 : B = pureBettiDiagram {-2,0,1,2,5}

                 0  1  2  3 4
    o10 = total: 5 42 70 35 2
             -2: 5  .  .  . .
             -1: . 42 70 35 .
              0: .  .  .  . .
              1: .  .  .  . 2

    o10 : BettiTally

    i11 : C = matrix B

    o11 = | 5 0  0  0  0 |
          | 0 42 70 35 0 |
          | 0 0  0  0  0 |
          | 0 0  0  0  2 |

                   4       5
    o11 : Matrix ZZ  <-- ZZ

    i12 : mat2betti(C,-2)

                 0  1  2  3 4
    o12 = total: 5 42 70 35 2
             -2: 5  .  .  . .
             -1: . 42 70 35 .
              0: .  .  .  . .
              1: .  .  .  . 2

    o12 : BettiTally

## Caveat

Currently, the error messages are not that illuminating. The [lowDegree, highDegree], if given, must be as large as the actual degree range

## See also

- mat2betti -- matrix to Betti diagram
- lowestDegrees -- list of lowest degree shifts
- highestDegrees -- list of highest degree shifts
- isPure -- is a Betti diagram pure?
- pureBettiDiagram -- pure Betti diagram given a list of degrees

## Ways to use this method:

- `matrix(BettiTally)`
- `matrix(BettiTally,ZZ)`
- matrix(BettiTally,ZZ,ZZ) -- Betti diagram to matrix

The source of this document is in /build/macaulay2-88fgJW/macaulay2-1.25.11+ds/M2/Macaulay2/packages/BoijSoederberg.m2:1927:0.