本文整理匯總了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