Ticket #13391: trac_13391-weyl_characters.patch

File trac_13391-weyl_characters.patch, 22.1 KB (added by bump, 9 years ago)

Weyl Character Ring speedup of product_on_basis

  • doc/en/thematic_tutorials/lie/weyl_character_ring.rst

    # HG changeset patch
    # User Daniel Bump <bump@match.stanford.edu>
    # Date 1345727661 25200
    # Node ID 0987e9326876712a0544d9d241edee0a8753c2f7
    # Parent  e5ea7d3deb3577e0fbf0788c2c318c34d4968a8c
    #13391
    Speedup: reimplement multiplication in WeylCharacterRings using Brauer-Klimyk algorithm
    100% doctest coverage in weyl_characters.py
    exterior_power, symmetric_power and adams_operation methods for WeylCharacterRing elements
    revision of the Lie thematic tutorial to reflect the new methods
    
    diff --git a/doc/en/thematic_tutorials/lie/weyl_character_ring.rst b/doc/en/thematic_tutorials/lie/weyl_character_ring.rst
    a b  
    305305symplectic, while those of `spin(7)` and `spin(9)` are orthogonal.
    306306
    307307
    308 Symmetric and exterior square
     308Symmetric and exterior powers
    309309-----------------------------
    310310
     311Sage can compute symmetric and exterior powers of a representation::
     312
     313    sage: B3 = WeylCharacterRing("B3",style="coroots")
     314    sage: spin=B3(0,0,1); spin.degree()
     315    8
     316    sage: spin.exterior_power(2)
     317    B3(1,0,0) + B3(0,1,0)
     318    sage: spin.exterior_square()
     319    B3(1,0,0) + B3(0,1,0)
     320    sage: spin.exterior_power(5)
     321    B3(0,0,1) + B3(1,0,1)
     322    sage: spin.symmetric_power(5)
     323    B3(0,0,1) + B3(0,0,3) + B3(0,0,5)
     324
     325The `k`-th exterior square of a representation is zero if `k`
     326is greater than the degree of the representation. However the
     327`k`-th symmetric power is nonzero for all `k`.
     328
    311329The tensor square of any representation decomposes as the direct sum
    312330of the symmetric and exterior squares::
    313331
     
    523541        [1, 2, 5, 14, 42, 132, 429, 1430, 4862, 16796]
    524542
    525543
    526 Symmetric and Exterior Powers
    527 -----------------------------
    528 
    529 We have seen that WeylCharacterRing elements have built-in
    530 methods for symmetric and exterior square. If you want to
    531 obtain higher symmetric or exterior powers, you may do it
    532 as follows. Let us consider the eight dimensional adjoint
    533 representation of `SL(3)`. We will compute the symmetric
    534 fifth power and the exterior fourth powers of this.
    535 The adjoint representation is a homomorphism from `SL(3)`
    536 to `SL(8)`, so the relevant WeylCharacterRings are `A2`
    537 and `A7`. First we construct the symmetric fifth power
    538 and exterior fourth power representations of `A7` ::
    539 
    540         sage: A2 = WeylCharacterRing("A2",style="coroots")
    541         sage: A7 = WeylCharacterRing("A7",style="coroots")
    542         sage: s = A7.fundamental_weights()[1]; s
    543         (1, 0, 0, 0, 0, 0, 0, 0)
    544         sage: e = A7.fundamental_weights()[4]; e
    545         (1, 1, 1, 1, 0, 0, 0, 0)
    546         sage: A7(5*s).degree()
    547         792
    548         sage: A7(e).degree()
    549         70
    550 
    551 Now we may branch these representations down to `SL(2)`
    552 along the adjoint representation. This computes the
    553 symmetric and exterior powers of `ad`.
    554 
    555 .. link
    556 
    557 ::
    558 
    559        sage: ad=A2(1,1); ad.degree()
    560        8
    561        sage: sym5 = A7(5*s).branch(A2,rule=branching_rule_from_plethysm(ad,"A7")); sym5 # long time
    562        A2(0,0) + A2(0,3) + 2*A2(1,1) + A2(3,0) + A2(1,4) + 2*A2(2,2) + A2(4,1) + A2(2,5) + 2*A2(3,3) + A2(5,2) + A2(4,4) + A2(5,5)
    563        sage: ext4 = A7(e).branch(A2,rule=branching_rule_from_plethysm(ad,"A7")); ext4
    564        2*A2(1,1) + 2*A2(2,2)
    565 
    566544Invariants and multiplicities
    567545-----------------------------
    568546
     
    574552
    575553::
    576554
    577       sage: sym5.invariant_degree() # long time
    578       1
    579       sage: ext4.invariant_degree()
    580       0
     555        sage: A2=WeylCharacterRing("A2",style="coroots")
     556        sage: ad = A2(1,1)
     557        sage: [ad.symmetric_power(k).invariant_degree() for k in [0..6]]
     558        [1, 0, 1, 1, 1, 1, 2]
     559        sage: [ad.exterior_power(k).invariant_degree() for k in [0..6]]
     560        [1, 0, 0, 1, 0, 1, 0]
    581561
    582562If we want the multiplicity of some other representation, we may
    583563obtain that using the method ``multiplicity``::
     
    586566
    587567::
    588568
    589      sage: [rep.multiplicity(A2(3,3)) for rep in [sym5, ext4]] # long time
    590      [2, 0]
     569        sage: (ad^3).multiplicity(ad)
     570        8
    591571
  • sage/combinat/root_system/weyl_characters.py

    diff --git a/sage/combinat/root_system/weyl_characters.py b/sage/combinat/root_system/weyl_characters.py
    a b  
    179179        """
    180180        The embedding of ``self`` into its weight ring
    181181
    182         EXAMPLES ::
     182        EXAMPLES::
    183183
    184184            sage: A2 = WeylCharacterRing("A2")
    185185            sage: A2.lift
     
    288288        """
    289289        EXAMPLES::
    290290
    291             sage: WeylCharacterRing("A3")
     291            sage: WeylCharacterRing("A3") # indirect doctest
    292292            The Weyl Character Ring of Type ['A', 3] with Integer Ring coefficients
    293293
    294294        """
     
    374374        return self.monomial(weight)
    375375
    376376    def product_on_basis(self, a, b):
    377         """
     377        r"""
     378        This computes the tensor product of two irreducible representations
     379        using the Brauer-Klimyk method.
     380
    378381        EXAMPLES::
    379382
    380383            sage: D4 = WeylCharacterRing(['D',4])
    381384            sage: spin_plus = D4(1/2,1/2,1/2,1/2)
    382385            sage: spin_minus = D4(1/2,1/2,1/2,-1/2)
    383             sage: spin_plus*spin_minus
     386            sage: spin_plus*spin_minus # indirect doctest
    384387            D4(1,0,0,0) + D4(1,1,1,0)
    385388            sage: spin_minus*spin_plus
    386389            D4(1,0,0,0) + D4(1,1,1,0)
    387390        """
     391        # The method is asymmetrical, and as a rule of thumb
     392        # it is fastest to switch the factors so that the
     393        # smaller character is the one that is decomposed
     394        # into weights.
     395        if sum(a.coefficients()) > sum(b.coefficients()):
     396            a,b = b,a
     397        return self._product_helper(self._irr_weights(a), b)
     398
     399    def _product_helper(self, d1, b):
     400        """
     401        INPUT:
     402
     403        - ``d1`` -- a dictionary of weight multiplicities
     404        - ``b`` -- a dominant weight
     405
     406        If ``d1`` is the dictionary of weight multiplicities of a character,
     407        returns the product of that character by the irreducible character
     408        with highest weight ``b``.
     409
     410        EXAMPLES::
     411
     412            sage: A2 = WeylCharacterRing("A2")
     413            sage: r = A2(1,0,0)
     414            sage: [A2._product_helper(r.weight_multiplicities(),x) for x in A2.space().fundamental_weights()]
     415            [A2(1,1,0) + A2(2,0,0), A2(1,1,1) + A2(2,1,0)]
     416        """
    388417        d = {}
    389         d1 = self._irr_weights(a)
    390         d2 = self._irr_weights(b)
    391418        for k in d1:
    392             for l in d2:
    393                 m = k+l
    394                 if m in d:
    395                     d[m] += d1[k]*d2[l]
    396                 else:
    397                     d[m] = d1[k]*d2[l]
    398         for k in d.keys():
    399             if d[k] == 0:
    400                 del d[k]
    401         return self.char_from_weights(d)
     419            [epsilon,g] = self.dot_reduce(b+k)
     420            if epsilon == 1:
     421                d[g] = d.get(g,0) + d1[k]
     422            elif epsilon == -1:
     423                d[g] = d.get(g,0)- d1[k]
     424        return self._from_dict(d)
     425
     426    def dot_reduce(self, a):
     427        r"""
     428        Auxiliary function for product_on_basis.
     429
     430        INPUT:
     431
     432        - ``a`` -- a weight.
     433
     434        Returns a pair `[\epsilon,b]` where `b` is a dominant weight and
     435        `\epsilon` is 0,1 or -1. To describe `b`, let `w` be an element of
     436        the Weyl group such that `w(a+\rho)` is dominant. If
     437        `w(a+\rho)-\rho` is dominant, then `\epsilon` is the sign of
     438        `w` and `b` is `w(a+\rho)-\rho`. Otherwise, `\epsilon` is zero.
     439
     440        EXAMPLES::
     441
     442            sage: A2=WeylCharacterRing("A2")
     443            sage: weights=A2(2,1,0).weight_multiplicities().keys(); weights
     444            [(1, 2, 0), (2, 1, 0), (0, 2, 1), (2, 0, 1), (0, 1, 2), (1, 1, 1), (1, 0, 2)]
     445            sage: [A2.dot_reduce(x) for x in weights]
     446            [[0, (0, 0, 0)], [1, (2, 1, 0)], [-1, (1, 1, 1)], [0, (0, 0, 0)], [0, (0, 0, 0)], [1, (1, 1, 1)], [-1, (1, 1, 1)]]
     447        """
     448        alphacheck = self._space.simple_coroots()
     449        alpha = self._space.simple_roots()
     450        sr = self._space.weyl_group().simple_reflections()
     451        [epsilon, ret] = [1,a]
     452        done = False
     453        while not done:
     454            done = True
     455            for i in self._space.index_set():
     456                c = ret.inner_product(alphacheck[i])
     457                if c == -1:
     458                    return [0, self._space.zero()]
     459                elif c < -1:
     460                    epsilon = -epsilon
     461                    ret -= (1+c)*alpha[i]
     462                    done = False
     463                    break
     464        return [epsilon, ret]
    402465
    403466    def some_elements(self):
    404467        """
    405         EXAMPLE::
     468        EXAMPLES::
    406469
    407470            sage: WeylCharacterRing("A3").some_elements()
    408471            [A3(1,0,0,0), A3(1,1,0,0), A3(1,1,1,0)]
     
    412475
    413476    def one_basis(self):
    414477        """
    415         EXAMPLE::
     478        EXAMPLES::
    416479
    417480            sage: WeylCharacterRing("A3").one_basis()
    418481            (0, 0, 0, 0)
     
    429492        with highest weight vector hwv. This method is cached
    430493        for efficiency.
    431494
    432         EXAMPLE::
     495        EXAMPLES::
    433496
    434497            sage: A2=WeylCharacterRing("A2")
    435498            sage: v = A2.fundamental_weights()[1]; v
     
    445508        Produces the dictionary of weight multiplicities for the
    446509        WeylCharacter x. The character x does not have to be irreducible.
    447510
    448         EXAMPLE::
     511        EXAMPLES::
    449512
    450513            sage: B2=WeylCharacterRing("B2",style="coroots")
    451514            sage: chi=2*B2(1,0)
     
    509572        """
    510573        Representation of the monomial corresponding to a weight t.
    511574
    512         EXAMPLES ::
    513 
    514             sage: G2=WeylCharacterRing("G2")
     575        EXAMPLES::
     576
     577            sage: G2=WeylCharacterRing("G2") # indirect doctest
    515578            sage: [G2._repr_term(x) for x in G2.fundamental_weights()]
    516579            ['G2(1,0,-1)', 'G2(2,-1,-1)']
    517580        """
     
    556619
    557620        EXAMPLES::
    558621
    559             sage: WeylCharacterRing("G2").simple_roots()
    560             Finite family {1: (0, 1, -1), 2: (1, -2, 1)}
     622            sage: WeylCharacterRing("G2").simple_coroots()
     623            Finite family {1: (0, 1, -1), 2: (1/3, -2/3, 1/3)}
    561624        """
    562625        return self._space.simple_coroots()
    563626
     
    650713
    651714        OUTPUT: the corresponding Weyl character
    652715
    653         EXAMPLES ::
     716        EXAMPLES::
    654717
    655718            sage: A2 = WeylCharacterRing("A2")
    656719            sage: v = A2._space([3,1,0]); v
     
    732795
    733796            INPUT:
    734797
    735              - ``S`` - a Weyl character ring for a Lie subgroup or
     798             - ``S`` -- a Weyl character ring for a Lie subgroup or
    736799               subalgebra
    737800
    738              -  ``rule`` - a branching rule.
     801             -  ``rule`` -- a branching rule.
    739802
    740803            See :func:`branch_weyl_character` for more information
    741804            about branching rules.
     
    751814            """
    752815            return branch_weyl_character(self, self.parent(), S, rule=rule)
    753816
     817        def __pow__(self, n):
     818            """
     819            We override the method in monoids.py since using the Brauer-Klimyk algorithm,
     820            it is more efficient to compute a*(a*(a*a)) than (a*a)*(a*a).
     821
     822            EXAMPLES::
     823
     824                sage: B4=WeylCharacterRing("B4",style="coroots")
     825                sage: spin = B4(0,0,0,1)
     826                sage: [spin^k for k in [0,1,3]]
     827                [B4(0,0,0,0), B4(0,0,0,1), 5*B4(0,0,0,1) + 4*B4(1,0,0,1) + 3*B4(0,1,0,1) + 2*B4(0,0,1,1) + B4(0,0,0,3)]
     828            """
     829            if n == 0:
     830                return self.parent().one()
     831            elif n == 1:
     832                return self
     833            else:
     834                return self*self.__pow__(n-1)
     835
    754836        def is_irreducible(self):
    755837            """
    756838            Returns whether ``self`` is an irreducible character.
     
    765847            """
    766848            return self.coefficients() == [1]
    767849
     850        @cached_method
     851        def symmetric_power(self, k):
     852            r"""
     853            Returns the `k`-th symmetric power of ``self``.
     854
     855            INPUT:
     856
     857            - `k` -- a nonnegative integer
     858
     859            The algorithm is based on the
     860            identity `k h_k = \sum_{r=1}^k p_k h_{k-r}` relating the power-sum and
     861            complete symmetric polynomials. Applying this to the eigenvalues of
     862            an element of the parent Lie group in the representation ``self``, the
     863            `h_k ` become symmetric powers and the `p_k` become adams operations,
     864            giving an efficient recursive implementation.
     865
     866            EXAMPLES::
     867
     868                sage: B3=WeylCharacterRing("B3",style="coroots")
     869                sage: spin=B3(0,0,1)
     870                sage: spin.symmetric_power(6)
     871                B3(0,0,0) + B3(0,0,2) + B3(0,0,4) + B3(0,0,6)
     872            """
     873            par = self.parent()
     874            if k == 0:
     875                return par.one()
     876            if k == 1:
     877                return self
     878            ret = par.zero()
     879            for r in range(1,k+1):
     880                adam_r = self._adams_operation_helper(r)
     881                ret += par.linear_combination( (par._product_helper(adam_r, l), c) for (l, c) in self.symmetric_power(k-r))
     882            dd = {}
     883            m = ret.weight_multiplicities()
     884            for l in m:
     885                dd[l] = m[l]/k
     886            return self.parent().char_from_weights(dd)
     887
     888        @cached_method
     889        def exterior_power(self, k):
     890            r"""
     891            Returns the `k`-th exterior power of ``self``.
     892
     893            INPUT:
     894
     895            - ``k`` -- a nonnegative integer
     896
     897            The algorithm is based on the
     898            identity `k e_k = \sum_{r=1}^k (-1)^{k-1} p_k e_{k-r}` relating the
     899            power-sum and elementary symmetric polynomials. Applying this to the eigenvalues of
     900            an element of the parent Lie group in the representation self, the
     901            `e_k ` become exterior powers and the `p_k` become adams operations,
     902            giving an efficient recursive implementation.
     903
     904            EXAMPLES::
     905
     906                sage: B3=WeylCharacterRing("B3",style="coroots")
     907                sage: spin=B3(0,0,1)
     908                sage: spin.exterior_power(6)
     909                B3(1,0,0) + B3(0,1,0)
     910            """
     911            par = self.parent()
     912            if k == 0:
     913                return par.one()
     914            if k == 1:
     915                return self
     916            ret = par.zero()
     917            for r in range(1,k+1):
     918                adam_r = self._adams_operation_helper(r)
     919                if is_even(r):
     920                    ret -= par.linear_combination( (par._product_helper(adam_r, l), c) for (l, c) in self.exterior_power(k-r))
     921                else:
     922                    ret += par.linear_combination( (par._product_helper(adam_r, l), c) for (l, c) in self.exterior_power(k-r))
     923            dd = {}
     924            m = ret.weight_multiplicities()
     925            for l in m:
     926                dd[l] = m[l]/k
     927            return self.parent().char_from_weights(dd)
     928
     929        def adams_operation(self, r):
     930            """
     931            Returns the `r`-th Adams operation of ``self``.
     932
     933            INPUT:
     934
     935            - ``r`` -- a positive integer
     936
     937            This is a virtual character,
     938            whose weights are the weights of ``self``, each multiplied by `r`.
     939
     940            EXAMPLES::
     941
     942                sage: A2=WeylCharacterRing("A2")
     943                sage: A2(1,1,0).adams_operation(3)
     944                A2(2,2,2) - A2(3,2,1) + A2(3,3,0)
     945            """
     946            return self.parent().char_from_weights(self._adams_operation_helper(r))
     947
     948        def _adams_operation_helper(self, r):
     949            """
     950            Helper function for Adams operations.
     951
     952            INPUT:
     953
     954            - ``r`` -- a positive integer
     955
     956            Returns the dictionary of weight multiplicities for the Adams operation, needed for
     957            internal use by symmetric and exterior powers.
     958
     959            EXAMPLES::
     960
     961                sage: A2=WeylCharacterRing("A2")
     962                sage: A2(1,1,0)._adams_operation_helper(3)
     963                {(3, 3, 0): 1, (0, 3, 3): 1, (3, 0, 3): 1}
     964            """
     965            d = self.weight_multiplicities()
     966            dd = {}
     967            for k in d:
     968                dd[r*k] = d[k]
     969            return dd
     970
    768971        def symmetric_square(self):
    769972            """
    770973            Returns the symmetric square of the character.
     
    776979                A2(2,0)
    777980            """
    778981            # Conceptually, this converts self to the weight ring,
    779             # computes its square there, and convert the result back,
    780             # similar to what is done by product_on_basis. So in
    781             # principle, one could just return self^2.
     982            # computes its square there, and converts the result back.
    782983            #
    783984            # This implementation uses that this is a squaring (and not
    784985            # a generic product) in the weight ring to optimize by
    785986            # running only through pairs of weights instead of couples.
    786             # Worth it?
    787987            c = self.weight_multiplicities()
    788988            ckeys = c.keys()
    789989            d = {}
     
    8791079            Produces the dictionary of weight multiplicities for the
    8801080            WeylCharacter self. The character does not have to be irreducible.
    8811081
    882             EXAMPLE ::
     1082            EXAMPLES::
    8831083
    8841084                sage: B2=WeylCharacterRing("B2",style="coroots")
    8851085                sage: B2(0,1).weight_multiplicities()
     
    8951095            interpreted as functions on a compact Lie group,
    8961096            by Schur orthogonality.
    8971097
    898             EXAMPLES ::
     1098            EXAMPLES::
    8991099
    9001100                sage: A2 = WeylCharacterRing("A2")
    9011101                sage: [f1,f2]=A2.fundamental_weights()
     
    9141114            in self. Multiplicities of other irreducibles may be
    9151115            obtained using the method ``multiplicity.``
    9161116
    917             EXAMPLE ::
     1117            EXAMPLES::
    9181118
    9191119                sage: A2 = WeylCharacterRing("A2",style="coroots")
    9201120                sage: rep = A2(1,0)^2*A2(0,1)^2; rep
     
    9321132
    9331133            Returns the multiplicity of the irreducible other in self.
    9341134
    935             EXAMPLE::
     1135            EXAMPLES::
    9361136
    9371137                sage: B2 = WeylCharacterRing("B2",style="coroots")
    9381138                sage: rep = B2(1,1)^2; rep
     
    9621162    - ``hwv`` - a dominant weight in a weight lattice.
    9631163
    9641164    - ``L`` - the ambient space
     1165
     1166    EXAMPLES::
     1167
     1168        sage: WeylCharacterRing("A2")(2,1,0).weight_multiplicities() # indirect doctest
     1169        {(1, 2, 0): 1, (2, 1, 0): 1, (0, 2, 1): 1, (2, 0, 1): 1, (0, 1, 2): 1, (1, 1, 1): 2, (1, 0, 2): 1}
    9651170    """
    9661171    rho = L.rho()
    9671172    mdict = {}
     
    16461851    """
    16471852    INPUT:
    16481853
    1649     - ``R`` - the Weyl Character Ring of G
    1650 
    1651     - ``S`` - the Weyl Character Ring of H
    1652 
    1653     - ``rule`` - a string describing the branching rule as a map from
     1854    - ``R`` -- the Weyl Character Ring of G
     1855
     1856    - ``S`` -- the Weyl Character Ring of H
     1857
     1858    - ``rule`` -- a string describing the branching rule as a map from
    16541859      the weight space of S to the weight space of R.
     1860
     1861    EXAMPLES::
     1862
     1863       sage: rule = get_branching_rule(CartanType("A3"),CartanType("C2"),"symmetric")
     1864       sage: [rule(x) for x in WeylCharacterRing("A3").fundamental_weights()]
     1865       [[1, 0], [1, 1], [1, 0]]
    16551866    """
    16561867    r = Rtype.rank()
    16571868    s = Stype.rank()
     
    20572268
    20582269    Returns a branching rule for this plethysm.
    20592270
    2060     EXAMPLE:
     2271    EXAMPLES:
    20612272
    20622273    The adjoint representation SL(3) --> GL(8) factors
    20632274    through SO(8). The branching rule in question will
     
    21412352    is that one may conduct calculations in the WeightRing that
    21422353    involve sums of weights that are not Weyl Group invariant.
    21432354
    2144     EXAMPLE::
     2355    EXAMPLES::
    21452356
    21462357        sage: A2 = WeylCharacterRing(['A',2])
    21472358        sage: a2 = WeightRing(A2)
     
    21662377    @staticmethod
    21672378    def __classcall__(cls, parent, prefix=None):
    21682379        """
     2380        TESTS::
     2381
     2382            sage: A3 = WeylCharacterRing("A3", style="coroots")
     2383            sage: a3 = WeightRing(A3)
     2384            sage: a3.cartan_type(), a3.base_ring(), a3.parent()
     2385            (['A', 3], Integer Ring, The Weyl Character Ring of Type ['A', 3] with Integer Ring coefficients)
    21692386        """
    21702387        return super(WeightRing, cls).__classcall__(cls, parent, prefix=prefix)
    21712388
     
    22142431
    22152432            sage: P.<q>=QQ[]
    22162433            sage: G2 = WeylCharacterRing(['G',2], base_ring = P)
    2217             sage: WeightRing(G2)
     2434            sage: WeightRing(G2) # indirect doctest
    22182435            The Weight ring attached to The Weyl Character Ring of Type ['G', 2] with Univariate Polynomial Ring in q over Rational Field coefficients
    22192436        """
    22202437        return "The Weight ring attached to %s"%self._parent
     
    22792496
    22802497    def product_on_basis(self, a, b):
    22812498        """
    2282         EXAMPLE::
     2499        EXAMPLES::
    22832500
    22842501            sage: A2=WeylCharacterRing("A2")
    22852502            sage: a2=WeightRing(A2)
    2286             sage: a2(1,0,0)*a2(0,1,0)
     2503            sage: a2(1,0,0)*a2(0,1,0) # indirect doctest
    22872504            a2(1,1,0)
    22882505        """
    22892506        return self(a+b)
    22902507
    22912508    def some_elements(self):
    22922509        """
    2293         EXAMPLE::
     2510        EXAMPLES::
    22942511
    22952512            sage: A3=WeylCharacterRing("A3")
    22962513            sage: a3=WeightRing(A3)
     
    23012518
    23022519    def one_basis(self):
    23032520        """
    2304         EXAMPLE::
     2521        EXAMPLES::
    23052522
    23062523            sage: A3=WeylCharacterRing("A3")
    23072524            sage: WeightRing(A3).one_basis()
     
    23152532        """
    23162533        Returns the parent Weyl Character Ring.
    23172534
    2318         EXAMPLE::
     2535        EXAMPLES::
    23192536
    23202537            sage: A2=WeylCharacterRing("A2")
    23212538            sage: a2=WeightRing(A2)
     
    23312548        """
    23322549        Returns the parent Weyl Character Ring. A synonym for self.parent().
    23332550
    2334         EXAMPLE::
     2551        EXAMPLES::
    23352552
    23362553            sage: A2=WeylCharacterRing("A2")
    23372554            sage: a2=WeightRing(A2)
     
    24232640
    24242641            sage: G2=WeylCharacterRing("G2")
    24252642            sage: g2=WeightRing(G2)
    2426             sage: [g2(x) for x in g2.fundamental_weights()]
     2643            sage: [g2(x) for x in g2.fundamental_weights()] # indirect doctest
    24272644            [g2(1,0,-1), g2(2,-1,-1)]
    24282645        """
    24292646        return self.wt_repr(t)
     
    24352652        def cartan_type(self):
    24362653            """
    24372654            Returns the Cartan type.
     2655
    24382656            EXAMPLES::
    24392657
    24402658                sage: A2=WeylCharacterRing("A2")