Ask Your Question
0

What is the equivalent of Mathematica SymmetricReduction[] in Sage?

asked 2023-09-10 18:24:53 +0100

toni gravatar image

I'm trying to reproduce the operation in this short segment of a presentation on Galois theory in here and here. The code is:

$$\begin{align}\text{In}:\quad &Δ^2 = (x - y)^2 * (x - z)^2 * (y -z)^2\ &\text{SymmetricReduction}[Δ, {x, y, z}, {s1, s2, s3}]\ \text{Out}: &\quad {s1^2 s2^2 -4 s2^3 -4 s1^3s3+ 18 s1s2s3-27 s3^2, 0} \end{align}$$

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
3

answered 2023-09-10 21:03:02 +0100

Max Alekseyev gravatar image

updated 2023-09-11 04:52:04 +0100

First off, if a given polynomial f is symmetric, then the following conversion

SymmetricFunctions(f.base_ring()).e().from_polynomial(f)

will do the job.

For a non-symmetric polynomial, I think the following function is equivalent to the one in Mathematica:

def sym_reduce(f):
    Sym = SymmetricFunctions(f.base_ring())
    m = Sym.m()
    e = Sym.e()
    v = f.variables()
    s = sum( t[0] * m[d].expand(len(v),v) for t in f if (d:=t[1].degrees())==tuple(sorted(d,reverse=True)) )
    return sum(c*e[d] for d,c in e.from_polynomial(s) if len(d)==0 or d[0]<=len(v)), f-s

For example,

R.<x,y,z> = PolynomialRing(QQ)
sym_reduce((x-y)^2 * (x-z)^2 * (y-z)^2)

gives

(e[2, 2, 1, 1] - 4*e[2, 2, 2] - 4*e[3, 1, 1, 1] + 18*e[3, 2, 1] - 27*e[3, 3], 
 0)

PS. Note that the result depends on the variables order when given polynomial f is not symmetric.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2023-09-10 18:24:53 +0100

Seen: 183 times

Last updated: Sep 11 '23