Re: Determinant
- To: mathgroup@smc.vnet.net
- Subject: [mg12376] Re: Determinant
- From: Daniel Lichtblau <danl@wolfram.com>
- Date: Sun, 10 May 1998 02:04:58 -0400
- Organization: Wolfram Research, Inc.
- References: <6imilk$h1c@smc.vnet.net>
Arturas Acus wrote: > > Recently I observed a bit strange behaviour when calculating > determinant of large symbolic matrix. With the usual command > Det[symbolicmatrix] I was unable to get the result. After I wrapped > each element with Hold, the Det was calculated in fraction of second. > So, I am interesting what is going. Do Det checks something? Actual > example I attach bellow. > > Arturas Acus > Institute of Theoretical > Physics and Astronomy > Gostauto 12, 2600,Vilnius > Lithuania > > E-mail: acus@itpa.lt > Fax: 370-2-225361 > Tel: 370-2-612906 > The input: fullGM = {{(Pi*(40*dF^2*r^2*Sin[F]^2 + 160*e2*fpi2*r^2*Sin[F]^2 + 24*dF^2*r^2*Cos[q0]*Sin[F]^2 + 96*e2*fpi2*r^2*Cos[q0]*Sin[F]^2 + 40*Sin[F]^4 + 24*Cos[q0]*Sin[F]^4 + 3*dF^2*r^2*Sin[q0]^2 + 48*e2*fpi2*r^2*Sin[q0]^2- 3*dF^2*r^2*Cos[F]*Sin[q0]^2 - 48*e2*fpi2*r^2*Cos[F]*Sin[q0]^2 + 6*Sin[F]^2*Sin[q0]^2 -4*dF^2*r^2*Sin[F]^2*Sin[q0]^2 - 16*e2*fpi2*r^2*Sin[F]^2*Sin[q0]^2 - 6*Cos[F]*Sin[F]^2*Sin[q0]^2 - 4*Sin[F]^4*Sin[q0]^2 + 6*dF^2*r^2*Sin[q2]^2 + 96*e2*fpi2*r^2*Sin[q2]^2- 6*dF^2*r^2*Cos[F]*Sin[q2]^2 - 96*e2*fpi2*r^2*Cos[F]*Sin[q2]^2 - 6*dF^2*r^2*Cos[q0]*Sin[q2]^2 - 96*e2*fpi2*r^2*Cos[q0]*Sin[q2]^2 + 6*dF^2*r^2*Cos[F]*Cos[q0]*Sin[q2]^2 + 96*e2*fpi2*r^2*Cos[F]*Cos[q0]*S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q0/2]*Sin[F]^2*(dF^2*r^2 + 4*e2*fpi2*r^2 + Sin[F]^2)* (Cos[qp1]*Sin[q3] +Cos[q3]*Sin[qp1])*Sin[qp2])/(3*e2*r^2), (Pi*(3 + Cos[q0])*Cos[qp2]* Sin[F]^2*(dF^2*r^2 + 4*e2*fpi2*r^2 + Sin[F]^2))/(3*e2*r^2), 0, (4*Pi*Cos[qp2]*Sin[F]^2*(dF^2*r^2 + 4*e2*fpi2*r^2 + Sin[F]^2))/(3*e2*r^2), 0, (4*Pi*Sin[F]^2*(dF^2*r^2 + 4*e2*fpi2*r^2 +Sin[F]^2))/(3*e2*r^2)}}; I tracked this to an Expand call inside symbolic Det. To work around this one can do Unprotect[Expand]; Expand[a_,___] := a In[2]:= Timing[dd = Det[fullGM];] Out[2]= {0.06 Second, Null} In[3]:= LeafCount[dd] Out[3]= 19356 Possibly we should remove, sometimes suppress, or otherwise alter this intermediate expansion. I'll give this some thought. Thanks for the example. Daniel Lichtblau Wolfram Research