Downloads · 30 days
50
7% of all-time downloads
Qiskit/ai-transpiler_permutations
ai-transpiler_permutations is a machine learning model from Qiskit. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Downloads · 30 days
50
7% of all-time downloads
All-time downloads
706
Public
Repo size
31.4 MB
Likes
4
Public
Click a slice to open those files.
.safetensors15.6 MB · 99%
From the Hugging Face model README

This repository hosts models for permutation synthesis in quantum circuits trained with RL techniques. The models are specialized for different topologies and qubit counts.
Permutation circuits rearrange computational basis states according to an n-element permutation (one per qubit in binary encoding) using SWAP gates constrained by the device topology. More info about Permutation circuits in Qiskit
For each model, there is the environment config (.json) and the trained policy weights (.safetensors).
gateset property in the model's config.permutation_*.json: model configs for a given qubit count/topology..safetensors files: trained policies for each JSON (same filename stem).Training data is entirely synthetic and generated internally at IBM Quantum using custom reinforcement learning environments built on Qiskit-Gym.
Data Collection: Random permutation operators are generated by composing random SWAP sequences consistent with the target coupling map. The number of gates scales with the difficulty, which increase when the model learns to solve circuits at that difficulty. No external datasets or third-party circuit repositories are used.
PII: No personal or sensitive data is present or used in any phase of training, as all data is synthetic and generated algorithmically.
Infrastructure: We train the models using IBM's Cognitive Computing Cluster (CCC) using NVIDIA A100 40GB GPUs. The cluster provides a scalable and efficient infrastructure for training.
Below is a snippet to synthesize a random 10-qubit permutation. We use qiskit-gym (repo), twisteRL (repo), and qiskit. Install dependencies via pip install qiskit-gym in your virtual environment.
from qiskit_gym.rl import RLSynthesis
from twisterl.utils import pull_hub_algorithm
from qiskit.circuit.library import Permutation
import numpy as np
local_path = pull_hub_algorithm(
repo_id="Qiskit/ai-transpiler_permutations",
model_path="./models",
revision="main",
validate=True,
)
if not local_path:
raise ValueError("Failed to download model from hub")
num_qubits = 12
seed = 42
input_perm = np.random.default_rng(seed).permutation(num_qubits).tolist()
rls = RLSynthesis.from_config_json(
f"{local_path}/permutation_12qO.json",
f"{local_path}/permutation_12qO.safetensors",
)
qc_perm_output = rls.synth(input_perm, num_searches=10, num_mcts_searches=0, deterministic=False)
print(qc_perm_output)
<!-- MODEL_INDEX_START -->
Below is the list of available models with qubit counts and topologies:
| Model | Qubits | Topology |
|---|---|---|
permutation_8qL | 8 | L |
permutation_12qO | 12 | O |
permutation_27q | 27 | HEX |
permutation_33q | 33 | HEX |
permutation_65q | 65 | HEX |
The authors acknowledge the IBM Research CCC Service for providing resources that have contributed to the production or processing of the data contained within this data collection.