QubiCycle is a qubit reuse algorithm that reduces the number of qubits required by quantum circuits.
It supports different qubit-reuse strategies (gate reordering and eager measurement) and multiple solver backends (SMT and ILP).
This repository includes a Conda environment file:
qubicycle_environmenr.yml
It specifies all required Python packages and versions.
Create and activate the environment with:
conda env create -f qubicycle_environmenr.yml
conda activate <env_name>Replace <env_name> with the environment name defined inside qubicycle_environmenr.yml.
There are two main entry scripts:
scale_script.py– runs QubiCycle with divide-and-conquer.script.py– runs QubiCycle without divide-and-conquer.
Run them as:
python scale_script.py
or
python script.py
If you want to customize parameters (e.g., mode, solver, subset size), you can modify the corresponding arguments inside:
scale_script.py(divide-and-conquer version), orscript.py(non-divide-and-conquer version).
--input
Path to the input QASM file.
--output
Path to the output QASM file after applying QubiCycle.
--log
Path to the log file that records the execution process.
--mode
Qubit-reuse mode. Supported values are:
none– without gate reordering and without eager measurement.reorder– with gate reordering only.eager– with eager measurement only.all– with both gate reordering and eager measurement.
--k
Subset size used only in the scaled (divide-and-conquer) version.
--solver
Solver for the optimization. Supported values:
SMTILP
If you use QubiCycle in your research or publications, please cite:
Wen-Chen Yu*, Tian-Fu Chen*, Yu-Hsiang Chan, Jie-Hong R. Jiang, Dah-Wei Chiou, and Yao-Wen Chang, “Optimal Qubit Reuse for Quantum Computation with Gate Reordering and Eager Measurement,” in Proceedings of the IEEE International Conference on Quantum Computing and Engineering (QCE), 2025.
(* equal contribution)
@inproceedings{Yu2025QubiCycle,
author = {Wen-Chen Yu* and Tian-Fu Chen* and Yu-Hsiang Chan and Jie-Hong R. Jiang and Dah-Wei Chiou and Yao-Wen Chang},
title = {Optimal Qubit Reuse for Quantum Computation with Gate Reordering and Eager Measurement},
booktitle = {IEEE International Conference on Quantum Computing and Engineering (QCE)},
year = {2025}
}