Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend_polymake for Polyhedron #22683

Closed
mkoeppe opened this issue Mar 26, 2017 · 28 comments
Closed

backend_polymake for Polyhedron #22683

mkoeppe opened this issue Mar 26, 2017 · 28 comments

Comments

@mkoeppe
Copy link
Contributor

mkoeppe commented Mar 26, 2017

Building upon #22658 (Support interface coercion polymake(X) for Polyhedron), we provide a backend in backend_polymake.py that does all Polyhedron computations using polymake (in particular, the initial computation of the double description).

For quadratic field extensions of the rationals, this backend should be faster than the generic implementation in Python (unless the pexpect overhead dominates).

Depends on #22658

CC: @simon-king-jena @jplab @videlec @tscrim @yuan-zhou

Component: geometry

Author: Matthias Koeppe

Branch/Commit: 6d1774b

Reviewer: Travis Scrimshaw

Issue created by migration from https://trac.sagemath.org/ticket/22683

@mkoeppe mkoeppe added this to the sage-8.0 milestone Mar 26, 2017
@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 26, 2017

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 26, 2017

comment:2

As preparation, I have implemented the _sage_ method.


Last 10 new commits:

7588b62Polyhedron_base: Provide `_polymake_init_` instead of @cached_method _polymake_
07270d4Polyhedron_base._polymake_init_: Pass both representations to polymake, add tests
5fadbcdAdd `_polymake_init_` for some rings
3d3cef2Polymake: fix typo in docstring
6598823Polyhedron_base._polymake_init_: Support polyhedra over quadratic extensions
ef23af4Polyhedron_base._polymake_init_: Add test for RDF polyhedra
205879fMatrix, MatrixSpace: Add coercion to polymake interface
e49765ePolymake: Fix tests whose error messages changed because we do not use files
51af468PolymakeElement.__iter__: New
2f0e059PolymakeElement._sage_: Implement for *Vector, *Matrix, QuadraticExtension

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 26, 2017

Commit: 2f0e059

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 26, 2017

Dependencies: #22658

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 26, 2017

Author: Matthias Koeppe

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

218dacaAdd Polyhedron_polymake

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Changed commit from 2f0e059 to 218daca

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Changed commit from 218daca to 5ab94a2

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

5ab94a2Merge tag '7.6' into t/22683/backend_polymake_for_polyhedron

@tscrim
Copy link
Collaborator

tscrim commented Mar 27, 2017

comment:8

Two things I see:

  • def _polymake_ is missing doctests.
  • In __iter__, you should use ``self`` in the docstrings. You also don't need to have an INPUT: block since there essentially no input.

Otherwise LGTM modulo the dependency.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Branch pushed to git repo; I updated commit sha1. New commits:

8fd81c7Polyhedron_polymake._polymake_: Add doctest
952b860PolymakeElement.__iter__: Doc fixes

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Mar 27, 2017

Changed commit from 5ab94a2 to 952b860

@tscrim
Copy link
Collaborator

tscrim commented Mar 28, 2017

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Mar 28, 2017

comment:10

Thank you.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Mar 28, 2017

comment:11

Thanks for reviewing!

@tscrim
Copy link
Collaborator

tscrim commented Mar 28, 2017

comment:12

Not a problem; happy to help.

@kiwifb
Copy link
Member

kiwifb commented Apr 1, 2017

comment:13

I suspect this will pass tests on the bots with stand-alone sage. It gives me trouble in sage-on-gentoo while building the documentation, I am not sure how other distros deal with the doc building. I have the following failure related to this ticket

