Skip to content

Latest commit

 

History

History
75 lines (54 loc) · 2.28 KB

File metadata and controls

75 lines (54 loc) · 2.28 KB

QuantRL: Quantum Control using Reinforcement Learning

Latest Version

A backend-agnostic library of modules to interface deterministic and stochastic quantum models for reinforcement learning.

Key Features!

  • 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.

What's New!

  • Support for PyTorch (GPU) with 'tsit' solver.
  • Support for tuple action spaces.

For a complete list of changes, see CHANGELOG.md.

Installation

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 pandas

The 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 diffrax

For 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]" diffrax

Note: 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-baselines3

Finally, to install the latest version of quantrl, execute:

pip install git+https://github.com/sampreet/quantrl.git