In my ten years as an laser physicist, I’ve had to code a plethora of experimental and theoretical programs. I need a variety of tools: live image acquisition, PC-scale number crunching, reasonably advanced GUIs, publication quality plots. To maximise learning investment, I wanted a single language environment. After some serious attempts with LabVIEW and C/C++, I settled upon MATLAB as the best compromise.

For a bunch of reasons I’m now testing out Python. As a first attempt I starting porting a code for calculating high-harmonic spectra from complex molecules (>12 atoms, complex for a physicist) as part of an ongoing analysis of some recent experiments. In principle, the calculation itself isn’t too demanding – it is manageable on a powerful desktop. The challenges are:

  1. Translating my MATLAB vectorization paradigms, which revolve around the wonderful bsxfun command, into Python’s de facto standard for numerics, Numpy.

  2. Reproducing my plots, which involve a mixture of 2D and 3D and can get reasonably complicated:

In the next post I’ll discuss some of this.