Re: Performance improvement needed - Help.
- To: mathgroup at smc.vnet.net
- Subject: [mg63594] Re: Performance improvement needed - Help.
- From: Paul Abbott <paul at physics.uwa.edu.au>
- Date: Fri, 6 Jan 2006 05:24:43 -0500 (EST)
- Organization: The University of Western Australia
- References: <dpiotv$l11$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
In article <dpiotv$l11$1 at smc.vnet.net>, "Tonybony" <aneves at gmail.com> wrote: > I am trying to improve the performance of a bottle neck operation. I've > used functional programming and read about Packed Arrays. My current > operation is: > > Efunc[k_, x_, y_, z_] := Radialf[k, VNmax, x, y,z].Map[(MMatrix[[# - > Nmin + 1]].SphericalHarmonicY[#, Range[-#, #],Theta[x, y, z], Phi[x, > y]]) &, VNmax, {1}]; > > EMatrix= Apply[Efunc[k, #1, #2, 0.0] &, Grid, {2}]; It looks like you are computing some atomic or molecular integral via quadrature (or maybe just a simple sum) on a discrete cartesian grid? > Where I defined, > GridX = Range[Xini, Xfin, Xinc]; > Grid = Outer[List, GridX, GridX]; > VNmax = Range[Nmin, Nmax]; > GridG = Table[{n, m}, {n, Nmin, Nmax}, {m, -n, n}]; > Radial[k_, n_, x_, y_, z_] := BesselJ[n,k Sqrt[x^2+y^2+z^2]]; > MMatrix= Apply[(Exp[-#2 fio] MAmpl[[#1 - Nmin + 1, Abs[#2] + 1]] > MI1[[#1 - Nmin + 1, Abs[#2] + 1]] Cosfio) &, GridG, {2}]; > > I have tried the command, > GridG = Developer`ToPackedArray[Table[{n, m}, {n, Nmin, Nmax}, {m, -n, > n}]]; > To see if I could build a packed array so that I could better > performance, but didn't succeed. Maybe I am creating a wrong array, but > I don't know of any alternative. > > For each element of GridG I have a pair of point (x,y) that I pass > along a set of function for calculations. Is their an efficient way of > doing this? Do you have a reference for the integrals that you are trying to compute. There are many ways to speed up the computation of integrals over hydrogenic orbitals. Cheers, Paul _______________________________________________________________________ Paul Abbott Phone: 61 8 6488 2734 School of Physics, M013 Fax: +61 8 6488 1014 The University of Western Australia (CRICOS Provider No 00126G) AUSTRALIA http://physics.uwa.edu.au/~paul