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

Base Polyhedron on PPL (by default) #11634

Closed
vbraun opened this issue Jul 29, 2011 · 49 comments
Closed

Base Polyhedron on PPL (by default) #11634

vbraun opened this issue Jul 29, 2011 · 49 comments

Comments

@vbraun
Copy link
Member

vbraun commented Jul 29, 2011

Rewrite the Polyhedron class to allow different backends for the computation and make PPL the default for polyhedra over QQ.

Apply

Depends on #12159
Depends on #11429

CC: @novoselt @dimpase

Component: geometry

Author: Volker Braun

Reviewer: Marshall Hampton, David Loeffler, Andrey Novoseltsev

Merged: sage-5.0.beta10

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

@vbraun

This comment has been minimized.

@vbraun
Copy link
Member Author

vbraun commented Aug 1, 2011

Author: Volker Braun

@vbraun

This comment has been minimized.

@vbraun
Copy link
Member Author

vbraun commented Aug 31, 2011

Attachment: trac_11634_pickling_for_PPL.patch.gz

Initial patch

@vbraun
Copy link
Member Author

vbraun commented Aug 31, 2011

comment:3

I've added pickling support to PPL, this is now part of this ticket.

@vbraun

This comment has been minimized.

@vbraun
Copy link
Member Author

vbraun commented Dec 19, 2011

Updated patch

@vbraun
Copy link
Member Author

vbraun commented Dec 19, 2011

Dependencies: #12159

@vbraun
Copy link
Member Author

vbraun commented Dec 19, 2011

comment:4

Attachment: trac_11634_ppl_backend.patch.gz

Through the triangulation of polytopes, this depends on #12159

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 8, 2012

comment:5

Volker, I'll try to review this this week if I can. If I forget feel free to ping me about it.

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 9, 2012

comment:6

I'm having trouble applying your patches, it looks like this also depends on #11429.

@vbraun
Copy link
Member Author

vbraun commented Jan 9, 2012

comment:7

Yes, that one needs to be reviewed as well.

@vbraun
Copy link
Member Author

vbraun commented Jan 9, 2012

Changed dependencies from #12159 to #12159, #11429

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 9, 2012

comment:8

I tried applying #11429, and then #12159, both of which worked fine, but I am unable to apply the patches from this ticket after that.

@vbraun
Copy link
Member Author

vbraun commented Jan 9, 2012

comment:9

I have the following patches applied on top of sage-4.8.alpha6 without problems:

[vbraun@volker-laptop-two hg]$ hg qseries
trac_11429_native_enumeration_of_lattice_polytope_points.patch
trac_11429_cythonize_lattice_points.patch
trac_11429_fix_doctests.patch
trac_12159_separate_triangulation_file.patch
trac_12159_placing_triangulation.patch
trac_12159_normal_cone.patch
trac_11634_refactor_polyhedron.patch
trac_11634_pickling_for_PPL.patch
trac_11634_ppl_backend.patch

The patches might not apply cleanly older sage versions.

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 9, 2012

comment:10

Thanks; I was working with an unoffical sage-4.8.rc1, I will switch to 4.8.alpha6 and try again in case that is the problem.

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 9, 2012

comment:11

OK, I got it working now. Clearly PPL is much faster on some of my test examples, wow.

@novoselt
Copy link
Member

novoselt commented Jan 9, 2012

comment:12

Replying to @sagetrac-mhampton:

OK, I got it working now. Clearly PPL is much faster on some of my test examples, wow.

Oh yeah, working with toric varieties got much better once most basic operations were switched to PPL!

I am also the offending reviewer on #11429, dropping off the radar half-way. Will try to remedy it shortly, without forgetting #11599.

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 23, 2012

comment:14

For sage-5.0.beta1, the numerial noise fix from #9958 changes one line of polyhedra.py, which causes trac_11634_refactor_polyhedron.patch to fail to apply.

5866c5866
<             0.8
---
>             0.8000...

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Jan 24, 2012

comment:15

I'm a little confused by the above numerical noise issue. After changing so that the patch would apply, the doctest failed. If I switch it to

            sage: filled_poly.axes_width()
            0.8...

then it works. I'm not sure if the "0.800..." makes sense on some other system or not.

Apart from that I think this all looks good. There is one other doctest failure in integral_points.pyx resulting from the Python switch to 2.7, line 688 needs to be changed to

        OverflowError: Python int too large to convert to C long

instead of

        OverflowError: long int too large to convert to int

With those changes I would be happy to give a positive review.

I haven't looked at #11429 and #12159 by themselves, but it would be nice to get this ticket into sage-5.0. I don't have a lot of time in the coming weeks but if Andrey can't review those I would try to check them out too.

@vbraun
Copy link
Member Author

vbraun commented Jan 24, 2012

comment:16

I already fixed the OverflowError error message in #11429. What output do you get for

filled_poly.axes_width()

the doctest works for me with 0.8.

@vbraun
Copy link
Member Author

vbraun commented Jan 24, 2012

Updated patch

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Mar 11, 2012

comment:28

Thanks David, that made things simpler for me to look at. Volker, my apologies for taking so long on reviewing this. I think this should be a great addition to sage-5.0.

@jdemeyer

This comment has been minimized.

@novoselt
Copy link
Member

comment:30

I am not entirely sure if something is wrong on my end, but when I apply the following patches to Sage-5.0.beta8

