2025-02-17 17:41:19 +0100 | marked best answer | 0/1-equivalence for polytopes Dear all,
for polytopes there is a method
I would like to test two 0/1-polytopes, i.e. polytopes which are the convex hull of a subset of the vertices of a (canonically embedded) hypercube $Q_n \subset [0,1]^n$, for 0/1-equivalence. This means that there is an automorphism of $Q_n$ that maps $P$ to $Q$. Explicitly, the automorphism should be a combination of permuting the variables and flipping $x_i \to 1 - x_i$. A reference is Ziegler, Lectures on 0/1-polytopes. He also mentions:
It would be great to have access to a database of 0/1-polytopes, and be able to compare all facets of dimension at most 4 of some polytope P to candidates in the database, and classify them, something similar to but for 0/1-polytopes. Of secondary importance (to me) would be checking two polytopes for for affine equivalence and congruence. Is this implemented i Sagemath? Edit: the answer by Max Alekseyev points me in the right direction. I will investigate the polydb and polymake docs. Thanks for the help! |
2025-02-17 17:40:55 +0100 | marked best answer | How to inherit from polytopes Dear all, I want to write a very simple class that inherits from existing polytopes functionality, creates one particular type of polytopes, and adds some functionality which is only relevant for this type of polytopes. However, I am a python beginner, and am having a hard time navigating the sagemath src directory to find exactly from which class (Polyhedron or Polyhedra) that I should inherit, and how to do this. Here is a toy example: suppose I want to investigate "depleted cubes", ie polytopes combinatorially equivalent with hypercubes with one corner neatly sliced off. I also want to easily retrieve the cut-off facet. This works: I can now go but I would like to be able to do so as not to dilute the precious namespace! I.e., the function should be a "method" to some "class" that inherits from, either Polyhedron or Polyhedra or polyhedron_base_with_backend_cpp or ... Can someone provide an example, skeleton implementation of a polytope class that inherits from somewhere? As I mentioned, I tried looking at the src directory, but the relevant files are extremely long and littered with docstrings and doctests and cruft; I can make neither head nor tails of them. Edit: As per the answer by dan_fulea, it is not worthwhile to try to turn the functions into a method. I will undogmatically refrain from doing so, then. Thank you for the tour through the internals of sagemath; I was not aware of the f.?? method of getting the code of a function/object. |
2025-02-17 16:44:00 +0100 | received badge | ● Famous Question (source) |
2025-02-17 16:39:00 +0100 | edited question | How to inherit from polytopes How to inherit from polytopes Dear all, I want to write a very simple class that inherits from existing polytopes functi |
2025-02-13 14:09:46 +0100 | edited question | 0/1-equivalence for polytopes 0/1-equivalence for polytopes Dear all, for polytopes there is a method P.is_combinatorially_isomorphic(Q) which tests |
2025-02-13 14:00:04 +0100 | received badge | ● Famous Question (source) |
2025-02-13 14:00:04 +0100 | received badge | ● Notable Question (source) |
2025-02-13 14:00:04 +0100 | received badge | ● Popular Question (source) |
2025-02-13 11:23:53 +0100 | commented answer | 0/1-equivalence for polytopes This looks promising, thanks! Many useful refeernces indeed. Poking around, I found clear instructions for accessing po |
2025-02-12 16:04:35 +0100 | asked a question | 0/1-equivalence for polytopes 0/1-equivalence for polytopes Dear all, for polytopes there is a method P.is_combinatorially_isomorphic(Q) which tests |
2025-02-05 21:50:46 +0100 | answered a question | Lattice of maximum-length antichains in sage Here is my attempt: def smallerB(a,B,P): if len([b for b in B if P.is_lequal(a,b)]) > 0: return true else: r |
2025-02-04 19:48:19 +0100 | received badge | ● Enthusiast |
2025-02-03 21:38:12 +0100 | asked a question | How to inherit from polytopes How to inherit from polytopes Dear all, I want to write a very simple class that inherits from existing polytopes functi |
2024-11-20 08:26:24 +0100 | received badge | ● Notable Question (source) |
2023-10-20 13:29:38 +0100 | edited question | Multivariate Pade approximation, recognizing rational function Multivariate Pade approximation, recognizing rational function (Question edited) Suppose that I have a taylor polynomia |
2023-10-19 13:30:14 +0100 | commented question | Multivariate Pade approximation, recognizing rational function Let me show my work so far. S.<y> = QQ[] R.<x> = S[] T.<y,x> = PowerSeriesRing(QQ,default_prec=8) U.& |
2023-10-18 17:09:03 +0100 | edited question | Multivariate Pade approximation, recognizing rational function Multivariate Pade approximation, recognizing rational function Suppose that I have a taylor polynomial approximation of |
2023-10-18 17:06:56 +0100 | edited question | Multivariate Pade approximation, recognizing rational function Multivariate Pade approximation, recognizing rational function Suppose that I have a taylor polynomial approximation of |
2023-10-18 17:05:41 +0100 | edited question | Multivariate Pade approximation, recognizing rational function Multivariate Pade approximation, recognizing rational function Suppose that I have a taylor polynomial approximation of |
2023-10-18 17:05:22 +0100 | edited question | Multivariate Pade approximation, recognizing rational function Multivariate Pade approximation, recognizing rational function Suppose that I have a taylor polynomial approximation of |
2023-10-18 17:04:20 +0100 | asked a question | Multivariate Pade approximation, recognizing rational function Multivariate Pade approximation, recognizing rational function Suppose that I have a taylor polynomial approximation of |
2023-10-02 19:56:14 +0100 | received badge | ● Popular Question (source) |
2023-09-01 00:16:43 +0100 | received badge | ● Nice Answer (source) |
2023-08-31 12:50:40 +0100 | answered a question | Diagonalisability check Malfunctioning Your matrix is not symmetric: A = matrix(QQbar, [[2,-1,0],[-1,2,1],[0,-1,2]]) A.is_symmetric() |
2023-06-13 15:57:01 +0100 | received badge | ● Notable Question (source) |
2023-06-13 15:57:01 +0100 | received badge | ● Popular Question (source) |
2022-07-16 18:31:41 +0100 | received badge | ● Nice Answer (source) |
2022-07-16 18:14:58 +0100 | received badge | ● Self-Learner (source) |
2022-07-16 16:39:16 +0100 | answered a question | latex for Hasse diagram of poset not properly laid out Adding dot2tex to the Sage installation, as suggested by FrédéricC and John Palmieri, did work for me and produces Hass |
2022-07-10 21:37:58 +0100 | edited question | latex for Hasse diagram of poset not properly laid out latex for Hasse diagram of poset not properly laid out The plot method on a poset displays the Hasse diagram in a satisf |
2022-07-10 15:03:53 +0100 | asked a question | latex for Hasse diagram of poset not properly laid out latex for Hasse diagram of poset not properly laid out The plot method on a poset displays the Hasse diagram in a satisf |
2022-06-23 16:03:18 +0100 | edited answer | taylor series of expression involving modulus of a complex expression You could expand around t=0 instead, for t = w + 0.1 var('t') bmac = b.substitute(w=t-0.1).taylor(t,0,3) cmac = c.subst |
2022-06-23 16:03:01 +0100 | answered a question | taylor series of expression involving modulus of a complex expression You could expand around t=0 instead, for t = w + 0. var('t') bmac = b.substitute(w=t-0.1).taylor(t,0,3) cmac = c.substi |
2022-06-22 20:25:29 +0100 | asked a question | Displaying and typesetting partitions Displaying and typesetting partitions A partition can be viewed as a list or pretty-printed using ascii art. This works |
2022-06-21 19:47:32 +0100 | received badge | ● Supporter (source) |
2022-06-21 19:44:15 +0100 | marked best answer | Simplifying factorials, limits, Maxima crash I am trying to simplify some binomial expressions using Sage. Now I want the limit of this expression as n -> +Infininty. Maple can do it, it correctly returns I can get Sage to calculate the limit for specific values of a: However, when I try I get an error from the underlying Maxima engine: Is SAGE able to compute this limit? Should i provide other provisos? Is there another approach I should try? Edit: The following works: so I guess all is well. I do not know if the fact that Maxima throws an exception when the taylor keyword is ommitted is a bug or not. The documentation for limit says
Maybe this should be amended to indicate that in some cases, taylor=False causes crashes. |
2022-06-21 19:44:15 +0100 | received badge | ● Scholar (source) |
2022-06-21 15:53:39 +0100 | edited answer | Simplifying factorials, limits, Maxima crash The function limit() has a keyword taylor, which might help or hinder. In this case, Uan.limit(n=Infinity,dir='+',taylo |
2022-06-21 15:52:32 +0100 | answered a question | Simplifying factorials, limits, Maxima crash The function limit() has a keyword taylor, which might help or hinder. In this case, Uan.limit(n=Infinity,dir='+' |
2022-06-21 15:47:55 +0100 | commented question | Simplifying factorials, limits, Maxima crash ++++++++++ |
2022-06-21 15:37:15 +0100 | commented question | Simplifying factorials, limits, Maxima crash Uan.limit(n=Infinity,dir='+',taylor=True) works in this case, in other cases it is better to use taylor=False. |
2022-06-21 15:37:02 +0100 | commented question | Simplifying factorials, limits, Maxima crash Uan.limit(n=Infinity,dir='+',taylor=True) works in this case, in other cases it is better to use taylor=False. |
2022-06-21 15:30:59 +0100 | edited question | Simplifying factorials, limits, Maxima crash Simplifying factorials, limits, Maxima crash I am trying to simplify some binomial expressions using Sage. var('a,n,c,m |
2022-06-21 09:11:05 +0100 | edited question | Simplifying factorials, limits, Maxima crash Simplifying factorials, limits, Maxima crash I am trying to simplify some binomial expressions using Sage. var('a,n,c,m |
2022-06-21 09:11:02 +0100 | edited question | Simplifying factorials, limits, Maxima crash Simplifying factorials, limits, Maxima crash I am trying to simplify some binomial expressions using Sage. var('a,n,c,m |
2022-06-21 08:01:24 +0100 | edited question | Simplifying factorials, limits, Maxima crash Simplifying factorials, limits, Maxima crash I am trying to simplify some binomial expressions using Sage. var('a,n,c,m |
2022-06-21 08:01:05 +0100 | edited question | Simplifying factorials, limits, Maxima crash Simplifying factorials, limits, Maxima crash I am trying to simplify some binomial expressions using Sage. var('a,n,c,m |
2022-06-21 07:33:00 +0100 | asked a question | Simplifying factorials, limits, Maxima crash Simplifying factorials, limits, Maxima crash I am trying to simplify some binomial expressions using Sage. var('a,n,c,m |
2022-06-15 07:08:13 +0100 | received badge | ● Nice Answer (source) |