Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
129b60f
Update predictor(adding callbacks)
Mar 29, 2025
08889bd
Update
Apr 10, 2025
e2ff3fe
Restore helper.py and predictor.py to match upstream
Jul 29, 2025
1c32d15
Merge remote-tracking branch 'upstream/main'
Jul 29, 2025
78dc1aa
Implement new mapping actions
Jul 29, 2025
a3ba836
Fix: resolve pre-commit issues and add missing annotations
Jul 29, 2025
5935e6f
Fix: resolve pre-commit issues and add missing annotations
Jul 29, 2025
f71fb29
Fix: resolve pre-commit issues and add missing annotations
Jul 30, 2025
3c7592b
Fix: resolve pre-commit issues and add missing annotations
Jul 30, 2025
6db5c27
Fix mypy errors
Aug 1, 2025
47841c5
Fix mypy errors
Aug 1, 2025
b1ac8ce
Fix dependencies issues
Aug 3, 2025
5f8473c
Fix dependency issues
Aug 3, 2025
7491ec0
Add missing zip file
Aug 3, 2025
3346842
Fix issue with Python 3.13
Aug 3, 2025
6f7a73c
Merge branch 'main' into hybrid-mapping
Shaobo-Zhou Aug 3, 2025
6c67349
Remove Python 3.13 from noxfile.py due to compatibility issue
Aug 3, 2025
2692b96
Skip minimums session on Windows due to CI slowness
Aug 4, 2025
f4874e6
Fix bugs
Aug 5, 2025
54eec91
Fix bugs
Aug 5, 2025
845f7de
Use default Qiskit settings for VF2Layout and add assertion for nativ…
Shaobo-Zhou Aug 7, 2025
3418936
Debug
Shaobo-Zhou Aug 7, 2025
ae870cc
Fix missing argument
Shaobo-Zhou Aug 7, 2025
861bc62
Fix warning issues
Shaobo-Zhou Aug 7, 2025
fa989b6
Fix window runtime warning problem
Shaobo-Zhou Aug 7, 2025
405bd39
Fix window runtime warning problem
Shaobo-Zhou Aug 7, 2025
7b2f321
Add time limit for VF2PostLayout
Shaobo-Zhou Aug 7, 2025
b67d0a6
Fix windows runtime warning problem
Shaobo-Zhou Aug 7, 2025
bf7c9ee
Add new actions
Shaobo-Zhou Aug 29, 2025
6d2733f
Add new actions
Shaobo-Zhou Aug 29, 2025
878185a
Add evaluation code for baseline model
Shaobo-Zhou Sep 3, 2025
eae11a2
Set up code for testing new model
Shaobo-Zhou Sep 5, 2025
68306ec
Reset
Shaobo-Zhou Sep 5, 2025
fcba8fa
Add new actions
Shaobo-Zhou Sep 6, 2025
e5b7518
Fix dependencies
Shaobo-Zhou Sep 8, 2025
907ce2b
Fix dependencies
Shaobo-Zhou Sep 8, 2025
70dcd7d
Fix dependencies
Shaobo-Zhou Sep 8, 2025
e0364b1
Merge branch 'main' into new_structure
Shaobo-Zhou Sep 8, 2025
eb27098
🎨 pre-commit fixes
pre-commit-ci[bot] Sep 8, 2025
2688c0e
Fix dependencies
Shaobo-Zhou Sep 8, 2025
840d23d
Fix multiprocessing on Python 3.13
Shaobo-Zhou Sep 9, 2025
ac406ac
Fix timeout watcher
Shaobo-Zhou Sep 9, 2025
97c81bb
Update comments and restructure
Shaobo-Zhou Sep 15, 2025
470365d
Adjust test circuits from ALG to INDEP
Shaobo-Zhou Sep 15, 2025
caaf224
Update max synthesis size for bqskit
Shaobo-Zhou Sep 15, 2025
468da2e
Add tests for more coverage
Shaobo-Zhou Sep 17, 2025
737a9f2
Update tests
Shaobo-Zhou Sep 18, 2025
94c25ab
Update override
Shaobo-Zhou Sep 18, 2025
3ff922e
Update comments
Shaobo-Zhou Sep 18, 2025
782caf8
Update noxfile.py and CHANGELOG.md
Shaobo-Zhou Sep 22, 2025
44e0e40
Clean up venv after each session to free up space
Shaobo-Zhou Sep 23, 2025
350bae5
Clean up venv after each session to free up space
Shaobo-Zhou Sep 23, 2025
91208d1
Clean up venv after each session to free up space
Shaobo-Zhou Sep 23, 2025
622d409
Clean up venv after each session to free up space
Shaobo-Zhou Sep 23, 2025
fa008a6
Update noxfile
Shaobo-Zhou Sep 25, 2025
0c98e56
Update ibm runtime dependency
Shaobo-Zhou Sep 25, 2025
34a1c7c
Update noxfile
Shaobo-Zhou Sep 25, 2025
a8d069a
Update noxfile
Shaobo-Zhou Sep 25, 2025
114b79b
Update noxfile
Shaobo-Zhou Sep 25, 2025
aaf14b1
Fetch update from main
Shaobo-Zhou Sep 26, 2025
e39cd7e
Merge remote-tracking branch 'upstream/main' into new_structure
Shaobo-Zhou Nov 20, 2025
e7b4174
Fix ruff checks
Shaobo-Zhou Nov 20, 2025
fcab4fa
Update action space and add normalized gate counts as RL features
Shaobo-Zhou Nov 20, 2025
cb4d0fb
Fix FOM comparison logic
Shaobo-Zhou Nov 20, 2025
988a8f7
Remove 3-qubit gates from dict
Shaobo-Zhou Nov 21, 2025
9a40b3e
Add reward shaping
Shaobo-Zhou Nov 26, 2025
cee79cd
Add fallback for unsupported reward function
Shaobo-Zhou Nov 27, 2025
756d777
Minor Fixes
Shaobo-Zhou Nov 27, 2025
d60d17e
Minor Fixes
Shaobo-Zhou Nov 27, 2025
a05e37a
Merge branch 'main' into new_RL
Shaobo-Zhou Nov 27, 2025
85d4d57
Minor Fixes
Shaobo-Zhou Nov 27, 2025
a1370de
Fix predictorenv.py
Shaobo-Zhou Nov 27, 2025
e456f43
Update changelog and improve test coverage
Shaobo-Zhou Dec 3, 2025
de7c498
Update cost model
Shaobo-Zhou Dec 3, 2025
9a68c59
Merge branch 'main' into new_RL
Shaobo-Zhou Dec 3, 2025
d0a07a2
Update cost model
Shaobo-Zhou Dec 3, 2025
18cf31f
Fix CI issue
Shaobo-Zhou Dec 3, 2025
0c42b41
Improve coverage
Shaobo-Zhou Dec 3, 2025
a451710
Update src/mqt/predictor/reward.py
Shaobo-Zhou Dec 3, 2025
ac7dc28
Update src/mqt/predictor/rl/cost_model.py
Shaobo-Zhou Dec 3, 2025
67dc402
Update tests/hellinger_distance/test_estimated_hellinger_distance.py
Shaobo-Zhou Dec 3, 2025
8259b4d
Code improvements suggested by CodeRabbit
Shaobo-Zhou Dec 3, 2025
4b5bf6f
Fix warnings
Shaobo-Zhou Dec 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ This project adheres to [Semantic Versioning], with the exception that minor rel

