| Download
Project: 2020_SageDaysOrsay
Views: 201Visibility: Unlisted (only visible to those who know the link)
Kernel: SageMath 9.0
Permutohedron and Associahedron: some posets and polytopes from combinatorics
In [0]:
Permutations and the weak order
In [3]:
[[1, 2, 3], [1, 3, 2], [2, 1, 3], [2, 3, 1], [3, 1, 2], [3, 2, 1]]
In [4]:
[1, 2, 3]
In [5]:
True
In [6]:
In [7]:
[[1, 2, 3, 4],
[1, 2, 4, 3],
[1, 3, 2, 4],
[1, 3, 4, 2],
[1, 4, 2, 3],
[1, 4, 3, 2],
[2, 1, 3, 4],
[2, 1, 4, 3],
[2, 3, 1, 4],
[2, 3, 4, 1],
[2, 4, 1, 3],
[2, 4, 3, 1],
[3, 1, 2, 4],
[3, 1, 4, 2],
[3, 2, 1, 4],
[3, 2, 4, 1],
[3, 4, 1, 2],
[3, 4, 2, 1],
[4, 1, 2, 3],
[4, 1, 3, 2],
[4, 2, 1, 3],
[4, 2, 3, 1],
[4, 3, 1, 2],
[4, 3, 2, 1]]
In [8]:
In [9]:
A 2-dimensional polyhedron in ZZ^3 defined as the convex hull of 6 vertices (use the .plot() method to plot)
In [10]:
In [11]:
A 3-dimensional polyhedron in ZZ^4 defined as the convex hull of 24 vertices (use the .plot() method to plot)
In [12]:
Binary Trees
In [13]:
In [14]:
[[[[[., .], [., .]], .], .], [[., .], .]]
In [15]:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-15-5ae8d19b00ab> in <module>()
----> 1 bt.plot()
/ext/sage/sage-9.0/local/lib/python3.7/site-packages/sage/structure/element.pyx in sage.structure.element.Element.__getattr__ (build/cythonized/sage/structure/element.c:4608)()
485 AttributeError: 'LeftZeroSemigroup_with_category.element_class' object has no attribute 'blah_blah'
486 """
--> 487 return self.getattr_from_category(name)
488
489 cdef getattr_from_category(self, name):
/ext/sage/sage-9.0/local/lib/python3.7/site-packages/sage/structure/element.pyx in sage.structure.element.Element.getattr_from_category (build/cythonized/sage/structure/element.c:4717)()
498 else:
499 cls = P._abstract_element_class
--> 500 return getattr_from_other_class(self, cls, name)
501
502 def __dir__(self):
/ext/sage/sage-9.0/local/lib/python3.7/site-packages/sage/cpython/getattr.pyx in sage.cpython.getattr.getattr_from_other_class (build/cythonized/sage/cpython/getattr.c:2547)()
387 dummy_error_message.cls = type(self)
388 dummy_error_message.name = name
--> 389 raise AttributeError(dummy_error_message)
390 cdef PyObject* attr = instance_getattr(cls, name)
391 if attr is NULL:
AttributeError: 'BinaryTrees_all_with_category.element_class' object has no attribute 'plot'
In [16]:
{ \newcommand{\nodea}{\node[draw,circle] (a) {$$}
;}\newcommand{\nodeb}{\node[draw,circle] (b) {$$}
;}\newcommand{\nodec}{\node[draw,circle] (c) {$$}
;}\newcommand{\noded}{\node[draw,circle] (d) {$$}
;}\newcommand{\nodee}{\node[draw,circle] (e) {$$}
;}\newcommand{\nodef}{\node[draw,circle] (f) {$$}
;}\newcommand{\nodeg}{\node[draw,circle] (g) {$$}
;}\newcommand{\nodeh}{\node[draw,circle] (h) {$$}
;}\begin{tikzpicture}[auto]
\matrix[column sep=.3cm, row sep=.3cm,ampersand replacement=\&]{
\& \& \& \& \& \& \& \nodea \& \& \& \\
\& \& \& \& \& \nodeb \& \& \& \& \nodeg \& \\
\& \& \& \nodec \& \& \& \& \& \nodeh \& \& \\
\& \noded \& \& \& \& \& \& \& \& \& \\
\nodee \& \& \nodef \& \& \& \& \& \& \& \& \\
};
\path[ultra thick, red] (d) edge (e) edge (f)
(c) edge (d)
(b) edge (c)
(g) edge (h)
(a) edge (b) edge (g);
\end{tikzpicture}}
In [17]:
In [18]:
In [19]:
In [20]:
In [21]:
In [22]:
In [23]:
(1, 4, 1, 4, 5, 18, 1, 2)
In [24]:
[(3, 2, 1), (3, 1, 2), (1, 4, 1), (2, 1, 3), (1, 2, 3)]
In [25]:
A 2-dimensional polyhedron in ZZ^3 defined as the convex hull of 5 vertices (use the .plot() method to plot)
In [26]:
In [27]:
A 3-dimensional polyhedron in ZZ^4 defined as the convex hull of 14 vertices (use the .plot() method to plot)
In [28]:
In [29]:
In [30]:
In [31]:
In [32]:
(An inequality (0, -1, -1) x + 5 >= 0,
An inequality (0, 0, -1) x + 3 >= 0,
An inequality (0, -1, 0) x + 3 >= 0,
An inequality (0, 1, 0) x - 1 >= 0,
An inequality (0, 1, 1) x - 3 >= 0,
An inequality (0, 0, 1) x - 1 >= 0)
In [33]:
(An equation (1, 1, 1) x - 6 == 0,)
In [34]:
(An inequality (0, -1, -1) x + 5 >= 0,
An inequality (0, 0, -1) x + 3 >= 0,
An inequality (0, 1, 0) x - 1 >= 0,
An inequality (0, 1, 1) x - 3 >= 0,
An inequality (0, 0, 1) x - 1 >= 0)
In [35]:
True
In [36]:
14
In [37]:
9
In [38]:
True
In [40]:
In [41]:
A 3-dimensional polyhedron in ZZ^4 defined as the convex hull of 18 vertices (use the .plot() method to plot)
In [42]:
In [43]:
In [44]:
In [45]:
In [46]:
14
11
9
In [0]:
In [0]:
to finish...
Some beautiful decompositions of permutohedron and
In [0]: