本文整理汇总了Python中tableau.Tableau.shape方法的典型用法代码示例。如果您正苦于以下问题:Python Tableau.shape方法的具体用法?Python Tableau.shape怎么用?Python Tableau.shape使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tableau.Tableau
的用法示例。
在下文中一共展示了Tableau.shape方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: e_ik
# 需要导入模块: from tableau import Tableau [as 别名]
# 或者: from tableau.Tableau import shape [as 别名]
def e_ik(itab, ktab, star=0):
"""
EXAMPLES::
sage: from sage.combinat.symmetric_group_algebra import e_ik
sage: e_ik([[1,2,3]], [[1,2,3]])
[1, 2, 3] + [1, 3, 2] + [2, 1, 3] + [2, 3, 1] + [3, 1, 2] + [3, 2, 1]
sage: e_ik([[1,2,3]], [[1,2,3]], star=1)
[1, 2] + [2, 1]
"""
it = Tableau(itab)
kt = Tableau(ktab)
if star:
it = it.restrict(it.size() - star)
kt = kt.restrict(kt.size() - star)
if it.shape() != kt.shape():
raise ValueError, "the two tableaux must be of the same shape"
mult = permutation_options['mult']
permutation_options['mult'] = 'l2r'
if kt == it:
res = e(it)
elif (it, kt) in e_ik_cache:
res = e_ik_cache[(it,kt)]
else:
pi = pi_ik(it,kt)
e_ik_cache[(it,kt)] = e(it)*pi
res = e_ik_cache[(it,kt)]
permutation_options['mult'] = mult
return res
示例2: epsilon
# 需要导入模块: from tableau import Tableau [as 别名]
# 或者: from tableau.Tableau import shape [as 别名]
def epsilon(tab, star=0):
"""
EXAMPLES::
sage: from sage.combinat.symmetric_group_algebra import epsilon
sage: epsilon([[1,2]])
1/2*[1, 2] + 1/2*[2, 1]
sage: epsilon([[1],[2]])
1/2*[1, 2] - 1/2*[2, 1]
"""
t = Tableau(tab)
if star:
t = t.restrict(t.size() - star)
mult = permutation_options['mult']
permutation_options['mult'] = 'l2r'
if t in epsilon_cache:
res = epsilon_cache[t]
else:
if t.size() == 2:
epsilon_cache[t] = e(t)*(1/kappa(t.shape()))
res = epsilon_cache[t]
elif t == Tableau([[1]]):
epsilon_cache[t] = e(t)
res = epsilon_cache[t]
else:
epsilon_cache[t] = epsilon(t, 1)*e(t)*epsilon(t,1)*( 1 / kappa(t.shape()))
res = epsilon_cache[t]
permutation_options['mult'] = mult
return res
示例3: epsilon_ik
# 需要导入模块: from tableau import Tableau [as 别名]
# 或者: from tableau.Tableau import shape [as 别名]
def epsilon_ik(itab, ktab, star=0):
"""
EXAMPLES::
sage: from sage.combinat.symmetric_group_algebra import epsilon_ik
sage: epsilon_ik([[1,2],[3]], [[1,3],[2]])
1/4*[1, 3, 2] - 1/4*[2, 3, 1] + 1/4*[3, 1, 2] - 1/4*[3, 2, 1]
sage: epsilon_ik([[1,2],[3]], [[1,3],[2]], star=1)
Traceback (most recent call last):
...
ValueError: the two tableaux must be of the same shape
"""
it = Tableau(itab)
kt = Tableau(ktab)
if star:
it = it.restrict(it.size() - star)
kt = kt.restrict(kt.size() - star)
if it.shape() != kt.shape():
raise ValueError, "the two tableaux must be of the same shape"
mult = permutation_options['mult']
permutation_options['mult'] = 'l2r'
if kt == it:
res = epsilon(itab)
elif (it, kt) in epsilon_ik_cache:
res = epsilon_ik_cache[(it,kt)]
else:
epsilon_ik_cache[(it,kt)] = epsilon(it, star+1)*e_ik(it,kt,star)*epsilon(kt, star+1) * (1/kappa(it.shape()))
res = epsilon_ik_cache[(it,kt)]
permutation_options['mult'] = mult
return res
示例4: e_hat
# 需要导入模块: from tableau import Tableau [as 别名]
# 或者: from tableau.Tableau import shape [as 别名]
def e_hat(tab, star=0):
"""
The Young projection operator, an idempotent in the rational group algebra.
EXAMPLES::
sage: from sage.combinat.symmetric_group_algebra import e_hat
sage: e_hat([[1,2,3]])
1/6*[1, 2, 3] + 1/6*[1, 3, 2] + 1/6*[2, 1, 3] + 1/6*[2, 3, 1] + 1/6*[3, 1, 2] + 1/6*[3, 2, 1]
sage: e_hat([[1],[2]])
1/2*[1, 2] - 1/2*[2, 1]
There are differing conventions for the order of the symmetrizers
and antisymmetrizers. This example illustrates our conventions::
sage: e_hat([[1,2],[3]])
1/3*[1, 2, 3] + 1/3*[2, 1, 3] - 1/3*[3, 1, 2] - 1/3*[3, 2, 1]
"""
t = Tableau(tab)
if star:
t = t.restrict(t.size()-star)
if t in ehat_cache:
res = ehat_cache[t]
else:
res = (1/kappa(t.shape()))*e(t)
return res
示例5: e_hat
# 需要导入模块: from tableau import Tableau [as 别名]
# 或者: from tableau.Tableau import shape [as 别名]
def e_hat(tab, star=0):
"""
The Young projection operator corresponding to the Young tableau
``tab`` (which is supposed to contain every integer from `1` to
its size precisely once, but may and may not be standard). This
is an idempotent in the rational group algebra.
EXAMPLES::
sage: from sage.combinat.symmetric_group_algebra import e_hat
sage: e_hat([[1,2,3]])
1/6*[1, 2, 3] + 1/6*[1, 3, 2] + 1/6*[2, 1, 3] + 1/6*[2, 3, 1] + 1/6*[3, 1, 2] + 1/6*[3, 2, 1]
sage: e_hat([[1],[2]])
1/2*[1, 2] - 1/2*[2, 1]
There are differing conventions for the order of the symmetrizers
and antisymmetrizers. This example illustrates our conventions::
sage: e_hat([[1,2],[3]])
1/3*[1, 2, 3] + 1/3*[2, 1, 3] - 1/3*[3, 1, 2] - 1/3*[3, 2, 1]
"""
t = Tableau(tab)
if star:
t = t.restrict(t.size()-star)
if t in ehat_cache:
res = ehat_cache[t]
else:
res = (1/kappa(t.shape()))*e(t)
return res