A fortran 90 wave-function Monte Carlo solver with qutip frontend

248 views
Skip to first unread message

Arne Løhre Grimsmo

unread,
Oct 28, 2012, 3:22:22 AM10/28/12
to qu...@googlegroups.com
Hello everyone,

I have been developing a fortran 90 Monte Carlo solver with python bindings so that it can be called from python. It depends on QuTiP v. 2.1.0, and it is intended to be very similar in use to QuTiP's mcsolve(), so that it can be used with QuTiP in a seamless fashion. It is less flexible than the qutip solver, and can only solve time-independent problems. The main advantage is speed. For small to medium sized systems the python implementation can be slow, due to python not being a fast language like fortran or other compiled languages. This means the fortran solver can have quite a tremendous speedup for many problems. As system size grows, the time-crucial part of the algorithm becomes  the innermost sparse matrix-vector multiplication, which in qutip's mcsolve() is performed by a compiled Cython code snippet. Because Cython is fast (near C/fortran speed), the advantage of the fortran code thus becomes smaller. For the problems I have played around with, the fortran code have had speedup factors of around a 100 for small systems, and about a factor of two for the largest systems I've tried.

I will happily share my code of course, and if someone wants to play around with it and report any issues they might encounter here, that would be great. The code is available from github:

https://github.com/arnelg/qutipf90mc

Install instructions can be found in the README, which will be displayed if you follow the above link. Typical usage would consist of adding a

from qutipf90mc import mcsolve_f90

to your qutip-program, and then replacing calls to mcsolve() with mcsolve_f90(). Try help(mcsolve_f90) for details.

Notice that the code hasn't been tested much, and is of a "beta version" status.

Hopefully this can be of use.

Cheers,

Arne
Reply all
Reply to author
Forward
0 new messages