QDax: Accelerated Quality-Diversity

Documentation Status pytest License: MIT codecov

QDax is a tool to accelerate Quality-Diversity (QD) and neuro-evolution algorithms through hardware accelerators and massive parallelization. QD algorithms usually take days/weeks to run on large CPU clusters. With QDax, QD algorithms can now be run in minutes! ⏩ ⏩ 🕛

QDax has been developed as a research framework: it is flexible and easy to extend and build on and can be used for any problem setting. Get started with simple example and run a QD algorithm in minutes here! Open All Collab


QDax is available on PyPI and can be installed with:

pip install qdax
Alternatively, the latest commit of QDax can be installed directly from source with:
pip install git+https://github.com/adaptive-intelligent-robotics/QDax.git@main
Installing QDax via pip installs a CPU-only version of JAX by default. To use QDax with NVidia GPUs, you must first install CUDA, CuDNN, and JAX with GPU support.

However, we also provide and recommend using either Docker or conda environments to use the repository which by default provides GPU support. Detailed steps to do so are available in the documentation.

Basic API Usage

For a full and interactive example to see how QDax works, we recommend starting with the tutorial-style Colab notebook. It is an example of the MAP-Elites algorithm used to evolve a population of controllers on a chosen Brax environment (Walker by default).

However, a summary of the main API usage is provided below:

import jax
import functools
from qdax.core.map_elites import MAPElites
from qdax.core.containers.mapelites_repertoire import compute_euclidean_centroids
from qdax.tasks.arm import arm_scoring_function
from qdax.core.emitters.mutation_operators import isoline_variation
from qdax.core.emitters.standard_emitters import MixingEmitter
from qdax.utils.metrics import default_qd_metrics

seed = 42
num_param_dimensions = 100  # num DoF arm
init_batch_size = 100
batch_size = 1024
num_iterations = 50
grid_shape = (100, 100)
min_param = 0.0
max_param = 1.0
min_bd = 0.0
max_bd = 1.0

# Init a random key
random_key = jax.random.PRNGKey(seed)

# Init population of controllers
random_key, subkey = jax.random.split(random_key)
init_variables = jax.random.uniform(
    shape=(init_batch_size, num_param_dimensions),

# Define emitter
variation_fn = functools.partial(
mixing_emitter = MixingEmitter(
    mutation_fn=lambda x, y: (x, y),

# Define a metrics function
metrics_fn = functools.partial(

# Instantiate MAP-Elites
map_elites = MAPElites(

# Compute the centroids
centroids = compute_euclidean_centroids(

# Initializes repertoire and emitter state
repertoire, emitter_state, random_key = map_elites.init(init_variables, centroids, random_key)

# Run MAP-Elites loop
for i in range(num_iterations):
    (repertoire, emitter_state, metrics, random_key,) = map_elites.update(

# Get contents of repertoire
repertoire.genotypes, repertoire.fitnesses, repertoire.descriptors

QDax core algorithms

QDax currently supports the following algorithms:

Algorithm Example
MAP-Elites Open All Collab
CVT MAP-Elites Open All Collab
Policy Gradient Assisted MAP-Elites (PGA-ME) Open All Collab
QDPG Open All Collab
CMA-ME Open All Collab
OMG-MEGA Open All Collab
CMA-MEGA Open All Collab
Multi-Objective MAP-Elites (MOME) Open All Collab
MAP-Elites Evolution Strategies (MEES) Open All Collab
MAP-Elites PBT (ME-PBT) Open All Collab
MAP-Elites Low-Spread (ME-LS) Open All Collab

QDax baseline algorithms

The QDax library also provides implementations for some useful baseline algorithms:

Algorithm Example
DIAYN Open All Collab
DADS Open All Collab
SMERL Open All Collab
NSGA2 Open All Collab
SPEA2 Open All Collab
Population Based Training (PBT) Open All Collab

QDax Tasks

The QDax library also provides numerous implementations for several standard Quality-Diversity tasks.

All those implementations, and their descriptions are provided in the tasks directory.


Issues and contributions are welcome. Please refer to the contribution guide in the documentation for more details.

Citing QDax

If you use QDax in your research and want to cite it in your work, please use:

    title={QDax: A Library for Quality-Diversity and Population-based Algorithms with Hardware Acceleration},
    author={Felix Chalumeau and Bryan Lim and Raphael Boige and Maxime Allard and Luca Grillotti and Manon Flageat and Valentin Macé and Arthur Flajolet and Thomas Pierrot and Antoine Cully},


QDax was developed and is maintained by the Adaptive & Intelligent Robotics Lab (AIRL) and InstaDeep.

AIRL_Logo InstaDeep_Logo