-
Notifications
You must be signed in to change notification settings - Fork 0
Implementation
In these pages, I discuss the details of the implementation.
The software is almost entirely written in Python, using mostly the standard modules numpy and scipy. However, few pieces have also pure C implementations, for the inner heavy computational routines. These may speed up the calculation by roughly one order of magnitude. Note that there is always a Python implementation available, which is 100% compatible. See C interface for details. The list of standard Python modules used is:
- math
- numpy
- scipy.integrate
- scipy.sparse
- scipy.special
- os
- sys
- copy
- time
- timeit
- getpass
- argparse
- configparser
All these modules are very standard, available on any reasonnable installation of Python. I recommend to use anaconda.
In addition, some less standard modules can be used. They should all be optional, but this is not fully implemented yet. These are:
-
numba This speeds up very significantly pure Python code using Numpy or Scipy. Very easy to use as you only have to add a decorator like
@numba.jit(nopython=True,fastmath=True,cache=True)before the defintion of a function. It is used in the Hamiltonian and Propagation modules. If numba is not available on your computer (producing an error at execution), you can remove all theimport numbaand@numba.jit(nopython=True,fastmath=True,cache=True)lines and you will have a working version. - ctypes This module makes it possible to interface Python woth a pure C code. If used in the computationally intensive parts, it may speed up things by one order of magnitude. See section ctypes for details. This module should be made optional, but it is not at the moment.
- mkl, mkl_random and mkl_fft. These 3 modules are optional, the software works without them. The mkl module is only used to set the number of OpenMP threads, it is probably useless. If the mkl_random module is present, the MKL random number generator is used. If not, the program uses numpy.random, which has roughly the same speed. If the mkl_fft module is present, most FFTs (the ones which use a lot of CPU time) are performed using the MKL FFT routines. If not present, the program uses numpy.fft, which is a bit slower.
Back to Home