当前位置: 首页>>代码示例>>Python>>正文


Python CartanType.dual方法代码示例

本文整理汇总了Python中sage.combinat.root_system.cartan_type.CartanType.dual方法的典型用法代码示例。如果您正苦于以下问题:Python CartanType.dual方法的具体用法?Python CartanType.dual怎么用?Python CartanType.dual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sage.combinat.root_system.cartan_type.CartanType的用法示例。


在下文中一共展示了CartanType.dual方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __classcall_private__

# 需要导入模块: from sage.combinat.root_system.cartan_type import CartanType [as 别名]
# 或者: from sage.combinat.root_system.cartan_type.CartanType import dual [as 别名]
    def __classcall_private__(cls, cartan_type, r, s):
        """
        Normalize the input arguments to ensure unique representation.

        EXAMPLES::

            sage: KRT1 = KirillovReshetikhinTableaux(CartanType(['A',3,1]), 2, 3)
            sage: KRT2 = KirillovReshetikhinTableaux(['A',3,1], 2, 3)
            sage: KRT1 is KRT2
            True
        """
        ct = CartanType(cartan_type)
        assert ct.is_affine()

        if ct.is_untwisted_affine():
            if ct.letter == 'D':
                if r == ct.n or r == ct.n - 1:
                    return KRTableauxSpin(ct, r, s)
                return KRTableauxTypeVertical(ct, r, s)

            if ct.letter == 'B':
                if r == ct.n:
                    return KRTableauxBn(ct, r, s)
                return KRTypeVertical(ct, r, s)

            if ct.letter == 'A' or (ct.letter == 'C' and r == ct.n):
                return KRTableauxRectangle(ct, r, s)
        else:
            if ct.dual().letter == 'B':
                return KRTableauxTypeVertical(ct, r, s)

        raise NotImplementedError
开发者ID:pombredanne,项目名称:sage-1,代码行数:34,代码来源:kr_tableaux.py

示例2: find_cartan_type_from_matrix

# 需要导入模块: from sage.combinat.root_system.cartan_type import CartanType [as 别名]
# 或者: from sage.combinat.root_system.cartan_type.CartanType import dual [as 别名]
def find_cartan_type_from_matrix(CM):
    """
    Find a Cartan type by direct comparison of matrices given from the
    generalized Cartan matrix ``CM`` and return ``None`` if not found.

    INPUT:

    - ``CM`` -- A generalized Cartan matrix

    EXAMPLES::

        sage: from sage.combinat.root_system.cartan_matrix import find_cartan_type_from_matrix
        sage: M = matrix([[2,-1,-1], [-1,2,-1], [-1,-1,2]])
        sage: find_cartan_type_from_matrix(M)
        ['A', 2, 1]
        sage: M = matrix([[2,-1,0], [-1,2,-2], [0,-1,2]])
        sage: find_cartan_type_from_matrix(M)
        ['C', 3]
        sage: M = matrix([[2,-1,-2], [-1,2,-1], [-2,-1,2]])
        sage: find_cartan_type_from_matrix(M)
    """
    n = CM.ncols()
    # Build the list to test based upon rank
    if n == 1:
        return CartanType(['A', 1])

    test = [['A', n]]
    if n >= 2:
        if n == 2:
            test += [['G',2], ['A',2,2]]
        test += [['B',n], ['A',n-1,1]]
    if n >= 3:
        if n == 3:
            test += [['G',2,1], ['D',4,3]]
        test += [['C',n], ['BC',n-1,2], ['C',n-1,1]]
    if n >= 4:
        if n == 4:
            test += [['F',4], ['G',2,1], ['D',4,3]]
        test += [['D',n], ['B',n-1,1]]
    if n == 5:
        test += [['F',4,1], ['D',n-1,1]]
    elif n == 6:
        test.append(['E',6])
    elif n == 7:
        test += [['E',7], ['E',6,1]]
    elif n == 8:
        test += [['E',8], ['E',7,1]]
    elif n == 9:
        test.append(['E',8,1])

    # Test every possible Cartan type and its dual
    for x in test:
        ct = CartanType(x)
        if ct.cartan_matrix() == CM:
            return ct
        if ct == ct.dual():
            continue
        ct = ct.dual()
        if ct.cartan_matrix() == CM:
            return ct
    return None
开发者ID:biasse,项目名称:sage,代码行数:63,代码来源:cartan_matrix.py

示例3: find_cartan_type_from_matrix

# 需要导入模块: from sage.combinat.root_system.cartan_type import CartanType [as 别名]
# 或者: from sage.combinat.root_system.cartan_type.CartanType import dual [as 别名]
def find_cartan_type_from_matrix(CM):
    r"""
    Find a Cartan type by direct comparison of Dynkin diagrams given from
    the generalized Cartan matrix ``CM`` and return ``None`` if not found.

    INPUT:

    - ``CM`` -- a generalized Cartan matrix

    EXAMPLES::

        sage: from sage.combinat.root_system.cartan_matrix import find_cartan_type_from_matrix
        sage: CM = CartanMatrix([[2,-1,-1], [-1,2,-1], [-1,-1,2]])
        sage: find_cartan_type_from_matrix(CM)
        ['A', 2, 1]
        sage: CM = CartanMatrix([[2,-1,0], [-1,2,-2], [0,-1,2]])
        sage: find_cartan_type_from_matrix(CM)
        ['C', 3] relabelled by {1: 0, 2: 1, 3: 2}
        sage: CM = CartanMatrix([[2,-1,-2], [-1,2,-1], [-2,-1,2]])
        sage: find_cartan_type_from_matrix(CM)
    """
    types = []
    for S in CM.dynkin_diagram().connected_components_subgraphs():
        S = DiGraph(S) # We need a simple digraph here
        n = S.num_verts()
        # Build the list to test based upon rank
        if n == 1:
            types.append(CartanType(['A', 1]))
            continue

        test = [['A', n]]
        if n >= 2:
            if n == 2:
                test += [['G',2], ['A',2,2]]
            test += [['B',n], ['A',n-1,1]]
        if n >= 3:
            if n == 3:
                test.append(['G',2,1])
            test += [['C',n], ['BC',n-1,2], ['C',n-1,1]]
        if n >= 4:
            if n == 4:
                test.append(['F',4])
            test += [['D',n], ['B',n-1,1]]
        if n >= 5:
            if n == 5:
                test.append(['F',4,1])
            test.append(['D',n-1,1])
        if n == 6:
            test.append(['E',6])
        elif n == 7:
            test += [['E',7], ['E',6,1]]
        elif n == 8:
            test += [['E',8], ['E',7,1]]
        elif n == 9:
            test.append(['E',8,1])

        # Test every possible Cartan type and its dual
        found = False
        for x in test:
            ct = CartanType(x)
            T = DiGraph(ct.dynkin_diagram()) # We need a simple digraph here
            iso, match = T.is_isomorphic(S, certificate=True, edge_labels=True)
            if iso:
                types.append(ct.relabel(match))
                found = True
                break

            if ct == ct.dual():
                continue # self-dual, so nothing more to test

            ct = ct.dual()
            T = DiGraph(ct.dynkin_diagram()) # We need a simple digraph here
            iso, match = T.is_isomorphic(S, certificate=True, edge_labels=True)
            if iso:
                types.append(ct.relabel(match))
                found = True
                break
        if not found:
            return None

    return CartanType(types)
开发者ID:sagemath,项目名称:sage,代码行数:83,代码来源:cartan_matrix.py


注:本文中的sage.combinat.root_system.cartan_type.CartanType.dual方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。