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


Python cartan_type.CartanType类代码示例

本文整理汇总了Python中cartan_type.CartanType的典型用法代码示例。如果您正苦于以下问题:Python CartanType类的具体用法?Python CartanType怎么用?Python CartanType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: coxeter_matrix

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
开发者ID:jwbober,项目名称:sagelib,代码行数:60,代码来源:coxeter_matrix.py

示例2: DynkinDiagram

def DynkinDiagram(*args):
    """
    INPUT:

     -  ``ct`` - a Cartan Type

    Returns a Dynkin diagram for type ct.


    The edge multiplicities are encoded as edge labels. This uses the
    convention in Kac / Fulton Harris, Representation theory / Wikipedia
    (http://en.wikipedia.org/wiki/Dynkin_diagram). That is for i != j::

       j --k--> i <==> a_ij = -k
                  <==> -scalar(coroot[i], root[j]) = k
                  <==> multiple arrows point from the longer root
                       to the shorter one

    EXAMPLES::

        sage: DynkinDiagram(['A', 4])
        O---O---O---O
        1   2   3   4
        A4

        sage: DynkinDiagram(['A',1],['A',1])
        O
        1
        O
        2
        A1xA1

        sage: R = RootSystem("A2xB2xF4")
        sage: DynkinDiagram(R)
        O---O
        1   2
        O=>=O
        3   4
        O---O=>=O---O
        5   6   7   8
        A2xB2xF4

    SEE ALSO: :func:`CartanType` for a general discussion on Cartan
    types and in particular node labeling conventions.
    """
    if len(args) == 0:
       return DynkinDiagram_class()
    ct = CartanType(*args)
    if hasattr(ct, "dynkin_diagram"):
        return ct.dynkin_diagram()
    else:
        raise ValueError, "Dynkin diagram data not yet hardcoded for type %s"%ct
开发者ID:chos9,项目名称:sage,代码行数:52,代码来源:dynkin_diagram.py

示例3: WeylDim

def WeylDim(ct, coeffs):
    """
    The Weyl Dimension Formula.
    
    INPUT:
    
    
    -  ``type`` - a Cartan type
    
    -  ``coeffs`` - a list of nonnegative integers
    
    
    The length of the list must equal the rank type[1]. A dominant
    weight hwv is constructed by summing the fundamental weights with
    coefficients from this list. The dimension of the irreducible
    representation of the semisimple complex Lie algebra with highest
    weight vector hwv is returned.
    
    EXAMPLES:

    For `SO(7)`, the Cartan type is `B_3`, so::
    
        sage: WeylDim(['B',3],[1,0,0]) # standard representation of SO(7)
        7
        sage: WeylDim(['B',3],[0,1,0]) # exterior square
        21
        sage: WeylDim(['B',3],[0,0,1]) # spin representation of spin(7)
        8
        sage: WeylDim(['B',3],[1,0,1]) # sum of the first and third fundamental weights
        48
        sage: [WeylDim(['F',4],x) for x in [1,0,0,0],[0,1,0,0],[0,0,1,0],[0,0,0,1]]
        [52, 1274, 273, 26]
        sage: [WeylDim(['E', 6], x) for x in [0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1], [0, 0, 0, 0, 0, 2], [0, 0, 0, 0, 1, 0], [0, 0, 1, 0, 0, 0], [1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 1], [2, 0, 0, 0, 0, 0]]
        [1, 78, 27, 351, 351, 351, 27, 650, 351]
    """
    ct = CartanType(ct)
    lattice = RootSystem(ct).ambient_space()
    rank = ct.rank()
    fw = lattice.fundamental_weights()
    hwv = lattice.sum(coeffs[i]*fw[i+1] for i in range(min(rank, len(coeffs))))
    return lattice.weyl_dimension(hwv)
开发者ID:pombredanne,项目名称:sage-1,代码行数:41,代码来源:root_system.py

