Changes between Version 62 and Version 64 of Ticket #25097


Ignore:
Timestamp:
09/23/18 13:34:20 (3 years ago)
Author:
mkoeppe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #25097

    • Property Status changed from new to needs_review
    • Property Commit changed from 3d8d078f7592dd4063d56d6459d64cfe015f8bbc to ad26e475628de592be3d6f878c187c9e34b5dc8a
    • Property Authors changed from to Matthias Koeppe
  • Ticket #25097 – Description

    v62 v64  
    77
    88'''Things that work in sage:'''
    9  - Setting up a polyhedron over a number field, writing a QNormaliz input file as a side effect.  (#25090 added writing Normaliz output files in the rational case.)
    10 {{{
    11 sage: P = Polyhedron(vertices=polytopes.icosahedron().vertices(), backend='normaliz', verbose='out.in')
    12 # Calling PyNormaliz.NmzCone(**{'subspace': [], 'vertices': [[0, 2, sqrt5 + 1, 4], [0, -2, sqrt5 + 1, 4], [2, sqrt5 + 1, 0, 4], [2, -sqrt5 - 1, 0, 4], [sqrt5 + 1, 0, 2, 4], [sqrt5 + 1, 0, -2, 4], [-2, sqrt5 + 1, 0, 4], [-2, -sqrt5 - 1, 0, 4], [-sqrt5 - 1, 0, 2, 4], [0, 2, -sqrt5 - 1, 4], [0, -2, -sqrt5 - 1, 4], [-sqrt5 - 1, 0, -2, 4]], 'cone': []})
    13 # Wrote equivalent Normaliz input file to out.in
    14 sage: !cat out.in
    15 amb_space 3
    16 number_field min_poly (a^2 - 5) embedding [2.236067977499789 +/- 8.06e-16]
    17 subspace 0
    18 vertices 12
    19  0 2 (a + 1) 4
    20  0 -2 (a + 1) 4
    21  2 (a + 1) 0 4
    22  2 (-a - 1) 0 4
    23  (a + 1) 0 2 4
    24  (a + 1) 0 -2 4
    25  -2 (a + 1) 0 4
    26  -2 (-a - 1) 0 4
    27  (-a - 1) 0 2 4
    28  0 2 (-a - 1) 4
    29  0 -2 (-a - 1) 4
    30  (-a - 1) 0 -2 4
    31 cone 0
    32 }}}
     9 - Setting up a polyhedron over a number field.
    3310 - Likewise with input from various fields, which will be coerced to a number field first via #20181:
    3411{{{
    35         sage: x = polygen(ZZ); P = Polyhedron(vertices=[[sqrt(2)], [AA.polynomial_root(x^3-2, RIF(0,3))]], backend='normaliz', verbose=True)
    36         # ----8<---- Equivalent QNormaliz input file ---8<----
    37         amb_space 1
    38         number_field min_poly (a^6 - 2) embedding [1.122462048309373 +/- 5.38e-16]
    39         subspace 0
    40         vertices 2
    41          (a^3) 1
    42          (a^2) 1
    43         cone 0
    44         # ----8<-------------------8<-------------------8<----
    45         # Calling PyQNormaliz_cpp.NmzCone(**{'subspace': [], 'vertices': [[[0L, 0L, 0L, 1L, 0L, 0L], 1L], [[0L, 0L, 1L, 0L, 0L, 0L], 1L]], 'NumberFieldData': 'min_poly (a^6 - 2) embedding [1.122462048309373 +/- 5.38e-16]', 'cone': []})
     12        sage: x = polygen(ZZ); P = Polyhedron(vertices=[[sqrt(2)], [AA.polynomial_root(x^3-2, RIF(0,3))]], backend='normaliz')
    4613}}}
    47   (Result of discussion of mkoeppe, jipilab:) `Polyhedron_normaliz` should accept `AA`, `CyclotomicField`, etc. input and use these as a `base_ring`. When preparing data for `PyQNormaliz`, use `number_field_elements_from_algebraics`. When reading data from `PyQNormaliz`, first build number field elements, then inject into the correct `base_ring`.
     14 - See doctests in `src/sage/geometry/polyhedron/backend_normaliz.py` and `src/sage/geometry/polyhedron/library.py`
     15 - Writing a QNormaliz input file as a side effect by passing `verbose=True`.  (#25090 added writing Normaliz output files in the rational case.)
    4816
    4917'''To do on the Sage build scripts side:'''