Ask Your Question

natepower's profile - activity

2023-12-03 20:31:01 +0200 received badge  Famous Question (source)
2021-04-06 08:08:11 +0200 received badge  Famous Question (source)
2020-05-09 11:18:29 +0200 received badge  Notable Question (source)
2018-06-19 03:19:21 +0200 received badge  Popular Question (source)
2016-10-01 16:52:13 +0200 received badge  Nice Question (source)
2016-02-10 21:22:44 +0200 received badge  Notable Question (source)
2015-08-03 22:57:14 +0200 received badge  Popular Question (source)
2015-05-25 23:04:55 +0200 received badge  Supporter (source)
2015-05-25 23:04:46 +0200 commented answer elementary symmetric functions

Well I have a huge rational expression of polynomials, p = N/D each term in variables r11,r12,r21,r22,z1,z2,Q and if I put it in terms of symmetric functions, such as r11+r21 = e1 = fn(Q,z1,b1),`r12+r22 = f1 = fn(Q,z2,b2), then I can greatly simplify p. Further reduction occurs with these symmetry relations, r11*r21 = e2 = B1 and r12*r22 = f2 =B2. I then take the resulting p and exchange z's for A's with z1^2=A1 and z2^2=A2. This results in a polynomial in only A1,A2,B1,B2,Q and is much simpler, as I've done this in Maxima. Further processing involves parameterization, etc. Hope that's clearly explained...

2015-05-25 21:56:44 +0200 received badge  Student (source)
2015-05-25 21:08:50 +0200 commented answer elementary symmetric functions

Hi, I need >15 pts to upvote - so it says... Thanks for all the help but I guess I'll have to rely on Maxima. The math aspect makes sense, and tensor algebra isn't an issue, but I fail in being able to work with Sage. It will be interesting to learn the differences between the Sage and Maxima! Maybe I'll figure out some alternative in Sage later. Thanks!

2015-05-25 20:23:02 +0200 commented answer elementary symmetric functions

Hello, and thank you again!!

Can you modify your answer;

-use the elementary basis, exy=Sym.elementary(); exy._prefix='exy' and eab=Sym2.elementary(); eab._prefix='eab'?

-provide a way to distinguish between the two spaces in the tensor product? What I mean is, for my real equation c1+c2+...+(x*y)+(x+y)+(a+b)+... + (a*b*x*y) == c1 + c2 + ... + exy[2] + exy[1] + eab[1] + ... + exy[2]*eab[2] == c1 + c2 + ... + exy2 + exy1 + eab1 + ... exy2*eab2, with the result not indexed and c1, c2, etc are constants? By the way, your result (to me) is understood as 1 \otimes e1 + f1 \otimes 1, but I would need it as e1 + f1.

I've tried modifying your answer but had no luck at all. Your answers so far really point out important differences between Sage and Maxima.

Thanks so much!

2015-05-23 06:26:52 +0200 asked a question elementary symmetric functions

Hi, this is a continuation (though self-contained) on a previous question I luckily received an answer for;

http://ask.sagemath.org/question/2691...

For those of you experts that know Maxima, I essentially want to do the following (to a polynomial);

elem([2,f1,f2],elem([2,e1,e2],x+y+a+b,[x,y]),[a,b])

which results in: (x+y)+(a+b) = e1 + f1, where Sage would (which is what I'm trying to do) return e[1] + f[1].

This is what I tried (among others), mostly from the above referenced link;

P.<x,y>=PolynomialRing(QQ['a','b'])
[a,b]=P.base_ring().gens()
S=SymmetricFunctions(P.base_ring())
exy=S.elementary()
f=x+y+a+b
exy._prefix='exy'
o=exy(S.from_polynomial(f))
P2.<a,b>=PolynomialRing(QQ['x','y'])
[x,y]=P2.base_ring().gens()
S2.SymmetricFunctions(P2.base_ring())
eab=S2.elementary()
eab._prefix='eab'
oo=eab(S2.from_polynomial(o)); oo

I was hoping to see: eab[1]+exy[1], but here an error is thrown saying that the polynomial is not symmetric. I've tried also (trying) to establish a base ring QQ['x','y','a','b'] and then subrings but that also doesn't seem to work for me.

I think Sage is great and I'm sure there's something equivalent to the very simple task done in Maxima. For instance, this

maxima.eval('elem:2')
oo=maxima.eval('elem([2,f1,f2],elem([2,e1,e2],x+y+a+b,[x,y]),[a,b])')

does return the proper answer, e1+f1, but I cannot use this result because I need to process it further with Sage and have not found a way to translate this Maxima type of object to a Sage polynomial - especially since the parsing seems to bring up errors for larger equations and my real equations are extremely large.

Thanks all, again!

2015-05-22 21:23:40 +0200 received badge  Scholar (source)
2015-05-22 21:08:24 +0200 commented answer S.from_polynomial(f) -- convert a polynomial to symmetric functions BUT with a parameter

Thanks! I've got what you've done, including other bases. This is exactly what I asked for!

Now I will try to get it to work for two pairs of symmetric variables, e.g., x&y AND a&b. I'll try defining another base ring, though I feel I'll need to also redefine the returned 'functions', e.g. m[] or m[1] with another letter.... like n[] and n[1]... I think exy=S.elementary(); exy._prefix='exy' etc. I'll try this today, and hopefully I won't have to ask again - unless it is on the tip of your tongue already ;)

2015-05-22 02:38:23 +0200 asked a question S.from_polynomial(f) -- convert a polynomial to symmetric functions BUT with a parameter

I thought I'd ask a variation of an earlier question that was unanswered.

I use:

P.<x,y>=PolynomialRing(QQ)
S=SymmetricFunctions(QQ) 
S.inject_shorthands()
f=x+y
e(S.from_polynomial(f))

resulting in e[1] (or x+y)

So that works, but when I try to do that for a polynomial with parameters, say

f=x+y+a+b

it complains that a and b are not defined. If I add them to the ring I get e[1], but I suspect this is equivalent now to x+y+a+b (I didn't check because it should be e[1]+a+b).

Do I need to keep the ring defined the same but define maybe S as;

S = SymmetricFunctions(QQ[x,y]) ?

This causes the error claiming that the function is not a symmetric polynomial.

By the way, I know I could use something like,

a=maxima.eval('elem([2,e1,e2],(x+y+a+b)/2,[x,y])')

to get e1/2 + (a+b)/2, but I then can't use eval or sage_evalon the result because there are parsing errors for larger equations, e.g. python complains about the use of '^' instead of '**' for exponentiation, etc. My other posted question, http://ask.sagemath.org/question/2672..., is in direct relation to this phenomena.

2015-05-09 02:17:18 +0200 received badge  Notable Question (source)
2015-05-07 01:04:03 +0200 received badge  Popular Question (source)
2015-05-05 21:57:33 +0200 asked a question successive calls to maxima

I have found, and have read, a bit on calling Maxima from Sage but I have only seen simple one-time calls like

maxima.eval('4*x');

What I want to do is this (which is a *.sage file I call from the terminal using ./sage file.sage).

print("In Sage input file");
d = maxima.eval('halt (r,s,zeta,rho) := (1-Q*rho^r)-zeta*rho^s*(1-rho^r)');
d2 = maxima.eval('elem([2,e12,e22],elem([2,e11,e21],halt(2,1,zeta1,rho11)+diff(halt(2,1,zeta2,rho12),rho12)+halt(2,1,zeta2,rho22),[rho11,rho21]),[rho12,rho22])');
print d2;
d3 = maxima.eval('subst(R,e11,d2');
print d3;

But `print d3' just gives me 'd2'.... I'm sure this is very very simple but I haven't found it yet.