[discrete_] /dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/doc/en/reference/discrete_geometry/sage/geometry/polyhedron/library.rst:11: WARNING: autodoc: failed to import module u'sage.geometry.polyhedron.library'; the following exception was raised:
[discrete_] Traceback (most recent call last):
[discrete_] File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/ext/sage_autodoc.py", line 525, in import_object
[discrete_] __import__(self.modname)
[discrete_] File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/build/lib/sage/geometry/polyhedron/library.py", line 75, in <module>
[discrete_] from sage.combinat.root_system.associahedron import Associahedron
[discrete_] File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/build/lib/sage/combinat/root_system/associahedron.py", line 23, in <module>
[discrete_] from sage.geometry.polyhedron.parent import Polyhedra_QQ_ppl
[discrete_] File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/build/lib/sage/geometry/polyhedron/parent.py", line 825, in <module>
[discrete_] from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake
[discrete_] File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/build/lib/sage/geometry/polyhedron/backend_polymake.py", line 31, in <module>
[discrete_] from sage.rings.integer import LCM_list
[discrete_] ImportError: cannot import name LCM_list
[discrete_] /dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/doc/en/reference/discrete_geometry/sage/geometry/polyhedron/parent.rst:11: WARNING: autodoc: failed to import module u'sage.geometry.polyhedron.parent'; the following exception was raised:
[discrete_] Traceback (most recent call last):
[discrete_] File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/sage_setup/docbuild/ext/sage_autodoc.py", line 525, in import_object
[discrete_] __import__(self.modname)
[discrete_] File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/build/lib/sage/geometry/polyhedron/parent.py", line 825, in <module>
[discrete_] from sage.geometry.polyhedron.backend_polymake import Polyhedron_polymake
[discrete_] File "/dev/shm/portage/sci-mathematics/sage-9999/work/sage-9999/src-python2_7/build/lib/sage/geometry/polyhedron/backend_polymake.py", line 31, in <module>
[discrete_] from sage.rings.integer import LCM_list
[discrete_] ImportError: cannot import name LCM_list

which itself comes from #22630. Volker is currently testing the ticket so don't touch it now. If it is accepted as is, could we have a follow up to import LCM_list directly from sage.arith.functions? Although if I have problems with lazy_import, I will be fighting symptoms rather than the disease by doing that.

@tscrim
Copy link
Collaborator

tscrim commented Apr 2, 2017

comment:14

LCM_list is never called in the code AFAICS. So it should just be as simple as removing the import so this doesn't have to be based on #22630. Which ticket do you mean by "the ticket"?

@kiwifb
Copy link
Member

kiwifb commented Apr 2, 2017

comment:15

Replying to @tscrim:

LCM_list is never called in the code AFAICS. So it should just be as simple as removing the import so this doesn't have to be based on #22630. Which ticket do you mean by "the ticket"?

This, here, ticket. I am signaling because I need to keep track of these things but I don't want to stop normal progress. Any issue I have, could be dealt with in a follow up ticket. Volker's already merged this ticket in his testing branch and if all goes well we shouldn't prevent the closing of this ticket because of sage-on-gentoo [OK, I would stop it if I thought you did something terrible].

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 2, 2017

comment:16

Follow-up ticket at #22740.

@vbraun
Copy link
Member

vbraun commented Apr 2, 2017

comment:17

Documentation doesn't build

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 2, 2017

Branch pushed to git repo; I updated commit sha1. Last 10 new commits:

b47f6f9Polyhedron_base._polymake_init_: Add work around for empty polytopes with Polymake 3.0
3b49a54Polymake: Fix another test whose error message depends on whether we use files
07a1757Polyhedron_base._polymake_init_: Fix comment
09942e7coercion tutorial: Update introspection results
19d05f1Add more 'optional - polymake
cd583e2Remove one unneccessary 'optional - polymake
7bcc04cMerge tag '8.0.beta0' into t/22658/polyhedron_methods_using_the_polymake_pexpect_interface
d7d4234Add '# optional - polymake'
4719102Merge remote-tracking branch 'trac/u/mkoeppe/polyhedron_methods_using_the_polymake_pexpect_interface' into t/22683/backend_polymake_for_polyhedron
6d1774bReference manual: Add backend_polymake

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Apr 2, 2017

Changed commit from 952b860 to 6d1774b

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Apr 2, 2017

comment:19

I've merged in #22740, which was intended to be a follow-up ticket, hoping that this will fix the doc build problems.
Also merged the updated branch prereq #22658 (which I'll mark as dup), which brings in 8.0.beta0.
And added backend_polymake to the discrete geometry section of the manual.
Documentation builds for me on this branch.

@tscrim
Copy link
Collaborator

tscrim commented Apr 2, 2017

comment:20

I would have been somewhat surprised if the doc did build on Volker's testing branch given comment:13. Changes LGTM.

@kiwifb
Copy link
Member

kiwifb commented Apr 2, 2017

comment:21

Well, I would have thought you build your branch and the documentation. So, to me it was probably a problem on my side.

@tscrim
Copy link
Collaborator

tscrim commented Apr 2, 2017

comment:22

I didn't test it in conjunction with #22630 and didn't notice the conflict.

@vbraun
Copy link
Member

vbraun commented Apr 5, 2017

Changed branch from u/mkoeppe/backend_polymake_for_polyhedron to 6d1774b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants