コード例 #1
0
ファイル: type_dual.py プロジェクト: battyone/DistanceRegular
    def basic_untwisted(self):
        r"""
        Return the basic untwisted Cartan type associated with this affine
        Cartan type.

        Given an affine type `X_n^{(r)}`, the basic untwisted type is `X_n`.
        In other words, it is the classical Cartan type that is twisted to
        obtain ``self``.

        EXAMPLES::

            sage: CartanType(['A', 7, 2]).basic_untwisted()
            ['A', 7]
            sage: CartanType(['E', 6, 2]).basic_untwisted()
            ['E', 6]
            sage: CartanType(['D', 4, 3]).basic_untwisted()
            ['D', 4]
        """
        from . import cartan_type
        if self.dual().type() == 'B':
            return cartan_type.CartanType(
                ['A', self.classical().rank() * 2 - 1])
        elif self.dual().type() == 'BC':
            return cartan_type.CartanType(['A', self.classical().rank() * 2])
        elif self.dual().type() == 'C':
            return cartan_type.CartanType(['D', self.classical().rank() + 1])
        elif self.dual().type() == 'F':
            return cartan_type.CartanType(['E', 6])
        elif self.dual().type() == 'G':
            return cartan_type.CartanType(['D', 4])
コード例 #2
0
ファイル: type_marked.py プロジェクト: sagemathinc/smc-sage
    def __classcall__(cls, ct, marked_nodes):
        """
        This standardizes the input of the constructor to ensure
        unique representation.

        EXAMPLES::

            sage: ct1 = CartanType(['B',2]).marked_nodes([1,2])
            sage: ct2 = CartanType(['B',2]).marked_nodes([2,1])
            sage: ct3 = CartanType(['B',2]).marked_nodes((1,2))
            sage: ct4 = CartanType(['D',4]).marked_nodes([1,2])
            sage: ct1 is ct2
            True
            sage: ct1 is ct3
            True
            sage: ct1 == ct4
            False
        """
        ct = cartan_type.CartanType(ct)
        if not marked_nodes:
            return ct
        if any(node not in ct.index_set() for node in marked_nodes):
            raise ValueError("invalid marked node")
        marked_nodes = tuple(sorted(marked_nodes))
        return super(CartanType, cls).__classcall__(cls, ct, marked_nodes)