On Wed, Aug 26, 2009 at 8:42 PM, kenji<[email protected]> wrote:
>
> Hi all,
>
> I want to expand and reduce Lagrange Resolvent in Galois theory under a 
> restriction.
>
> The below equation is expanding and reducing operations in Maxima.
>
>    (C1) L1(w, x0,x1,x2):= x0 + w*x1 + w^2*x2;
>    (C2) expand(ratsubst(0,1+w+w^2,  L1(w, x0,x1,x2)^3) );
>
>            3            2          2            2         2
>    (D2) x2  - 3 w x1 x2  - 3 x1 x2  + 3 w x0 x2  + 3 w x1  x2 + 6 x0 x1 x2
>
>                2          2        3            2          2         2        
> 3
>        - 3 w x0  x2 - 3 x0  x2 + x1  - 3 w x0 x1  - 3 x0 x1  + 3 w x0  x1 + x0
>
>
> I want to manipulate this operations in sympy. I tried fraction, collect match
> and others, but can't manipulate them
>
> Does sympy manipulate this expanding and reducing operations under a 
> restriction ?

I think we can't --- do you know the algorithm for it? E.g. I just
take an expression:

In [1]: L1 = S("x0 + w*x1 + w^2*x2")

In [2]: L1
Out[2]:
                2
x₀ + w⋅x₁ + x₂⋅w

cube it, expand it:

In [3]: (L1**3).expand()
Out[3]:
         2         2   2         4   2         5   2         2   2         4
3⋅w⋅x₁⋅x₀  + 3⋅x₀⋅w ⋅x₁  + 3⋅x₀⋅w ⋅x₂  + 3⋅x₁⋅w ⋅x₂  + 3⋅x₂⋅w ⋅x₀  + 3⋅x₂⋅w ⋅x

 2     3    3   3    6   3               3
₁  + x₀  + w ⋅x₁  + w ⋅x₂  + 6⋅x₀⋅x₁⋅x₂⋅w


and then I should somehow substitute 1+w+w^2 for 0, right? E.g.
something like this, except that it doesn't work:

In [3]: e = (L1**3).expand()

In [6]: w = S("w")

In [11]: e.subs(1+w+w**2, 0)
Out[11]:
         2         2   2         4   2         5   2         2   2         4
3⋅w⋅x₁⋅x₀  + 3⋅x₀⋅w ⋅x₁  + 3⋅x₀⋅w ⋅x₂  + 3⋅x₁⋅w ⋅x₂  + 3⋅x₂⋅w ⋅x₀  + 3⋅x₂⋅w ⋅x

 2     3    3   3    6   3               3
₁  + x₀  + w ⋅x₁  + w ⋅x₂  + 6⋅x₀⋅x₁⋅x₂⋅w


If you know some algorithm for it, maybe it's not difficult to implement this.

Ondrej

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/sympy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to