Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Exploiting relationships in manipulations: example with conjugate relationship

  • To: undisclosed-recipients:;
  • Subject: [mg131345] Re: Exploiting relationships in manipulations: example with conjugate relationship
  • From: Sune Jespersen <sunenj at gmail.com>
  • Date: Sat, 29 Jun 2013 04:59:31 -0400 (EDT)
  • Approved: Steven M. Christensen <steve@smc.vnet.net>, Moderator
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net
  • Newsgroups: comp.soft-sys.math.mathematica
  • References: <20130628081233.8C1D769C6@smc.vnet.net> <CAEtRDSezcQXsrmSzzWO1yp-CPjGSeNncd9cfF6soHb3GYQvXBQ@mail.gmail.com> <27116387-3C9B-4571-AD34-9DD6B5C6042E@gmail.com> <CAEtRDSd4VJ1Qn-CSf_dkdFJ3MtORnUMpL-bSRPO=4SNcys5+eg@mail.gmail.com>

Not quite. This is what I wanted

ComplexExpand[
 FullSimplify[
  tel /. (Cases[tel,
      ff[l_][m_?Negative] :> (ff[l][m] -> Conjugate[ff[l][-m]] (-1)^m),
      Infinity] // Union)], ff[_][m_ /; UnsameQ[m, 0]]]

{2/3 Sqrt[=CF=80] ff[0][0] + 4/3 Sqrt[=CF=80/5] ff[2][0],
 2 Sqrt[(2 =CF=80)/15] Im[ff[2][1]], -2 Sqrt[(2 =CF=80)/15] Re[ff[2][2]] +
  2/3 Sqrt[=CF=80] ff[0][0] - 2/3 Sqrt[=CF=80/5] ff[2][0], -2 Sqrt[(2 =CF=80)/15]
   Re[ff[2][1]], -2 Sqrt[(2 =CF=80)/15] Im[ff[2][2]],
 2 Sqrt[(2 =CF=80)/15] Re[ff[2][2]] + 2/3 Sqrt[=CF=80] ff[0][0] -
  2/3 Sqrt[=CF=80/5] ff[2][0]}


Thanks for pointing me in the right direction. Isn't there a more general way of getting Mathematica to take advantage of relations as these?
Sune


On 28 Jun, 2013, at 21:21 , Bob Hanlon <hanlonr357 at gmail.com> wrote:

> tel = {2/15 Sqrt[=CF=80] (5 ff[0][0] + 2 Sqrt[5] ff[2][0]),
>    -I Sqrt[(2 =CF=80)/15] (ff[2][-1] + ff[2][1]),
>    1/15 Sqrt[=CF=80] (10 ff[0][0] - Sqrt[5]*
>        (Sqrt[6] ff[2][-2] + 2 ff[2][0] + Sqrt[6] ff[2][2])),
>    Sqrt[(2 =CF=80)/15] (ff[2][-1] - ff[2][1]),
>    -I Sqrt[(2 =CF=80)/15] (ff[2][-2] - ff[2][2]),
>    1/15 Sqrt[=CF=80] (10 ff[0][0] + Sqrt[5]*
>        (Sqrt[6] ff[2][-2] - 2 ff[2][0] + Sqrt[6] ff[2][2]))};
>
> FullSimplify[tel /. Cases[tel,
>      ff[l_][m_?Negative] :>
>       (ff[l][m] :> Conjugate[ff[l][-m]]*(-1)^m),
>      Infinity] // Union] /. (Re[x_] - x_) :> -Im[x]
>
> {(2/15)*Sqrt[Pi]*(5*ff[0][0] +
>         2*Sqrt[5]*ff[2][0]),
>    -2*Sqrt[(2*Pi)/15]*Re[ff[2][1]],
>    -2*I*Sqrt[(2*Pi)/15]*Im[ff[2][1]],
>    2*I*Sqrt[(2*Pi)/15]*Im[ff[2][2]],
>    (2/15)*Sqrt[Pi]*
>      (Sqrt[30]*Re[ff[2][2]] +
>         5*ff[0][0] - Sqrt[5]*ff[2][0]),
>    (-(2/15))*Sqrt[Pi]*
>      (Sqrt[30]*Re[ff[2][2]] -
>         5*ff[0][0] + Sqrt[5]*ff[2][0])}
>
>
> Bob Hanlon
>
>
>
> On Fri, Jun 28, 2013 at 1:30 PM, Sune Jespersen <sunenj at gmail.com> wrote:
> Thanks. I meant  ff[l][m] == Conjugate[ff[l][-m]]*(-1)^m). It seems your solution in this case produces an output fully identical (unchanged) to tel.
> For example, I wanted the 2nd element of tel
> I Sqrt[(2 =CF=80)/15] (ff[2][-1] + ff[2][1])
> to become
> -2 Sqrt[(2 =CF=80)/15] Im(ff[2][1]).
>
> Sune
>
> On 28 Jun, 2013, at 17:42 , Bob Hanlon <hanlonr357 at gmail.com> wrote:
>
>> tel = {2/15 Sqrt[
>>      =CF=80] (5 ff[0][0] + 2 Sqrt[5] ff[2][0]), -I Sqrt[(2 =CF=80)/15] (ff[2][-1] +
>>       ff[2][1]),
>>    1/15 Sqrt[
>>      =CF=80] (10 ff[0][0] -
>>       Sqrt[5] (Sqrt[6] ff[2][-2] + 2 ff[2][0] + Sqrt[6] ff[2][2])),
>>    Sqrt[(2 =CF=80)/15] (ff[2][-1] - ff[2][1]), -I Sqrt[(2 =CF=80)/15] (ff[2][-2] -
>>       ff[2][2]),
>>    1/15 Sqrt[
>>      =CF=80] (10 ff[0][0] +
>>       Sqrt[5] (Sqrt[6] ff[2][-2] - 2 ff[2][0] + Sqrt[6] ff[2][2]))};
>>
>> In your text you state ff[l][m] == ff[l][-m] (-1)^m
>>
>> Simplify[tel,
>>  Union[Cases[tel, ff[_][_], Infinity]] /.
>>   ff[l_][m_] -> (ff[l][m] == ff[l][-m] (-1)^m)]
>>
>> {(2/15)*Sqrt[Pi]*(5*ff[0][0] +
>>         2*Sqrt[5]*ff[2][0]), 0, (2/15)*Sqrt[Pi]*
>>      (5*ff[0][0] - Sqrt[5]*(ff[2][0] +
>>              Sqrt[6]*ff[2][2])), -2*Sqrt[(2*Pi)/15]*
>>      ff[2][1], 0, (2/15)*Sqrt[Pi]*
>>      (5*ff[0][0] - Sqrt[5]*ff[2][0] +
>>         Sqrt[30]*ff[2][2])}
>>
>> However, in your code you use ff[l][m] == Conjugate[ff[l][-m]]*(-1)^m)
>>
>> Simplify[tel,
>>  Union[Cases[tel, ff[_][_], Infinity]] /.
>>   ff[l_][m_] -> (ff[l][m] == Conjugate[ff[l][-m]]*(-1)^m)]
>>
>> {(2/15)*Sqrt[Pi]*(5*ff[0][0] +
>>         2*Sqrt[5]*ff[2][0]), (-I)*Sqrt[(2*Pi)/15]*
>>      (ff[2][-1] + ff[2][1]), (1/15)*Sqrt[Pi]*
>>      (10*ff[0][0] - Sqrt[5]*(Sqrt[6]*ff[2][-2] +
>>              2*ff[2][0] + Sqrt[6]*ff[2][2])),
>>    Sqrt[(2*Pi)/15]*(ff[2][-1] - ff[2][1]),
>>    (-I)*Sqrt[(2*Pi)/15]*(ff[2][-2] - ff[2][2]),
>>    (1/15)*Sqrt[Pi]*(10*ff[0][0] +
>>         Sqrt[5]*(Sqrt[6]*ff[2][-2] - 2*ff[2][0] +
>>              Sqrt[6]*ff[2][2]))}
>>
>> % === tel
>>
>> True
>>
>>
>> Bob Hanlon
>>
>>
>>
>> On Fri, Jun 28, 2013 at 4:12 AM, Sune <sunenj at gmail.com> wrote:
>> Hey all.
>>
>> I'm trying to get Mathematica to simplify a list of expressions involving complex symbolic variables with certain relations among them, and to take advantage of these relations while simplifying.
>>
>> To be more concrete, I could have a list such as
>>
>> tel={2/15 Sqrt[\[Pi]] (5 ff[0][0]+2 Sqrt[5] ff[2][0]),-I Sqrt[(2 \[Pi])/15] (ff[2][-1]+ff[2][1]),1/15 Sqrt[\[Pi]] (10 ff[0][0]-Sqrt[5] (Sqrt[6] ff[2][-2]+2 ff[2][0]+Sqrt[6] ff[2][2])),Sqrt[(2 \[Pi])/15] (ff[2][-1]-ff[2][1]),-I Sqrt[(2 \[Pi])/15] (ff[2][-2]-ff[2][2]),1/15 Sqrt[\[Pi]] (10 ff[0][0]+Sqrt[5] (Sqrt[6] ff[2][-2]-2 ff[2][0]+Sqrt[6] ff[2][2]))}
>>
>> However, there's a conjugate symmetry among the variables ff[l][m] that would enable a simpler looking expression. Specifically, ff[l][m]=ff[l][-m] (-1)^m, and I would like to have Mathematica take advantage of that and reduce expressions such as
>>
>> I Sqrt[(2 \[Pi])/15] (ff[2][-1]+ff[2][1])
>>
>> to
>>
>> -Sqrt[(2 \[Pi])/15] 2*Im(ff[2][1])
>>
>>
>> I've tried various combinations of ComplexExpand and FullSimplify;
>>
>> ComplexExpand[
>>  FullSimplify[tel,
>>   And @@ Flatten[
>>     Table[ff[l][m] == Conjugate[ff[l][-m]]*(-1)^m, {l, 0, 4, 2}, {m,
>>       0, l}]]], Flatten[Table[ff[l][m] , {l, 2, 4, 2}, {m, -l, l}]]]
>>
>> (And also version with the two outermost commands interchanged)
>>  but it doesn't do what I want. Of course, it may be that the rules for simplify are such that my sought expression is not considered a simpler version of the same expression. Could that be the case? Otherwise, I'd appreciate any suggestions on how to implement relations such as these in manipulation of expressions.
>>
>> Thanks,
>> Sune
>>
>>
>
>


  • Prev by Date: Text alignment within a cell
  • Next by Date: Re: Create Modelica Models within Mathematica
  • Previous by thread: Re: Exploiting relationships in manipulations: example
  • Next by thread: Re: malliavin calculus