Thanks!

2015-04-27 07:07:55 +0200 received badge  Editor (source)
2015-04-27 00:43:10 +0200 asked a question symmetric functions but with multiple symmetries

So I came across this question,

http://ask.sagemath.org/question/7761... ,

and followed it to google.code,

https://groups.google.com/forum/#!top... ,

and see that it seems to be finished,

http://trac.sagemath.org/ticket/10630, manifesting as,

http://www.sagemath.org/doc/reference... .

I'm not even sure this is relevant to my question, which I'll pose now (a simplified version).

I was able to get this to work,

P=PolynomialRing(QQ,'x',2); P;
x=P.gens()
fx=x[0]+x[1]; show(fx)
S=SymmetricFunctions(QQ)
S.inject_shorthands()
g=S.from_polynomial(fx); show(g)
show(e(g))

which is pretty much an example from here,

http://www.sagemath.org/doc/reference... .

What I would like to do is do the same thing for an expression involving two separate symmetries, for a symmetric polynomial. I mean,

f=x[0]+x[1] + y[0]+y[1], where x[0]<->x[1] and y[0]<->y[1] leave the function invariant. But not x[i]<->y[j]. This could produce something like: e_x[1] + e_y[1] (the 'x' and 'y' signifying that they are with respect to each symmetry).

I thought maybe some of the documentation regarding the macdonald basis was what I was thinking but I can't figure it out yet, nor am sure it would work for me:

http://www.sagemath.org/doc/reference...

I should say I have only played with sage for a couple weeks...

UPDATE

I was able to 'nest' the following procedures using;

print maxima.eval('elem ([3,E1uv,E2uv,E3uv],elem ([2,E1xy,E2xy],(x*y) + (x+y) + (u*v*w),[x,y]), [u,v,w]);')

The E1xy and E2xy are the first and second elementary symmetric functions with respect to symmetric variables x and y. Ditto for E1uv and E2uv. This is just what I wanted, and even lets you dictate the value of the elementary symmetric functions. Here the Maxima method is equivalent to what I had found for Sage already:

print maxima.eval('elem ([2], x*y+x+y, [x, y])')
out: e2+2 e1
print maxima.eval('elem ([2,a], x*y+x+y, [x, y])')
out: e2+2 a
print maxima.eval('elem ([2,a,b], x*y+x+y, [x, y])')
out: b+2 a

A smoother way of doing what I wanted turned out to be this:

print maxima.eval('multi_elem ([[2,e1,e2],[2,f1,f2]],x+y+u+v,[[x,y],[u,v]])')

though I cannot see why this last line returns 2s as coefficients... I guess my question has evolved (unless someone has some advice on it) into a question of why these 2s are on the first elementary function of each pair, which should just be e1:=x+y and f1:=u+v...?

2*f1+2*e1

UPDATE 2

I still have my main question - expressing (lengthy) symmetric expressions in terms of elementary symmetric functions, though I am almost done figuring it out. All that remains is a ... (more)