Installation Guide

Prerequisites

TwisteRL requires:

  • Python 3.9 or higher

  • Rust toolchain (for building from source)

  • PyTorch 2.2 or higher

From PyPI

pip install twisterl

From Source

  1. Clone the repository:

git clone https://github.com/AI4quantum/twisteRL.git
cd twisteRL
  1. Create and activate a virtual environment:

python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install the Rust toolchain (if not already installed):

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
  1. Install the package:

pip install .

Development Installation

For development, install in editable mode:

pip install -e .

Verify Installation

Test your installation by running the training example:

python -m twisterl.train --config examples/ppo_puzzle8_v1.json

Or import the package in Python:

import twisterl
from twisterl.rl import PPO, AZ
from twisterl.nn import BasicPolicy