novoselt@sage ~/sage/devel/sage-main $ hg qapplied
trac_11599_no_circular_imports.patch
trac_11599_homset_new_coercion_model.patch
trac_11599_rename_morphisms.patch
trac_11599_toric_morphisms.patch
trac_11599_reviewer.patch
trac_11599_remove_class_suffix.patch
trac_11599_remaining_fixes.patch
trac_11599_numerical_noise.patch
trac_12159_separate_triangulation_file.patch
trac_12159_placing_triangulation.patch
trac_12159_normal_cone.patch
trac_11634-folded.patch

I get after trying to start Sage

----------------------------------------------------------------------
| Sage Version 5.0.beta8, Release Date: 2012-03-13                   |
| Type notebook() for the GUI, and license() for information.        |
----------------------------------------------------------------------
**********************************************************************
*                                                                    *
* Warning: this is a prerelease version, and it may be unstable.     *
*                                                                    *
**********************************************************************
/home/novoselt/sage-5.0.beta8/local/lib/python2.7/site-packages/sage/combinat/root_system/associahedron.py:22: DeprecationWarning: (Since Sage Version 4.8) The module sage.geometry.polyhedra has been removed, use sage.geometry.polyhedron instead.
  from sage.geometry.polyhedra import Polyhedron
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

/home/novoselt/sage-5.0.beta8/local/lib/python2.7/site-packages/IPython/ipmaker.pyc in force_import(modname, force_reload)
     61         reload(sys.modules[modname])
     62     else:
---> 63         __import__(modname)
     64         
     65 

/home/novoselt/sage-5.0.beta8/local/bin/ipy_profile_sage.py in <module>()
      5     preparser(True)
      6     
----> 7     import sage.all_cmdline
      8     sage.all_cmdline._init_cmdline(globals())
      9     

/home/novoselt/sage-5.0.beta8/local/lib/python2.7/site-packages/sage/all_cmdline.py in <module>()
     12 try:
     13 
---> 14     from sage.all import *
     15     from sage.calculus.predefined import x
     16     preparser(on=True)

/home/novoselt/sage-5.0.beta8/local/lib/python2.7/site-packages/sage/all.py in <module>()
     80 from sage.modules.all    import *
     81 from sage.monoids.all    import *
---> 82 from sage.algebras.all   import *
     83 from sage.modular.all    import *
     84 from sage.schemes.all    import *

/home/novoselt/sage-5.0.beta8/local/lib/python2.7/site-packages/sage/algebras/all.py in <module>()
     34 from group_algebra_new import GroupAlgebra
     35 
---> 36 from iwahori_hecke_algebra import IwahoriHeckeAlgebraT
     37 from affine_nil_temperley_lieb import AffineNilTemperleyLiebTypeA
     38 from nil_coxeter_algebra import NilCoxeterAlgebra

/home/novoselt/sage-5.0.beta8/local/lib/python2.7/site-packages/sage/algebras/iwahori_hecke_algebra.py in <module>()
     10 #*****************************************************************************
     11 from sage.categories.all import AlgebrasWithBasis, FiniteDimensionalAlgebrasWithBasis, CoxeterGroups
---> 12 import sage.combinat.root_system.cartan_type
     13 from sage.combinat.root_system.weyl_group import WeylGroup
     14 from sage.combinat.family import Family

/home/novoselt/sage-5.0.beta8/local/lib/python2.7/site-packages/sage/combinat/root_system/__init__.py in <module>()
     11 import type_G
     12 
---> 13 import all
     14 
     15 

/home/novoselt/sage-5.0.beta8/local/lib/python2.7/site-packages/sage/combinat/root_system/all.py in <module>()
----> 1 
      2 
      3 from associahedron import Associahedron
      4 from cartan_type import CartanType
      5 from dynkin_diagram import DynkinDiagram, dynkin_diagram
      6 from cartan_matrix import cartan_matrix
      7 from coxeter_matrix import coxeter_matrix

/home/novoselt/sage-5.0.beta8/local/lib/python2.7/site-packages/sage/combinat/root_system/associahedron.py in <module>()
     24 from sage.modules.free_module_element import vector
     25 
---> 26 class Associahedron(Polyhedron):
     27     r"""
     28     The generalized associahedron is a polytopal complex with vertices in one-to-one correspondence

TypeError: Error when calling the metaclass bases
    function() argument 1 must be code, not str
Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.

Is it because some new stuff merged in alpha8 uses old polyhedra code and was not converted?

@vbraun
Copy link
Member Author

vbraun commented Mar 13, 2012

comment:31

That must be new stuff that was merged in beta8

@vbraun
Copy link
Member Author

vbraun commented Mar 13, 2012

comment:32

Needs to be rebased

@sagetrac-mhampton
Copy link
Mannequin

sagetrac-mhampton mannequin commented Mar 13, 2012

comment:33

I think this must be from
#10817

@vbraun
Copy link
Member Author

vbraun commented Mar 18, 2012

Initial patch

@vbraun
Copy link
Member Author

vbraun commented Mar 18, 2012

comment:34

Attachment: trac_11634_fix_sage_5_beta8.patch.gz

I've added a patch that converts the new !Associahedron class to a PPL-based polyhedron

@vbraun

This comment has been minimized.

@novoselt
Copy link
Member

comment:35

Positive review to the new patch!

@novoselt
Copy link
Member

Changed reviewer from Marshall Hampton, David Loeffler to Marshall Hampton, David Loeffler, Andrey Novoseltsev

@jdemeyer
Copy link

Merged: sage-5.0.beta10

@kcrisman
Copy link
Member

kcrisman commented Jul 6, 2014

comment:37

Question (likely dumb): could the behavior at this ask.sagemath question be related to this change (or #14175)? Thanks!

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