示例4: coxeter_matrix_as_function

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]]
开发者ID:BlairArchibald,项目名称:sage,代码行数:23,代码来源:coxeter_matrix.py

示例5: __init__

    def __init__(self, cartan_type, as_dual_of=None):
        """
        TESTS::

            sage: R = RootSystem(['A',3])
            sage: R
            Root system of type ['A', 3]
        """
        self._cartan_type = CartanType(cartan_type)

        # Duality
        # The root system can be defined as dual of another root system. This will
        # only affects the pretty printing
        if as_dual_of is None:
            self.dual_side = False
            # still fails for CartanType G2xA1
            try:
                self.dual = RootSystem(self._cartan_type.dual(), as_dual_of=self);
            except Exception:
                pass
        else:
            self.dual_side = True
            self.dual = as_dual_of
开发者ID:BlairArchibald,项目名称:sage,代码行数:23,代码来源:root_system.py

示例6: DynkinDiagram

def DynkinDiagram(*args):
    r"""
    Return a Dynkin diagram for type ``ct``.

    INPUT:

    -  ``ct`` -- a Cartan Type

    The edge multiplicities are encoded as edge labels. This uses the
    convention in Hong and Kang, Kac, Fulton Harris, and crystals. This is the
    **opposite** convention in Bourbaki and Wikipedia's Dynkin diagram
    (:wikipedia:`Dynkin_diagram`). That is for `i \neq j`::

       i <--k-- j <==> a_ij = -k
                  <==> -scalar(coroot[i], root[j]) = k
                  <==> multiple arrows point from the shorter root
                       to the longer one

    For example, in type `C_2`, we have::

        sage: C2 = DynkinDiagram(['C',2]); C2
        O=<=O
        1   2
        C2
        sage: C2.cartan_matrix()
        [ 2 -2]
        [-1  2]

    However Bourbaki would have the Cartan matrix as:

    .. MATH::

        \begin{bmatrix}
        2 & -1 \\
        -2 & 2
        \end{bmatrix}.

    EXAMPLES::

        sage: DynkinDiagram(['A', 4])
        O---O---O---O
        1   2   3   4
        A4

        sage: DynkinDiagram(['A',1],['A',1])
        O
        1
        O
        2
        A1xA1

        sage: R = RootSystem("A2xB2xF4")
        sage: DynkinDiagram(R)
        O---O
        1   2
        O=>=O
        3   4
        O---O=>=O---O
        5   6   7   8
        A2xB2xF4

    .. SEEALSO::

        :func:`CartanType` for a general discussion on Cartan
        types and in particular node labeling conventions.
    """
    if len(args) == 0:
       return DynkinDiagram_class()
    ct = CartanType(*args)
    if hasattr(ct, "dynkin_diagram"):
        return ct.dynkin_diagram()
    else:
        raise ValueError, "Dynkin diagram data not yet hardcoded for type %s"%ct
开发者ID:odellus,项目名称:sage,代码行数:73,代码来源:dynkin_diagram.py

示例7: RootSystem


