Opened 2 years ago

Closed 3 months ago

#26029 closed defect (fixed)

polytopes_db_4d converted to new style package

Reported by: embray Owned by:
Priority: major Milestone: sage-9.2
Component: packages: huge Keywords:
Cc: mkoeppe, vbraun Merged in:
Authors: Dima Pasechnik Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: b49f89a (Commits) Commit: b49f89a5c8429619d576a5c998b890dcf09f7b86
Dependencies: Stopgaps:

Description (last modified by dimpase)

This spkg is mentioned in #14467 and was apparently "huge" (and hence optional). But it is no longer listed under build/pkgs nor does it appear to be available on the download mirrors.

Here is a branch to convert it to a new style experimental (but, maybe optional?) package.

the tarball is the old *.spkg file, but as it's a tar file, it works

tarball url (see in checksum.ini), but it's the same as one gets via ./sage -p polytopes_db_4d (which still works with old style pkfs)

A few options:

1) If someone has a copy of this package we can convert it to a new-style SPKG (we will probably need to upload the tarball somewhere with enough space to host it).


Change History (20)

comment:1 Changed 2 years ago by slelievre

Last edited 2 years ago by slelievre (previous) (diff)

comment:2 Changed 2 years ago by slelievre

The package is listed at:

comment:3 Changed 2 years ago by slelievre

And it's available from each of the SageMath download mirrors. E.g.


The problems encountered with this huge package might instead have to do with

comment:4 Changed 2 years ago by embray

As I wrote on sage-devel, we could keep supporting this package if it were repackaged as a .tar.<whatever compression method works best>, and we added an appropriate build/pkgs/polytopes_db_4d for it. We would then want to move it to a standard location on the mirrors, not under "spkg/huge". That, or leave it under "spkg/huge" (if there is some advantage to that--can mirrors opt not to carry "huge" packages?) but modify sage-download-file to be able to find tarballs under that path on the mirrors.

Last edited 2 years ago by embray (previous) (diff)

comment:5 Changed 2 years ago by embray

  • Milestone changed from sage-8.4 to sage-8.5

comment:6 Changed 23 months ago by slelievre

The following shows sage can find packages in "huge":

$ sage --info polytopes_db_4d
Attempting to get on-line info for package polytopes_db_4d
>>> Checking online list of optional packages.
>>> Checking online list of experimental packages.
>>> Checking online list of huge packages.
>>> Found polytopes_db_4d-1.0

The package cannot be installed with sage -i because it is an "old-style SPKG"

$ sage -i polytopes_db_4d
Error: package 'polytopes_db_4d' not found
Note: if it is an old-style package, use -p instead of -i to install it

but sage -p can install "old-style spkg" packages that still work, including this one.

$ sage -p polytopes_db_4d
Attempting to download package polytopes_db_4d
>>> Checking online list of optional packages.
>>> Checking online list of experimental packages.
>>> Checking online list of huge packages.
>>> Found polytopes_db_4d-1.0
================================== NOTE ==================================
You are about to download and install an old-style package. While this
might still work fine, old-style packages are unmaintained and deprecated.

This package will be removed in future versions of SageMath. If you care
about this package, you should make a proper new-style package instead.
For more information about making Sage packages, see
Are you sure (automatically continuing in 30 seconds) [Y/n]?

Once this is done and after restarting Sage, one can follow the SageMath documentation on using the palp_database of reflexive Hodge 4-polytopes. I tried it in Sage 8.4 as installed on the "k8s" CoCalc server for development, which currently runs Ubuntu 17.04.

sage: version()
'SageMath version 8.4, Release Date: 2018-10-17'
sage: from sage.geometry.polyhedron.palp_database import Reflexive4dHodge
sage: ref = Reflexive4dHodge(1, 101)
sage: next(iter(ref)).Vrepresentation()
(A vertex at (-1, -1, -1, -1),
 A vertex at (0, 0, 0, 1),
 A vertex at (0, 0, 1, 0),
 A vertex at (0, 1, 0, 0),
 A vertex at (1, 0, 0, 0))

