本文整理汇总了Python中sage.combinat.permutation.Permutation.action方法的典型用法代码示例。如果您正苦于以下问题:Python Permutation.action方法的具体用法?Python Permutation.action怎么用?Python Permutation.action使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sage.combinat.permutation.Permutation
的用法示例。
在下文中一共展示了Permutation.action方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: scalar_product_matrix
# 需要导入模块: from sage.combinat.permutation import Permutation [as 别名]
# 或者: from sage.combinat.permutation.Permutation import action [as 别名]
def scalar_product_matrix(self, permutation=None):
r"""
Return the scalar product matrix corresponding to ``permutation``.
The entries are given by the scalar products of ``u`` and
``permutation.action(v)``, where ``u`` is a vertex in the underlying
Yang-Baxter graph and ``v`` is a vertex in the dual graph.
EXAMPLES::
sage: spc = SymmetricGroupRepresentation([3,1], 'specht')
sage: spc.scalar_product_matrix()
[ 1 0 0]
[ 0 -1 0]
[ 0 0 1]
"""
if permutation is None:
permutation = Permutation(range(1,1+self._partition.size()))
Q = matrix(QQ, len(self._yang_baxter_graph))
for (i,v) in enumerate(self._dual_vertices):
for (j,u) in enumerate(self._yang_baxter_graph):
Q[i,j] = self.scalar_product(tuple(permutation.action(v)), u)
return Q