merci pour la reponse :) more below, inline. > .... > Things are different if you are fine working with fully expanded > expressions. for all that's worth, that won't do for what i am trying. the point is to have the generality of alphabets.
> .... > > Is there any better way to do this? > > An alternative way is to work over the tensor product of two copies of > the ring of symmetric functions: > > sage: S = SymmetricFunctions(QQ) > sage: s= S.s() > > sage: tensor([s, s]) > Symmetric Function Algebra over Rational Field, Schur symmetric functions > as basis # Symmetric Function Algebra over Rational Field, Schur symmetric > functions as basis > > sage: x = tensor((s[1], s[2,1])) + 2* tensor((s[2,1], s[3])) > sage: x > s[[1]] # s[[2, 1]] + 2*s[[2, 1]] # s[[3]] > > sage: x * x > s[[1, 1]] # s[[2, 2, 1, 1]] + ... > > Now, is this better? > > - From an efficiency point of view, this should be similar, unless > the manipulated symmetric functions have some specific structure; > the only difference is how the coefficients are collected together. > > + It is more symmetric There is some structure for my computation (matching degrees of the polynomials over the two alphabets, which I was hoping to exploit with the PowerSeriesRing idea). In any case, it's more symmetric and gives a better presentation, so I am happier with this. There are bugs however, as this will demonstrate: S = SymmetricFunctions(QQ) s = S.s() p = S.p() ss = tensor([s,s]) pp = tensor([p,p]) a = tensor((s[5],s[5])) pp(a) The answer given, p[[5]] # p[[5]] is not correct (but once sage has what it thinks is pp(a), it s a proper element of pp(a) and it does the computations with it well) > .... > There are (at least) two bugs here: > > (1) sB is not in CommutativeRings() > > I'll fix this right now. > > (2) PowerSeriesRing should use > > base_ring in CommutativeRings() > > rather than > > isinstance(base_ring, commutative_ring.CommutativeRing): > > Would you be fine writing and handling a patch for this? OK Paul On Sep 2, 4:03 pm, "Nicolas M. Thiery" <nicolas.thi...@u-psud.fr> wrote: > Salut! > > On Tue, Sep 01, 2009 at 09:41:11AM -0700, Paul-Olivier Dehaye wrote: > > I am trying to do computations with symmetric functions over different > > alphabets. > > > This seems to have been part of the SFA package, itself part of the mu- > > EC package, itself considered a deprecated part of the MuPAD-combinat > > package... > > (seehttp://mupad-combinat.sourceforge.net/doc/en/index/referenceManual.html > > ). Is it still in Sage via this chain? > > Good job tracing that back :-) > > But no, this feature did not survive the migration. The main thing is > that we haven't yet a good idea of what the design should be. In most > applications, users will want to manipulate unexpanded symbolic > expressions involving a mix of functions from several alphabets. And > we plainly don't have good experience in symbolic computations! > > Things are different if you are fine working with fully expanded > expressions. > > > Sage currently has a roundabout way to do this, but it's not so > > pretty, requires all kinds of coercions and is probably slower than it > > needs to be: > > > sA = SFASchur(QQ) > > sB = SFASchur(sA) > > > x = sum(sB(1/i)*sB(sA([i]))*sB([i]) for i in (1..5)) > > > pA = SFAPower(QQ) > > pB = SFAPower(pA) > > > pB(x) > > > Is there any better way to do this? > > An alternative way is to work over the tensor product of two copies of > the ring of symmetric functions: > > sage: S = SymmetricFunctions(QQ) > sage: s= S.s() > > sage: tensor([s, s]) > Symmetric Function Algebra over Rational Field, Schur symmetric functions > as basis # Symmetric Function Algebra over Rational Field, Schur symmetric > functions as basis > > sage: x = tensor((s[1], s[2,1])) + 2* tensor((s[2,1], s[3])) > sage: x > s[[1]] # s[[2, 1]] + 2*s[[2, 1]] # s[[3]] > > sage: x * x > s[[1, 1]] # s[[2, 2, 1, 1]] + ... > > Now, is this better? > > - From an efficiency point of view, this should be similar, unless > the manipulated symmetric functions have some specific structure; > the only difference is how the coefficients are collected together. > > + It is more symmetric > > + accessing coefficients should be easier when there are lots of > alphabets (n-fold tensor product). The support for tensor products > in Sage is still limited though. In the longer run, there will be > support for mixed coercions (say you want the result to be > expressed as powersums in the first alphabet and elementary > symmetric functions in the second alphabet), as in MuPAD-Combinat. > > - This requires the sage-combinat patches ... > > > In addition, I really want to do my computations in a power series > > ring over the commutative ring of (Schur, whatever) symmetric > > functions in 2 alphabets. The extra variable t would let me keep track > > of the weight of the degrees of the polynomials involved, since for > > each term of my computation the degrees are the same in the two > > alphabets. So I tried something like this: > > > T.<t> = PowerSeriesRing(sB,default_prec=5) > > but Sage (4.1.combinat and 4.1.1 on the server) complains: > > TypeError: base_ring must be a commutative ring > > > Is there a way to circumvent that? Any help greatly appreciated! > > There are (at least) two bugs here: > > (1) sB is not in CommutativeRings() > > I'll fix this right now. > > (2) PowerSeriesRing should use > > base_ring in CommutativeRings() > > rather than > > isinstance(base_ring, commutative_ring.CommutativeRing): > > Would you be fine writing and handling a patch for this? > > I guess that's all. > > > PS: It might also be good to edit > >http://wiki.sagemath.org/combinat/Installation > > since this is a natural place you end up at when you want to install > > combinat, and it s confusing with that title... > > Thanks for the notice. I commented out the temporary stuff for the > *-Combinat meeting. Volunteers to further improve this sensitive page > are most welcome! > > Cheers, > Nicolas > -- > Nicolas M. Thiéry "Isil" <nthi...@users.sf.net>http://Nicolas.Thiery.name/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sage-combinat-devel" group. To post to this group, send email to sage-combinat-devel@googlegroups.com To unsubscribe from this group, send email to sage-combinat-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-combinat-devel?hl=en -~----------~----~----~----~------~----~------~--~---