# slackFromGaleCircuits -- computes the slack matrix of a polytope from a Gale transform of the polytope

## Synopsis

• Usage:
M = slackFromGaleCircuits(G, Tolerance => 12)
M = slackFromGaleCircuits G
• Inputs:
• G, , matrix of the form matrix(RR, ...) whose columns are the vectors of a Gale transform
• Optional inputs:
• Tolerance => ..., -- specifies the tolerance to compute the slack matrix of a polytope from a Gale transform of a polytope
• Outputs:
• SP, , the slack matrix of the polytope whose Gale transform is G

## Description

This function computes the slack matrix of a polytope starting from a matrix whose columns correspond to the vertices of a Gale transform of the polytope. The second argument Tolerance, which is optional, is a positive integer that expresses the tolerance used in the computations, i.e. if an entry of a matrix is less than 10(-Tolerance), then it will be treated as zero. The default value for the tolerance is 14.

 ```i1 : G = matrix(RR, {{0, 1, -1, 0, -1, 1}, {1, 0, -1, -1, 0, 1}}); 2 6 o1 : Matrix RR <--- RR 53 53``` ```i2 : M = slackFromGaleCircuits G -- warning: experimental computation over inexact field begun, results not reliable o2 = | 1 0 0 1 0 | | 0 1 0 1 0 | | 0 0 1 1 0 | | 1 0 0 0 1 | | 0 1 0 0 1 | | 0 0 1 0 1 | 6 5 o2 : Matrix RR <--- RR 53 53```
 ```i3 : G = matrix(RR, {{1, 1, -1, -1, 0, 0}, {1, 1, 0, 0, -1, -1}}); 2 6 o3 : Matrix RR <--- RR 53 53``` ```i4 : M = slackFromGaleCircuits G -- warning: experimental computation over inexact field begun, results not reliable o4 = | 1 0 1 0 1 0 1 0 | | 0 1 0 1 0 1 0 1 | | 1 1 0 0 1 1 0 0 | | 0 0 1 1 0 0 1 1 | | 1 1 1 1 0 0 0 0 | | 0 0 0 0 1 1 1 1 | 6 8 o4 : Matrix RR <--- RR 53 53```
 ```i5 : G = matrix(RR, {{1, 0, 1, 0, 2, -2, -2}, {0, 1, 0, 1, 2, -2, -2}}); 2 7 o5 : Matrix RR <--- RR 53 53``` ```i6 : M = slackFromGaleCircuits G -- warning: experimental computation over inexact field begun, results not reliable o6 = | 0 0 2 0 2 0 2 0 2 0 | | 0 0 2 2 0 0 2 2 0 0 | | 0 0 0 2 0 2 0 2 0 2 | | 0 0 0 0 2 2 0 0 2 2 | | 1 1 0 0 0 0 0 0 0 0 | | 1 0 1 1 1 1 0 0 0 0 | | 0 1 0 0 0 0 1 1 1 1 | 7 10 o6 : Matrix RR <--- RR 53 53```
 ```i7 : G = matrix(RR, {{1, -4, 6, -4, 1, 0, 0}, {4, -15, 20, -10, 0, 1, 0}, {10, -36, 45, -20, 0, 0, 1}}); 3 7 o7 : Matrix RR <--- RR 53 53``` ```i8 : M = slackFromGaleCircuits G -- warning: experimental computation over inexact field begun, results not reliable o8 = | 20 0 36 6 1 0 0 0 0 0 | | 10 2.5 15 1.66667 0 0 1 .166667 .0277778 0 | | 4 3 4 0 0 .4 1 .111111 0 0 | | 1 2.25 0 0 .5 .9 .5 0 0 .05 | | 0 1 0 .666667 1 1.2 0 0 .111111 .2 | | 0 0 1 1 1 1 0 .277778 .416667 .5 | | 0 0 0 0 0 0 1 1 1 1 | 7 10 o8 : Matrix RR <--- RR 53 53```
 ```i9 : G = matrix(RR, {{-sqrt(10+2*sqrt(5))*(sqrt(5)+1)/(4*(sqrt(5)-1)), sqrt(10+2*sqrt(5))*(sqrt(5)+1)/(4*(sqrt(5)-1)), -4*sqrt(5)/(sqrt(10+2*sqrt(5))*(sqrt(5)+1)+(sqrt(5)-5)*sqrt(10-2*sqrt(5))), 4*sqrt(5)/(sqrt(10+2*sqrt(5))*(sqrt(5)+1)+(sqrt(5)-5)*sqrt(10-2*sqrt(5))), -sqrt(10-2*sqrt(5))/4, sqrt(10-2*sqrt(5))/4, -sqrt(10+2*sqrt(5))/4, sqrt(10+2*sqrt(5))/4, -sqrt(10-2*sqrt(5))/4, sqrt(10+2*sqrt(5))/4, -sqrt(10+2*sqrt(5))/4, 0}, {(sqrt(5)+1)/4, (sqrt(5)+1)/4, (-5-sqrt(5))/(6*sqrt(5)-10), (-5-sqrt(5))/(6*sqrt(5)-10), (sqrt(5)+1)/4, (sqrt(5)+1)/4, -(sqrt(5)-1)/4, -(sqrt(5)-1)/4, -(sqrt(5)+1)/4, (sqrt(5)-1)/4, (sqrt(5)-1)/4, 0}, {1, 1, 1, 1, 1, 1, 1, 1, -1, -1, -1, -1}}); 3 12 o9 : Matrix RR <--- RR 53 53``` ```i10 : M = slackFromGaleCircuits G -- warning: experimental computation over inexact field begun, results not reliable o10 = | 0 0 0 .381966 0 .618034 0 0 0 0 0 | 0 0 0 .618034 .381966 0 0 .618034 0 0 0 | 0 0 0 0 0 0 .381966 .381966 0 0 .276393 | 0 0 0 0 0 .381966 0 0 .381966 .276393 0 | 0 0 0 0 .618034 0 .618034 0 0 .723607 0 | 1 0 0 0 0 0 0 0 .618034 0 .723607 | 0 1 0 0 0 0 0 0 0 0 0 | 0 0 1 0 0 0 0 0 0 0 0 | 1 0 0 1 1 0 0 0 0 0 0 | 0 1 0 0 0 1 1 0 0 0 0 | 0 0 1 0 0 0 0 1 1 0 0 | 0 0 0 0 0 0 0 0 0 1 1 ----------------------------------------------------------------------- 0 .276393 .381966 .236068 .381966 0 .618034 0 .236068 .276393 0 .236068 0 0 0 0 0 .381966 0 0 .381966 .381966 .236068 0 0 0 0 0 0 0 0 0 .381966 0 0 .381966 0 0 0 0 0 1.61803 0 1.61803 0 0 0 0 .381966 0 0 0 0 0 .723607 0 0 0 0 0 0 0 0 0 .723607 0 0 .381966 0 1 1 0 0 0 0 0 0 1 .618034 1.61803 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 ----------------------------------------------------------------------- 0 0 0 0 0 .276393 .447214 0 .276393 .236068 .381966 1 0 0 .447214 .276393 .276393 0 0 0 0 0 1 .276393 0 .276393 0 .381966 .236068 0 .618034 0 0 .276393 0 .276393 .381966 0 0 1 0 0 0 .447214 0 0 0 0 0 1.61803 0 0 0 .447214 0 .381966 1 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 .618034 1.61803 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 ----------------------------------------------------------------------- 0 0 0 0 0 | 0 0 0 0 0 | 0 .105573 0 0 0 | .105573 0 0 0 0 | 0 .447214 .276393 0 .723607 | .447214 0 0 .276393 0 | .447214 0 .276393 .447214 0 | 0 .447214 .447214 .276393 .723607 | 0 0 0 0 .447214 | 0 0 0 0 0 | 0 0 0 0 0 | 1 1 1 1 1 | 12 34 o10 : Matrix RR <--- RR 53 53```