Download presentation
Presentation is loading. Please wait.
Published byKatrina Little Modified over 9 years ago
1
Periods of Coefficients of Ehrhart Quasipolynomials of 2- Dimensional Polytopes By Christopher O’Neill and Anastasia Chavez
2
Topics Review of Preliminary Topics / Problem Proof of Formula used in Program Overview of Pari Overview of the Code Final Remaining Steps
3
Review of Topic Definition(s) of a Polytope and equivalence Lattice point counting Dilates of Polytopes Ehrhart Quasipolynomial Ehrhart Series (new)
4
Computing the Ehrhart Quasipolynomial g(z)/h(z) = sum(t >= 0 of f(t)*z^t) [g(z), h(z) polynomials, deg(g) f(t) is a quasipolynomial
5
Overview of Pari Command-line algebraic simplification Pari vs. Maple Time Proper simplification Piping through stdin
6
Overview of Pari Notes on use: Reading GPRC: /etc/gprc...Done. GP/PARI CALCULATOR Version 2.1.6 (released)... parisize = 4000000, primelimit = 500000 ? (t+1)*(t+2) %1 = t^2 + 3*t + 2 ? \q Good bye! Don’t want all this garbage, use -q option
7
Overview of Pari With -q option: ? (t+1)*(t+2) t^2 + 3*t + 2 ? \q Much better, but still colored: use -test Final output: ? (t+1)*(t+2) t^2 + 3*t + 2 ? \q
8
Overview of Pari temp.lat.rat from Latte: (((((((1) + (-1)*t^1) * (((1) + (-1)*t^1) * (-183)))^1) * (412)) + ((-1) * ((((1) + (-1)*t^1) * ((((1) + (- 1)*t^1) * (-16653)) + ((191) * (-183)))) + ((229) * (((1) + (-1)*t^1) * (-183)))) * (1))) / ((((1) + (- 1)*t^1) * (((1) + (-1)*t^1) * (-183)))^2)) + ((-1) * (((((((1) + (-1)*t^1) * ((-183) * ((1) + (-1)*t^1)))^1) * (229)) + ((-1) * ((((1) + (-1)*t^1) * (((-183) * (8)) + ((-16653) * ((1) + (-1)*t^1)))) + ((46) * ((-183) * ((1) + (-1)*t^1)))) * (1))) / ((((1) + (-1)*t^1) * ((-183) * ((1) + (-1)*t^1)))^2))) Output from ‘gp -q -test < temp.lat.rat’: (-t - 1)/(t^3 - 3*t^2 + 3*t - 1) Much easier to deal with!
9
Overview of Code Coded in C, using gcc Split into parts: Generate random 2D Polytope Create its Vertex file for CDD
10
Overview of Code Split into parts (continued): Run CDD, convert file to Latte format Run Ehrhart, simplify output with Pari Extract quasipolynomial from series Extract periods of Coefficients
11
Overview of Code Generating 2D polytope: User supplies # vertices, min/max values Generate random vertices (x 1 /x 2, y 1 /y 2 ), where min <= x 1, x 2, y 1, y 2 <= max Store in structure and return Find denominator as maximal period
12
Overview of Code Can also specify a specific 2D polytope Our example: (0,0), (1,2/3), (3,0) (0,0)(3,0) (1,2/3)
13
Overview of Code Create vertex file for CDD by outputting the vertices into a file in the correct format Sample file: V-representation begin 3 3 rational 1 0/1 0/1 1 1/1 2/3 1 3/1 0/1 end Run CDD to get hyperplane file
14
Overview of Code Output file from CDD: * cdd+: Double Description Method in C++:Version 0.77dev1 (Jan. 25, 2000) * Copyright (C) 1999, Komei Fukuda, fukuda@ifor.math.ethz.ch * Compiled for Rational Exact Arithmetic with GMP... *Total processor time = 0 seconds * = 0h 0m 0s *Since hull computation is chosen, the output is a minimal inequality system *FINAL RESULT: *Number of Facets = 3 H-representation begin 3 3 rational 3 -1 -3 0 0 1 0 1 -3/2 endfukuda@ifor.math.ethz.ch
15
Overview of Code Convert CDD file for use with Latte Remove garbage Convert to integers Converted file: 3 3 3 -1 -3 0 0 1 0 2 -3 Run ehrhart command, get unsimplified file
16
Overview of Code Unsimplified file: x := (t^1 / ((((1) + (-1)*t^1) * (((1) + (-1)*t^1) * ((1) + (-1)*t^1)))^1)) + ((-1) * (t^2 / ((((1) + (- 1)*t^1) * (((1) + (-1)*t^3) * ((1) + (-1)*t^1)))^1))) + ((-1) * (((((((1) + (-1)*t^1) * (((1) + (-1)*t^1) * (- 152)))^1) * (152)) + ((-1) * ((((1) + (-1)*t^1) * ((((1) + (-1)*t^1) * (-11476)) + ((-238)*t^1 * (- 152)))) + ((-1185)*t^1 * (((1) + (-1)*t^1) * (-152)))) * (1))) / ((((1) + (-1)*t^1) * (((1) + (-1)*t^1) * (- 152)))^2))) + (t^2 / ((((1) + (-1)*t^1) * (((1) + (-1)*t^3) * ((1) + (-1)*t^1)))^1)) + ((((((-152) * (((1) + (-1)*t^1) * ((1) + (-1)*t^1)))^1) * (0)) + ((-1) * (((-152) * ((((1) + (-1)*t^1) * (-881)*t^1) + ((- 390)*t^1 * ((1) + (-1)*t^1)))) + ((-11476) * (((1) + (-1)*t^1) * ((1) + (-1)*t^1)))) * (1))) / (((-152) * (((1) + (-1)*t^1) * ((1) + (-1)*t^1)))^2)): Modify file for Pari: (t^1 / ((((1) + (-1)*t^1) * (((1) + (-1)*t^1) * ((1) + (-1)*t^1)))^1)) + ((-1) * (t^2 / ((((1) + (-1)*t^1) * (((1) + (-1)*t^3) * ((1) + (-1)*t^1)))^1))) + ((-1) * (((((((1) + (-1)*t^1) * (((1) + (-1)*t^1) * (-152)))^1) * (152)) + ((-1) * ((((1) + (-1)*t^1) * ((((1) + (-1)*t^1) * (-11476)) + ((-238)*t^1 * (-152)))) + ((- 1185)*t^1 * (((1) + (-1)*t^1) * (-152)))) * (1))) / ((((1) + (-1)*t^1) * (((1) + (-1)*t^1) * (-152)))^2))) + (t^2 / ((((1) + (-1)*t^1) * (((1) + (-1)*t^3) * ((1) + (-1)*t^1)))^1)) + ((((((-152) * (((1) + (-1)*t^1) * ((1) + (-1)*t^1)))^1) * (0)) + ((-1) * (((-152) * ((((1) + (-1)*t^1) * (-881)*t^1) + ((-390)*t^1 * ((1) + (- 1)*t^1)))) + ((-11476) * (((1) + (-1)*t^1) * ((1) + (-1)*t^1)))) * (1))) / (((-152) * (((1) + (-1)*t^1) * ((1) + (-1)*t^1)))^2))
17
Overview of Code Simplified file from Pari: (t + 1)/(-t^3 + 3*t^2 - 3*t + 1) Expanded g(z) polynomial: t^7 + 4*t^6 + 9*t^5 + 13*t^4 + 13*t^3 + 9*t^2 + 4*t + 1 Quasipolynomial constituents 1/1*t^2 2/1*t^1 1/1*t^0 1/1*t^2 2/1*t^1 1/1*t^0 1/1*t^2 2/1*t^1 1/1*t^0 Lack of pretty print only temporary!
18
Overview of Code Find periods of each coefficient Starting at 1, loop through divisors of denominator Stop when we find a valid period C code given on next slide void getPeriods(Polynomial *subPolys, int *p0, int *p1, int period)
19
Overview of Code per0 = 1; while(per0 < period) { matchFound = 1; for(j = 0;j < per0;j++) { initial = subPolys[j].coefficients[2]; frac = subPolys[j].fractions[2]; for(k = 0;k < period / per0;k++) { if (subPolys[(k * per0) + j].coefficients[2] != initial || subPolys[(k * per0) + j].fractions[2] != frac) { matchFound = 0; } } } if (matchFound) { break; } per0++; while(period % per0 != 0 && per0 < period) per0++; }
20
Overview of Code For our example, both periods are 1, since all 3 constituents of the quasipolynomial are the same polynomial Worst-case running time: O(d^2), where d is the denominator of the polytope Final line of output from program: NumVerts: 3, Verts: (0/1, 0/1), (1/1, 2/3), (3/1, 0/1), Periods: p0 = 1, p1 = 1, denom = 3...
21
Possible Improvements Pretty print Simplifying fractions Eliminate unnecessary vertices (CDD) Saving data to a database rather than printing a lot of garbage to cmd line Add cmd line options (verbosity, quiet, etc.)
22
Expected Results Next steps: Run program a massive # of times to produce a ton of random polytopes Check data for period collapse, look for period combinations that don’t appear
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.