A backend-agnostic library of modules to interface deterministic and stochastic quantum models for reinforcement learning.
- Quickly interface environments with any of the three backends: NumPy, PyTorch and JAX.
- Run multiple RL environments in parallel using vectorized inheritable classes.
- Evolve deterministic and stochastic environments with asynchronous saves.
- Visualize evolutions and plot learning curves seamlessly.
- Support for PyTorch (GPU) with
'tsit'solver. - Support for tuple action spaces.
For a complete list of changes, see CHANGELOG.md.
QuantRL requires Python 3.12+,
preferably installed via the
MiniForge distribution.
It's base dependencies can be installed using:
python -m pip install numpy scipy matplotlib tqdm rich pillow pandasThe default backend for the library uses vanilla NumPy and Scipy.
To avail the JAX or PyTorch backends, the latest version
of these framework (CPU or GPU) should be installed
(preferably in different conda environments)
using in their official documentations:
JAX docs and
PyTorch docs.
After successful installation, the corresponding libraries
(diffrax for JAX and torchdiffeq for PyTorch) can be installed using PIP.
For the CPU versions, use:
python -m pip install torch torchdiffeq jax diffraxFor the GPU versions with CUDA 13 support, use:
python -m pip install torch --index-url https://download.pytorch.org/whl/cu126
python -m pip install torchdiffeq "jax[cuda13]" diffraxNote: JAX-GPU support for Windows and MacOS is still limited but it runs well in WSL2.
QuantRL primarily relies on gymnasium (for single environments)
and stable-baselines3 (for vectorized environments).
These can be installed using:
python -m pip install gymnasium stable-baselines3Finally, to install the latest version of quantrl, execute:
pip install git+https://github.com/sampreet/quantrl.git