### Changed

- ✨ Improve RL reward design by adding intermediate rewards ([#526]) ([**@Shaobo-Zhou])
- 🔧 Changed test circuit level for RL predictor from ALG to INDEP ([#449]) ([**@Shaobo-Zhou])
- ✨ Remove support for custom names of trained models ([#489]) ([**@bachase**])
- 🔥 Drop support for x86 macOS systems ([#421]) ([**@denialhaag**])

Expand Down Expand Up @@ -44,6 +46,8 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool

<!-- PR links -->

[#526]: https://github.com/munich-quantum-toolkit/predictor/pull/526
[#449]: https://github.com/munich-quantum-toolkit/predictor/pull/449
[#489]: https://github.com/munich-quantum-toolkit/predictor/pull/489
[#421]: https://github.com/munich-quantum-toolkit/predictor/pull/421
[#406]: https://github.com/munich-quantum-toolkit/predictor/pull/406
Expand All @@ -61,6 +65,7 @@ _📚 Refer to the [GitHub Release Notes](https://github.com/munich-quantum-tool
[**@flowerthrower**]: https://github.com/flowerthrower
[**@denialhaag**]: https://github.com/denialhaag
[**@bachase**]: https://github.com/bachase
[**@Shaobo-Zhou**]: https://github.com/Shaobo-Zhou

<!-- General links -->

Expand Down
2 changes: 1 addition & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ After setup, any quantum circuit can be compiled for the most suitable device wi
from mqt.predictor import qcompile
from mqt.bench import get_benchmark, BenchmarkLevel

uncompiled_qc = get_benchmark("ghz", level=BenchmarkLevel.ALG, circuit_size=5)
uncompiled_qc = get_benchmark("ghz", level=BenchmarkLevel.INDEP, circuit_size=5)
compiled_qc, compilation_info, selected_device = qcompile(
uncompiled_qc, figure_of_merit="expected_fidelity"
)
Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ Issues = "https://github.com/munich-quantum-toolkit/predictor/issues"
Discussions = "https://github.com/munich-quantum-toolkit/predictor/discussions"
Research = "https://www.cda.cit.tum.de/research/quantum/"

[tool.check-sdist]
sdist-only = ["src/mqt/predictor/_version.py"]

[tool.hatch.build.targets.wheel]
packages = ["src/mqt"]

Expand Down Expand Up @@ -124,6 +127,8 @@ filterwarnings = [
'ignore:.*qiskit.providers.models is deprecated since Qiskit 1.2*:DeprecationWarning:',
'ignore:.*The class ``qiskit.qobj.*`` is deprecated as of Qiskit 1.3.*:DeprecationWarning:',
'ignore:.*The property ``qiskit.circuit.instruction.Instruction.*`` is deprecated as of qiskit 1.3.0.*:DeprecationWarning:',
"ignore:.*No canonical cost table defined for device.*:UserWarning:",

]


Expand Down
17 changes: 13 additions & 4 deletions src/mqt/predictor/ml/predictor.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@

logger = logging.getLogger("mqt-predictor")

NO_PARALLEL = sys.platform == "win32" and sys.version_info >= (3, 13)


def setup_device_predictor(
devices: list[Target],
Expand Down Expand Up @@ -227,7 +229,10 @@ def compile_training_circuits(
with zipfile.ZipFile(str(path_zip), "r") as zip_ref:
zip_ref.extractall(path_uncompiled_circuits)

Parallel(n_jobs=num_workers, verbose=100)(
# On Windows + Python 3.13, joblib's default "loky" process backend is broken
# (missing `_posixsubprocess`). Fall back to no multiprocessing.
num_jobs = 1 if NO_PARALLEL else num_workers
Parallel(n_jobs=num_jobs, verbose=100)(
delayed(self._compile_all_circuits_devicewise)(
device, timeout, path_uncompiled_circuits, path_compiled_circuits, logger.level
)
Expand Down Expand Up @@ -267,7 +272,8 @@ def generate_training_data(
names_list = []
scores_list = []

results = Parallel(n_jobs=num_workers, verbose=100)(
num_jobs = 1 if NO_PARALLEL else num_workers
results = Parallel(n_jobs=num_jobs, verbose=100)(
delayed(self._generate_training_sample)(
filename.name,
path_uncompiled_circuits,
Expand All @@ -276,6 +282,7 @@ def generate_training_data(
)
for filename in path_uncompiled_circuits.glob("*.qasm")
)

for sample in results:
training_sample, circuit_name, scores = sample
if all(score == -1 for score in scores):
Expand Down Expand Up @@ -405,8 +412,10 @@ def train_random_forest_model(
if not training_data:
training_data = self._get_prepared_training_data()
num_cv = min(len(training_data.y_train), 5)
mdl = GridSearchCV(mdl, tree_param, cv=num_cv, n_jobs=8).fit(training_data.X_train, training_data.y_train)

num_jobs = 1 if NO_PARALLEL else 8
mdl = GridSearchCV(mdl, tree_param, cv=num_cv, n_jobs=num_jobs).fit(
training_data.X_train, training_data.y_train
)
joblib_dump(mdl, save_mdl_path)
logger.info("Random Forest model is trained and saved.")

Expand Down
3 changes: 3 additions & 0 deletions src/mqt/predictor/reward.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,15 @@ def estimated_success_probability(qc: QuantumCircuit, device: Target, precision:
if first_qubit_idx not in active_qubits:
continue

dt = device.dt or 1.0 # discrete time unit; fallback to 1.0 if unavailable
res *= np.exp(
-instruction.duration
* dt
/ min(device.qubit_properties[first_qubit_idx].t1, device.qubit_properties[first_qubit_idx].t2)
)
continue
res *= 1 - device[gate_type][first_qubit_idx,].error

else:
second_qubit_idx = calc_qubit_index(qargs, qc.qregs, 1)
res *= 1 - device[gate_type][first_qubit_idx, second_qubit_idx].error
Expand Down
Loading
Loading