Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
43fc15c
added function related to training and for GNN, needed to define GNN …
Aug 19, 2025
e1695cc
Added the gnn part, must be fine-tuned hyper-params, no test
Aug 19, 2025
07d014e
Removed the barriers in the creation of the DAG
Aug 19, 2025
1713ca6
coded tested and fixed, need to add a cross validation module
Aug 20, 2025
83d4313
fixed the problem of the predict_device_for_figure_of_merits
Aug 20, 2025
63b38d9
Hellinger test done: success
Aug 20, 2025
6a8e095
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 20, 2025
470cd8f
GNN predictor fixed with optuna and tested
Aug 21, 2025
489811d
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 21, 2025
9197707
GNN predictor fixed with optuna and tested
Aug 21, 2025
5770501
Problems modified TPESampler and not TYPESampler
Aug 21, 2025
a62b6ae
Problems modified TPESampler and not TYPESampler
Aug 21, 2025
a67491c
Problems modified TPESampler and not TYPESampler
Aug 21, 2025
69b483b
Test modified with number of epochs as parameter
Aug 21, 2025
fe5b210
Eliminated trained model
Aug 21, 2025
edff928
Changed the test estimated hellinger for windows
Aug 21, 2025
9ae1b9c
Changed the test estimated hellinger for windows
Aug 21, 2025
6ad1996
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 21, 2025
ac11b2d
Problem with windows solved eliminating warning
Aug 21, 2025
430fcf5
Files modified according suggestion
Aug 22, 2025
0d2a758
Fixed the comments related to test hellinger distance and utils
antotu Aug 25, 2025
b767c9f
Fixed modification also with pre-commit
antotu Aug 25, 2025
5fae012
Refactor the test ml predictor considering to join function related M…
antotu Aug 25, 2025
9911e64
Modified part of helper in order to solve problems code
antotu Aug 26, 2025
fc5e386
Update tests/device_selection/test_predictor_ml.py
antotu Aug 27, 2025
3574f61
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 27, 2025
8a8a6e7
first round fixes
antotu Aug 27, 2025
32ad2cd
pre-commit fixes
antotu Aug 27, 2025
22c65fa
Update src/mqt/predictor/ml/predictor.py
antotu Aug 27, 2025
366c1ee
Update src/mqt/predictor/ml/predictor.py
antotu Aug 27, 2025
ae05f74
Partial modification
antotu Aug 27, 2025
f38c9bb
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 27, 2025
74fe841
fixed comments repo
antotu Aug 27, 2025
3b1f903
Modified the gates accepted
antotu Aug 28, 2025
11e1c5f
Modified list
antotu Aug 28, 2025
bda1604
Fixed bug Swap and Cswap gates
antotu Sep 8, 2025
62e4921
Edit for saving memory GPU
antotu Sep 12, 2025
db799f6
Added patience as variable
antotu Oct 6, 2025
67f8f03
Updated GNN for predictions
antotu Nov 24, 2025
80dd146
partial modification guessed by bot
antotu Nov 24, 2025
2a9ec03
eliminated italian comments
antotu Nov 24, 2025
d5a43a8
eliminated italian comments
antotu Nov 24, 2025
40e3aea
eliminated redundancy torch_clamp
antotu Nov 24, 2025
a6500a1
removed small errors
antotu Nov 24, 2025
78d0b48
solved partial errors
antotu Nov 25, 2025
a46e1c5
Corrected for the lint
antotu Nov 25, 2025
75d7127
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 25, 2025
9c8b478
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 25, 2025
9fad119
error deprecation warning of a useless library
antotu Nov 25, 2025
3daaf58
error deprecation warning of a useless library
antotu Nov 25, 2025
94d1f9a
small error correction
antotu Nov 25, 2025
fe324ec
small error correction
antotu Nov 25, 2025
703d704
small error correction
antotu Nov 25, 2025
be6d69c
problem torch_geometric
antotu Nov 25, 2025
36d95f4
lightweight import
antotu Nov 26, 2025
92d608b
lightweight import
antotu Nov 26, 2025
8d2fc82
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 26, 2025
c0ed915
lightweight import
antotu Nov 26, 2025
cbaaf14
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 26, 2025
3390c41
fixed some code coverage
antotu Nov 26, 2025
c2e7feb
Consider also verbose
antotu Nov 27, 2025
cc7ea91
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 26, 2025
04516ca
Consider also verbose
antotu Nov 27, 2025
87b9cfa
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 27, 2025
475c9d0
Consider also verbose
antotu Nov 27, 2025
f3b0812
Consider adjusted estiamted hellinger distance as regression problem
antotu Nov 27, 2025
446c53c
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 27, 2025
2873464
Fixed regression
antotu Nov 27, 2025
f235567
Fixed regression
antotu Nov 27, 2025
844b0aa
Adjusted threshold for test regression
antotu Nov 28, 2025
8f5bb06
Fixed some code lines for more clarity
antotu Nov 28, 2025
63e747d
Modified a comment on test estimated_hellinger_distance
antotu Nov 28, 2025
d06daa8
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 28, 2025
375105f
Minor fixes
Dec 8, 2025
7c47022
Minor fixes
Dec 8, 2025
fe2f08d
Minor fixes
Dec 8, 2025
8ef4977
Minor fixes
Dec 8, 2025
e9f57fc
Minor fixes
Dec 8, 2025
af30a38
Minor fixes
Dec 8, 2025
43df597
Minor fixes
Dec 8, 2025
48ba216
Minor fixes found
Dec 9, 2025
51c6d43
Minor fixes found
Dec 9, 2025
3cd3db0
Minor fixes found: error in predicting hellinger distance
Dec 9, 2025
59f3efe
Minor fixes found: error in predicting hellinger distance
Dec 9, 2025
033785a
Minor fixes found: error in predicting hellinger distance
Dec 9, 2025
d417dab
Minor modifications
Dec 9, 2025
5ec4edc
Minor modifications
Dec 9, 2025
cb9dc52
Minor modifications
Dec 9, 2025
92051e9
Minor modifications
Dec 9, 2025
fb8dafc
Minor modifications
Dec 9, 2025
f9b833f
Minor fixes code and change of libraries
Dec 10, 2025
54f0fb0
Minor fixes code and change of libraries
Dec 10, 2025
ba6351d
Reduced ignore on warning, modified doc, and minor fixes
Dec 10, 2025
aff599d
Modified documentation
Dec 10, 2025
890444f
Modified documentation
Dec 10, 2025
d7d49ed
Modified documentation
Dec 10, 2025
3990867
Modified taking into account to not use .pt for saving dataset
Dec 10, 2025
9947e12
Modified not using pt for getting the dataset
Dec 10, 2025
7a7dc23
Modified not using pt for getting the dataset
Dec 10, 2025
add1d99
Fixes for code rabbit AI
Dec 10, 2025
6025101
Minor fixes
Dec 10, 2025
a7e632b
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 10, 2025
a938f8c
Minor fixes
Dec 10, 2025
dddb3ae
Minor fixes
Dec 10, 2025
3b77a3a
Minor fixes
Dec 10, 2025
1ac5273
Minor fixes
Dec 10, 2025
354488e
Minor fixes
Dec 11, 2025
34fb8f7
Minor fixes
Dec 11, 2025
21f8c3b
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 11, 2025
716f1c0
Modified documentation
Dec 12, 2025
21ffc4b
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 12, 2025
bd029ea
Modified documentation
Dec 12, 2025
0ea72be
Modified tests
Dec 12, 2025
11812f8
Modified tests
Dec 12, 2025
9e53e27
Modified tests
Dec 12, 2025
69bfc14
Minor modifications
Dec 16, 2025
4983c59
Minor modifications
Dec 16, 2025
0c946d9
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 16, 2025
1f1799d
Minor modifications
Dec 16, 2025
030c6cd
Minor modifications
Dec 16, 2025
4af838d
Verbose regression added for code coverage
Jan 7, 2026
6031b69
Verbose regression added for code coverage
Jan 7, 2026
a37be3e
Added multi-class classification
Jan 7, 2026
214d149
Test empty circuit DAG
Jan 7, 2026
5867a11
Fixed minor issue
Jan 7, 2026
2589728
Fixed minor issue
Jan 7, 2026
301e8b0
Minor fixes
Jan 8, 2026
a10c131
🎨 pre-commit fixes
pre-commit-ci[bot] Jan 20, 2026
d239b2d
...
antotu Jan 20, 2026
de186b3
🎨 pre-commit fixes
pre-commit-ci[bot] Mar 16, 2026
1834ebb
Merge remote-tracking branch 'origin/qce-experiments' into pr/antotu/563
flowerthrower Mar 18, 2026
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
25 changes: 24 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ dependencies = [
"numpy>=1.26; python_version >= '3.12'",
"numpy>=1.24; python_version >= '3.11'",
"numpy>=1.22",
"torch>=2.8.0",
"optuna>=4.5.0",
"torch-geometric>=2.6.1",
"safetensors>=0.4.0",
"typing-extensions>=4.1", # for `assert_never`
"qiskit-ibm-transpiler>=0.15.0; sys_platform != 'win32' or python_version != '3.13'", # pulls qiskit-serverless, which pulls ray[default], and the resolved ray 2.54.0 has no win_amd64 cp313 wheel
"qiskit-ibm-ai-local-transpiler>=0.5.5",
Expand Down Expand Up @@ -121,6 +125,8 @@ log_level = "INFO"
filterwarnings = [
'error',
'ignore:.*pytorch.*:UserWarning:',
"ignore:`torch_geometric.distributed` has been deprecated:DeprecationWarning:torch_geometric",
"ignore:.*'type_params' parameter of 'typing\\._eval_type'.*:DeprecationWarning:",
'ignore:.*Values in x.*:RuntimeWarning:',
'ignore:.*The least populated class in y has only 3 members, which is less than n_splits=5.*:UserWarning:',
'ignore:.*divide by zero encountered in det.*:RuntimeWarning:',
Expand All @@ -131,7 +137,9 @@ filterwarnings = [
'ignore:.*The property ``qiskit.circuit.instruction.Instruction.*`` is deprecated as of qiskit 1.3.0.*:DeprecationWarning:',
# Windows: Python 3.13 can emit a RuntimeWarning about unsupported timeouts; keep tests strict otherwise.
'ignore:.*Timeout is not supported on Windows\\.:RuntimeWarning',

'ignore:.*`torch_geometric\\.distributed` has been deprecated since 2\\.7\\.0.*:DeprecationWarning:',
"ignore::DeprecationWarning:torch_geometric.distributed",
'error',
]


Expand Down Expand Up @@ -160,6 +168,20 @@ exclude = [
"docs/**",
]

[[tool.mypy.overrides]]
# `mqt.bench` and `sb3_contrib` are fully typed but take forever to install in the environment.
# recent versions of `gym` are typed, but stable-baselines3 pins a very old version of gym.
# qiskit is not yet marked as typed, but is typed mostly.
# the other libraries do not have type stubs.
module = ["qiskit.*", "joblib.*", "sklearn.*", "matplotlib.*", "gymnasium.*", "mqt.bench.*", "sb3_contrib.*", "bqskit.*", "qiskit_ibm_runtime.*", "networkx.*", "stable_baselines3.*", "torch", "torch.*", "torch_geometric", "torch_geometric.*", "optuna.*", "safetensors", "safetensors.torch", "safetensors.*" ]
ignore_missing_imports = true

# Relax type checking for the GNN module since torch and torch_geometric expose
# many APIs as Any due to incomplete type stubs; the GNN implementation must
# work with these untyped returns and may need to subclass Any-typed classes.
[[tool.mypy.overrides]]
module = ["mqt.predictor.ml.gnn"]
disallow_subclassing_any = false

[tool.ruff]
line-length = 120
Expand Down Expand Up @@ -248,6 +270,7 @@ wille = "wille"
anc = "anc"
aer = "aer"
fom = "fom"
TPE = "TPE"


[tool.repo-review]
Expand Down
39 changes: 39 additions & 0 deletions src/mqt/predictor/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright (c) 2023 - 2026 Chair for Design Automation, TUM
# Copyright (c) 2025 - 2026 Munich Quantum Software Company GmbH
# All rights reserved.
#
# SPDX-License-Identifier: MIT
#
# Licensed under the MIT License

# file generated by setuptools-scm
# don't change, don't track in version control
Comment on lines +9 to +10

Comment on lines +9 to +11
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Autogenerated _version.py should not be tracked.

The header indicates this file is generated by setuptools-scm; committing it risks stale versions and merge conflicts. Please remove it from VCS and add it to .gitignore, relying on the hatch-vcs hook to regenerate it. Based on learnings, this file should be excluded from version control.

🤖 Prompt for AI Agents
In `@src/mqt/predictor/_version.py` around lines 9 - 11, Remove the autogenerated
file src/mqt/predictor/_version.py from version control (stop tracking it and
delete from the repo tree), add an entry for src/mqt/predictor/_version.py to
.gitignore so it isn't committed again, and ensure the project relies on the
hatch-vcs/hatch hook to regenerate the file at build/time; reference the
autogenerated indicator in src/mqt/predictor/_version.py and the hatch-vcs hook
to verify regeneration works after removal.

__all__ = [
"__commit_id__",
"__version__",
"__version_tuple__",
"commit_id",
"version",
"version_tuple",
]

TYPE_CHECKING = False
if TYPE_CHECKING:
VERSION_TUPLE = tuple[int | str, ...]
COMMIT_ID = str | None
else:
VERSION_TUPLE = object
COMMIT_ID = object

version: str
__version__: str
__version_tuple__: VERSION_TUPLE
version_tuple: VERSION_TUPLE
commit_id: COMMIT_ID
__commit_id__: COMMIT_ID

__version__ = version = "0.1.dev957+g1f2bf74aa.d20260107"
__version_tuple__ = version_tuple = (0, 1, "dev957", "g1f2bf74aa.d20260107")

__commit_id__ = commit_id = None
17 changes: 9 additions & 8 deletions src/mqt/predictor/hellinger/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,13 @@ def calc_device_specific_features(
return np.array(list(feature_dict.values()))


def get_hellinger_model_path(device: Target) -> Path:
"""Returns the path to the trained model folder resulting from the machine learning training."""
training_data_path = Path(str(resources.files("mqt.predictor"))) / "ml" / "training_data"
model_path = (
training_data_path
/ "trained_model"
/ ("trained_hellinger_distance_regressor_" + device.description + ".joblib")
def get_hellinger_model_path(device: Target, gnn: bool = False) -> Path:
"""Returns the path to the trained model file resulting from the machine learning training."""
training_data_path = Path(str(resources.files("mqt.predictor"))) / "ml" / "training_data" / "trained_model"
device_description = str(device.description)
filename = (
(f"trained_hellinger_distance_regressor_gnn_{device_description}.pth")
if gnn
else (f"trained_hellinger_distance_regressor_{device_description}.joblib")
)
return Path(model_path)
return training_data_path / filename
7 changes: 6 additions & 1 deletion src/mqt/predictor/ml/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,9 @@
from mqt.predictor.ml import helper
from mqt.predictor.ml.predictor import Predictor, predict_device_for_figure_of_merit, setup_device_predictor

__all__ = ["Predictor", "helper", "predict_device_for_figure_of_merit", "setup_device_predictor"]
__all__ = [
"Predictor",
"helper",
"predict_device_for_figure_of_merit",
"setup_device_predictor",
]
Loading
Loading