Macaulay2 » Documentation
Packages » ReflexivePolytopesDB :: matrix(KSEntry)
next | previous | forward | backward | up | index | toc

matrix(KSEntry) -- convert a Kreuzer-Skarke entry to a matrix of integers

Synopsis

Description

This utility function is used to parse, as matrices of integers, example polytopes returned by the Kreuzer-Skarke database.

i1 : e = KSEntry "4 5  M:53 5 N:9 5 H:3,43 [-80] id:0
       1   0   2   4 -10
       0   1   3   5  -9
       0   0   4   0  -4
       0   0   0   8  -8
       ";
i2 : A = matrix e

o2 = | 1 0 2 4 -10 |
     | 0 1 3 5 -9  |
     | 0 0 4 0 -4  |
     | 0 0 0 8 -8  |

              4       5
o2 : Matrix ZZ  <-- ZZ

The actual format allowed is the following: The first non-empty line is ignored (this is the description line from the Kreuzer-Skarke database), the rest of the lines make up the matrix: spaces, tabs, and commas are all separators for elements of the array. Newlines, and ] characters separate rows. Finally, each empty line is ignored, and the remaining lines must all have the same number of elements.

The actual format allowed for matrices is described in matrixFromString. After calling kreuzerSkarke to get a list of KSEntry's, one uses matrix(KSEntry) to obtain a matrix . Then use this function to obtain the matrix.

i3 : topes = kreuzerSkarke(300, Limit=>3)
using offline data file: ks300-n20.txt

o3 = {4 9  M:26 9 N:415 10 H:300,14 [572] id:0     , 4 9  M:27 9 N:411
          1    0    0   -7    0  -23   -1   -3   -7      1    0    0  
          0    1    0   -4    0  -15   -1   -2   -5      0    1    0  
          0    0    1   -2    0   -6    0   -1   -2      0    0    1  
          0    0    0    0    1   -1    1    1    1      0    0    0  
     ------------------------------------------------------------------------
     9 H:300,14 [572] id:1      , 4 6  M:26 6 N:416 7 H:300,18 [564] id:2}
     -3    0  -23   -1   -3   -7      1    0    0  -21    0  -23
     -1    0  -15   -1   -2   -5      0    1    0  -14    0  -15
     -1    0   -6    0   -1   -2      0    0    1   -6    0   -6
      0    1   -1    1    1    1      0    0    0    0    1   -1

o3 : List
i4 : netList topes

     +---------------------------------------------+
o4 = |4 9  M:26 9 N:415 10 H:300,14 [572] id:0     |
     |    1    0    0   -7    0  -23   -1   -3   -7|
     |    0    1    0   -4    0  -15   -1   -2   -5|
     |    0    0    1   -2    0   -6    0   -1   -2|
     |    0    0    0    0    1   -1    1    1    1|
     +---------------------------------------------+
     |4 9  M:27 9 N:411 9 H:300,14 [572] id:1      |
     |    1    0    0   -3    0  -23   -1   -3   -7|
     |    0    1    0   -1    0  -15   -1   -2   -5|
     |    0    0    1   -1    0   -6    0   -1   -2|
     |    0    0    0    0    1   -1    1    1    1|
     +---------------------------------------------+
     |4 6  M:26 6 N:416 7 H:300,18 [564] id:2      |
     |    1    0    0  -21    0  -23               |
     |    0    1    0  -14    0  -15               |
     |    0    0    1   -6    0   -6               |
     |    0    0    0    0    1   -1               |
     +---------------------------------------------+
i5 : topes/matrix

o5 = {| 1 0 0 -7 0 -23 -1 -3 -7 |, | 1 0 0 -3 0 -23 -1 -3 -7 |, | 1 0 0 -21 0
      | 0 1 0 -4 0 -15 -1 -2 -5 |  | 0 1 0 -1 0 -15 -1 -2 -5 |  | 0 1 0 -14 0
      | 0 0 1 -2 0 -6  0  -1 -2 |  | 0 0 1 -1 0 -6  0  -1 -2 |  | 0 0 1 -6  0
      | 0 0 0 0  1 -1  1  1  1  |  | 0 0 0 0  1 -1  1  1  1  |  | 0 0 0 0   1
     ------------------------------------------------------------------------
     -23 |}
     -15 |
     -6  |
     -1  |

o5 : List

See also

Ways to use this method: