Numba and GPU (NVDIA CUDA cores) computation with qutip

40 views
Skip to first unread message

Yash Tiwari

unread,
Nov 4, 2022, 10:07:11 AM11/4/22
to QuTiP: Quantum Toolbox in Python
Hello all,

I am trying to use mesolve function of qutip. My problem uses mesolve and apply to N different Hamiltonian (independent of each other). 

Currently, I am supplying Hamiltonian(from the list of Hamiltonians) sequentially to mesolve, I want to use parallel computation using GPU and apply mesolve to all Hamiltonians in that list.


Based on a quick read, I found that Numba is used for parallel GPU computation, however according to this Numba support very few packages(https://stackoverflow.com/questions/50744686/numba-typingerror-cannot-determine-numba-type-of-class-builtin-function-or)
 

Now I have two questions.

1. Can qutip be used with Numba to support GPU parallelization? The parallelization I am talking about makes use of NVIDIA Cuda cores 

2. If not, which packages can be used to support code parallelization using Cuda cores?

Simon Cross

unread,
Nov 5, 2022, 6:01:23 AM11/5/22
to qu...@googlegroups.com
Hi Yash,

You can run your calls to mesolve in parallel using
https://qutip.org/docs/latest/apidoc/functions.html#qutip.parallel.parallel_map
(for example).

I think Boxi already described the state of GPU support in QuTiP in an
earlier email. To recap (from Boxi's email):

***
For GPU support you can try to install manually:
- qutip-tensorflow https://github.com/qutip/qutip-tensorflow
- qutip-cupy https://github.com/qutip/qutip-cupy
- qutip-jax https://github.com/qutip/qutip-jax

They are all still under development, especially the JAX version. You
can use them to perform common operations on Qobj, but none of them
can be used directly with `mesolve` at this moment.
***

These packages all require QuTiP 5 which has not been released yet but
is available in the dev.major branch. If you'd like to experiment with
any of these, we're very help to help debug or fix issues, although
our main effort at the moment is towards making an alpha release of
version 5.

Regards,
Simon
Reply all
Reply to author
Forward
0 new messages