Question about scientific calculations in Python
Martin Kaufmann
martinkaufmann at yahoo.com
Tue Mar 12 07:22:18 EST 2002
Hello Newsgroup
I'm trying to write a program to calculate diffraction patterns for
electron diffraction on clusters (100-10'000 atoms). So far I used
Python only for CGI programming and system tools (on a rather low
level...). Therefore I don't know whether it's reasonable to program
such a project in Python (I really like the language). Presently my
man concern is speed as the main function of the program is a nested
loop, the inner over several 1000 bins of a histogram and the outer
over several 1000 values of scattering factors. In the end I should be
able to simulate diffraction patterns and compare them to the
experimental data (i.e. run this function several times).
Now my questions: Would it be best to
(a) write the whole program in C/C++ (I know only the basics of C but
it would be a good "excuse" to learn it...)?
(b) write the main program in Python but the heavy calculations in C
(I played today with scipy.weave -- the speed is much better but I
didn't really understand what I was doing...)?
(c) program it in Python and don't care about speed (or buy a new
workstation...)?
Are there any libraries or other resources that would help? I used the
Scientific Python library for the histogram but it was much slower
than my DIY approach.
I hope my questions are not too much OT.
Thanks a lot for your help.
Martin
More information about the Python-list
mailing list