本文整理汇总了Python中cartan_type.CartanType.index_set方法的典型用法代码示例。如果您正苦于以下问题:Python CartanType.index_set方法的具体用法?Python CartanType.index_set怎么用?Python CartanType.index_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cartan_type.CartanType
的用法示例。
在下文中一共展示了CartanType.index_set方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: coxeter_matrix
# 需要导入模块: from cartan_type import CartanType [as 别名]
# 或者: from cartan_type.CartanType import index_set [as 别名]
def coxeter_matrix(t):
"""
Returns the Coxeter matrix of type t.
EXAMPLES::
sage: coxeter_matrix(['A', 4])
[1 3 2 2]
[3 1 3 2]
[2 3 1 3]
[2 2 3 1]
sage: coxeter_matrix(['B', 4])
[1 3 2 2]
[3 1 3 2]
[2 3 1 4]
[2 2 4 1]
sage: coxeter_matrix(['C', 4])
[1 3 2 2]
[3 1 3 2]
[2 3 1 4]
[2 2 4 1]
sage: coxeter_matrix(['D', 4])
[1 3 2 2]
[3 1 3 3]
[2 3 1 2]
[2 3 2 1]
::
sage: coxeter_matrix(['E', 6])
[1 2 3 2 2 2]
[2 1 2 3 2 2]
[3 2 1 3 2 2]
[2 3 3 1 3 2]
[2 2 2 3 1 3]
[2 2 2 2 3 1]
::
sage: coxeter_matrix(['F', 4])
[1 3 2 2]
[3 1 4 2]
[2 4 1 3]
[2 2 3 1]
::
sage: coxeter_matrix(['G', 2])
[1 6]
[6 1]
"""
ct = CartanType(t)
cf = coxeter_matrix_as_function(ct)
index_set = ct.index_set()
MS = MatrixSpace(ZZ, len(index_set))
m = MS(0)
for i in range(len(index_set)):
for j in range(len(index_set)):
m[i, j] = cf(index_set[i], index_set[j])
return m
示例2: coxeter_matrix_as_function
# 需要导入模块: from cartan_type import CartanType [as 别名]
# 或者: from cartan_type.CartanType import index_set [as 别名]
def coxeter_matrix_as_function(t):
"""
Returns the Coxeter matrix, as a function
INPUT:
- ``t`` -- a Cartan type
EXAMPLES::
sage: from sage.combinat.root_system.coxeter_matrix import coxeter_matrix_as_function
sage: f = coxeter_matrix_as_function(['A',4])
sage: matrix([[f(i,j) for j in range(1,5)] for i in range(1,5)])
[1 3 2 2]
[3 1 3 2]
[2 3 1 3]
[2 2 3 1]
"""
t = CartanType(t)
m = t.coxeter_matrix()
index_set = t.index_set()
reverse = dict((index_set[i], i) for i in range(len(index_set)))
return lambda i,j: m[reverse[i], reverse[j]]