comment:7 Changed 21 months ago by embray

  • Milestone changed from sage-8.5 to sage-8.7

Retargeting some of my tickets (somewhat optimistically for now).

comment:8 Changed 18 months ago by embray

  • Milestone changed from sage-8.7 to sage-pending

Removing most of the rest of my open tickets out of the 8.7 milestone, which should be closed.

comment:9 Changed 18 months ago by embray

According to Andrey Novoseltev:

Data originates from

The whole list can be generated using PALP (a standard package in Sage), but when they have done it first, it took about a year on multiple computers, so there is sense in just downloading these polytopes. Sage package contains precomputed data for Hodge numbers as well, allowing quick search for particular cases. Volker knows more about exact details, I was just happily using the result.

While we are at it: it would be awesome if installation of this package after upgrade was faster. "Installation" just means unpacking files and copying them somewhere, but it takes something like 45 minutes. Some time ago I asked to use parallel decompressor if it is available in the system, which helped a lot, but then it stopped again.

As I wrote on sage-devel, perhaps it would make sense to host this data (as well as the 3D polytopes; why not?) on an online database somewhere that can be easily queried (including by the code in Sage which uses this data)? This way it is possible to use as-needed without downloading the entire, very large database (though perhaps with the possibility of pre-downloading/caching all or parts of it as needed).

It would be very easy to write a simple web service, and perhaps the data and service could be hosted on This might also be a good opportunity for some MitM synergy. There is a workshop later this year on mathematical data, and frameworks and services for accessing them, so that might be a good opportunity to work on such a project (I would be happy to help, especially if someone can help me with the math end of things as I have no idea what a reflexive Hodge polytope is much less how it would be represented in a MitM framework):

comment:10 Changed 17 months ago by dimpase

A reflexive polytope is a full-dimensional lattice polytope (i.e. the vertices have integer coordinates), containing the origin in the interior, so that its dual is also a lattice polytope. All this is readily available in Sage.

comment:11 Changed 17 months ago by novoselt

3D polytopes take so little space, that there is no sense at all removing them from Sage in their current form. As for 4D, there are probably very few people who are using them and so there is a lack of effort to do something about them. On the other hand, since there are papers referring to the use of this package in Sage, it would be nice to support repeating those computations in some way, even if installation is "non-standard".

comment:12 Changed 4 months ago by dimpase

  • Authors set to Dima Pasechnik
  • Branch set to u/dimpase/packages/refpoly4d
  • Cc mkoeppe vbraun added
  • Commit set to 2ed5a53f8f3805f54962a0ce908ba23f2cc375b6
  • Description modified (diff)
  • Milestone changed from sage-pending to sage-9.2
  • Status changed from new to needs_review
  • Summary changed from Missing spkg: polytopes_db_4d to polytopes_db_4d converted to new style package

New commits:

2ed5a53converting polytopes_db_4d into a new style package

comment:13 Changed 4 months ago by tscrim

Do we want this to be experimental or optional? I feel like optional would be the better option for this.

comment:14 Changed 4 months ago by mkoeppe

I also think it should be "optional"

comment:15 Changed 4 months ago by git

  • Commit changed from 2ed5a53f8f3805f54962a0ce908ba23f2cc375b6 to b49f89a5c8429619d576a5c998b890dcf09f7b86

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

b49f89amake it optional

comment:16 Changed 4 months ago by dimpase

OK, done

comment:17 Changed 4 months ago by tscrim

  • Reviewers set to Travis Scrimshaw

Thanks. I am ready to set a positive review. Any objections?

comment:18 Changed 4 months ago by mkoeppe

No objection; I haven't tried it though because downloading was taking too long.

comment:19 Changed 3 months ago by tscrim

  • Status changed from needs_review to positive_review

It built for me without any problems, so I am setting it to positive.

comment:20 Changed 3 months ago by vbraun

  • Branch changed from u/dimpase/packages/refpoly4d to b49f89a5c8429619d576a5c998b890dcf09f7b86
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.