matrix(BettiTally,ZZ,ZZ) -- Betti diagram to matrix
Synopsis
-
Function: matrix
-
- Usage:
matrix B
matrix(B,lowDegree)
matrix(B,lowDegree,highDegree)
-
Inputs:
-
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