#.........这里部分代码省略.........
        sage: list(R.root_lattice().simple_coroots())
        [alphacheck[1], alphacheck[2], alphacheck[3]]
        sage: list(R.coroot_lattice().simple_roots())
        [alphacheck[1], alphacheck[2], alphacheck[3]]
        sage: list(R.dual.root_lattice().simple_roots())
        [alphacheck[1], alphacheck[2], alphacheck[3]]
    
    The coweight lattice and space are defined similarly. Note that, to
    limit confusion, all the output have been tweaked appropriately.

    .. seealso::

        - :mod:`sage.combinat.root_system`
        - :class:`RootSpace`
        - :class:`WeightSpace`
        - :class:`AmbientSpace`
        - :class:`~sage.combinat.root_system.root_lattice_realizations.RootLatticeRealizations`
        - :class:`~sage.combinat.root_system.weight_lattice_realizations.WeightLatticeRealizations`

    TESTS::

        sage: R = RootSystem(['C',3])
        sage: TestSuite(R).run()
        sage: L = R.ambient_space()
        sage: s = L.simple_reflections() # this used to break the testsuite below due to caching an unpicklable method
        sage: s = L.simple_projections() # todo: not implemented
        sage: TestSuite(L).run()
        sage: L = R.root_space()
        sage: s = L.simple_reflections()
        sage: TestSuite(L).run()

    ::

        sage: for T in CartanType.samples(crystalographic=True):  # long time (13s on sage.math, 2012)
        ...       TestSuite(RootSystem(T)).run()
    """

    @staticmethod
    def __classcall__(cls, cartan_type, as_dual_of=None):
        """
        Straighten arguments to enable unique representation

        .. seealso:: :class:`UniqueRepresentation`

        TESTS::

            sage: RootSystem(["A",3]) is RootSystem(CartanType(["A",3]))
            True
            sage: RootSystem(["B",3], as_dual_of=None) is RootSystem("B3")
            True
        """
        return super(RootSystem, cls).__classcall__(cls, CartanType(cartan_type), as_dual_of)

    def __init__(self, cartan_type, as_dual_of=None):
        """
        TESTS::
        
            sage: R = RootSystem(['A',3])
            sage: R
            Root system of type ['A', 3]
        """
        self._cartan_type = CartanType(cartan_type)

        # Duality
        # The root system can be defined as dual of another root system. This will
        # only affects the pretty printing
开发者ID:pombredanne,项目名称:sage-1,代码行数:67,代码来源:root_system.py

示例8: RootSystem


#.........这里部分代码省略.........
        sage: R.dual.root_lattice()
        Coroot lattice of the Root system of type ['B', 3]
    
    In particular, the coroots for the root lattice are in fact the
    roots of the coroot lattice::
    
        sage: list(R.root_lattice().simple_coroots())
        [alphacheck[1], alphacheck[2], alphacheck[3]]
        sage: list(R.coroot_lattice().simple_roots())
        [alphacheck[1], alphacheck[2], alphacheck[3]]
        sage: list(R.dual.root_lattice().simple_roots())
        [alphacheck[1], alphacheck[2], alphacheck[3]]
    
    The coweight lattice and space are defined similarly. Note that, to
    limit confusion, all the output have been tweaked appropriately.
    
    TESTS::
    
        sage: R = RootSystem(['C',3])
        sage: R == loads(dumps(R))
        True
        sage: L = R.ambient_space()
        sage: s = L.simple_reflections()
        sage: s = L.simple_projections() # todo: not implemented
        sage: L == loads(dumps(L))
        True
        sage: L = R.root_space()
        sage: s = L.simple_reflections()
        sage: L == loads(dumps(L))
        True
    
    ::
    
        sage: for T in CartanType.samples(finite=True,crystalographic=True):
        ...       TestSuite(RootSystem(T)).run()
    """  

    @staticmethod
    def __classcall__(cls, cartan_type, as_dual_of=None):
        return super(RootSystem, cls).__classcall__(cls, CartanType(cartan_type), as_dual_of)

    def __init__(self, cartan_type, as_dual_of=None):
        """
        TESTS::
        
            sage: R = RootSystem(['A',3])
            sage: R
            Root system of type ['A', 3]
        """
        self._cartan_type = CartanType(cartan_type)

        # Duality
        # The root system can be defined as dual of another root system. This will
        # only affects the pretty printing
        if as_dual_of is None:
            self.dual_side = False
            self.dual = RootSystem(self._cartan_type.dual(), as_dual_of=self);
            # still fails for CartanType G2xA1
            try:
                self.dual = RootSystem(self._cartan_type.dual(), as_dual_of=self);
            except:
                pass
        else:
            self.dual_side = True
            self.dual = as_dual_of
开发者ID:jwbober,项目名称:sagelib,代码行数:66,代码来源:root_system.py


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