本文整理汇总了Python中sage.combinat.partition.Partition.outside_corners方法的典型用法代码示例。如果您正苦于以下问题:Python Partition.outside_corners方法的具体用法?Python Partition.outside_corners怎么用?Python Partition.outside_corners使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.combinat.partition.Partition
的用法示例。
在下文中一共展示了Partition.outside_corners方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: affine_grassmannian_to_core
# 需要导入模块: from sage.combinat.partition import Partition [as 别名]
# 或者: from sage.combinat.partition.Partition import outside_corners [as 别名]
def affine_grassmannian_to_core(self):
r"""
Bijection between affine Grassmannian elements of type `A_k^{(1)}` and `(k+1)`-cores.
INPUT:
- ``self`` -- an affine Grassmannian element of some affine Weyl group of type `A_k^{(1)}`
Recall that an element `w` of an affine Weyl group is
affine Grassmannian if all its all reduced words end in 0, see :meth:`is_affine_grassmannian`.
OUTPUT:
- a `(k+1)`-core
See also :meth:`affine_grassmannian_to_partition`.
EXAMPLES::
sage: W = WeylGroup(['A',2,1])
sage: w = W.from_reduced_word([0,2,1,0])
sage: la = w.affine_grassmannian_to_core(); la
[4, 2]
sage: type(la)
<class 'sage.combinat.core.Cores_length_with_category.element_class'>
sage: la.to_grassmannian() == w
True
sage: w = W.from_reduced_word([0,2,1])
sage: w.affine_grassmannian_to_core()
Traceback (most recent call last):
...
ValueError: Error! this only works on type 'A' affine Grassmannian elements
"""
from sage.combinat.partition import Partition
from sage.combinat.core import Core
if not self.is_affine_grassmannian() or not self.parent().cartan_type().letter == "A":
raise ValueError("Error! this only works on type 'A' affine Grassmannian elements")
out = Partition([])
rword = self.reduced_word()
kp1 = self.parent().n
for i in range(len(rword)):
for c in (x for x in out.outside_corners() if (x[1] - x[0]) % kp1 == rword[-i - 1]):
out = out.add_cell(c[0], c[1])
return Core(out._list, kp1)