Skip to content
Open
Show file tree
Hide file tree
Changes from 89 commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
12fad57
added function related to training and for GNN, needed to define GNN …
Aug 19, 2025
be734dd
Added the gnn part, must be fine-tuned hyper-params, no test
Aug 19, 2025
61c6824
Removed the barriers in the creation of the DAG
Aug 19, 2025
75875ff
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 19, 2025
081651c
coded tested and fixed, need to add a cross validation module
Aug 20, 2025
b82dc01
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
antotu Aug 20, 2025
5ebd202
fixed the problem of the predict_device_for_figure_of_merits
Aug 20, 2025
857cd6f
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 20, 2025
6081f6b
Hellinger test done: success
Aug 20, 2025
7c54da6
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
Aug 20, 2025
bb4da24
GNN predictor fixed with optuna and tested
Aug 21, 2025
10bb52c
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 21, 2025
06be0d6
GNN predictor fixed with optuna and tested
Aug 21, 2025
ce990e3
Modified the tolm for running on the MacOS
Aug 21, 2025
96ca75b
Problems modified TPESampler and not TYPESampler
Aug 21, 2025
a64a082
Problems modified TPESampler and not TYPESampler
Aug 21, 2025
f8c99b5
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 21, 2025
e4e2742
Problems modified TPESampler and not TYPESampler
Aug 21, 2025
5784ff7
Problems modified TPESampler and not TYPESampler
Aug 21, 2025
7e17379
Test modified with number of epochs as parameter
Aug 21, 2025
082de05
Eliminated trained model
Aug 21, 2025
5ed00a9
Changed the test estimated hellinger for windows
Aug 21, 2025
e59a941
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 21, 2025
3a9f16c
Changed the test estimated hellinger for windows
Aug 21, 2025
c43ee01
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
Aug 21, 2025
92eda99
Changed the test estimated hellinger for windows
Aug 21, 2025
dc1aa55
Problem with windows solved eliminating warning
Aug 21, 2025
6809ccb
Files modified according suggestion
Aug 22, 2025
8c77598
Fixed the comments related to test hellinger distance and utils
antotu Aug 25, 2025
dc0a824
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 25, 2025
2419952
Fixed modification also with pre-commit
antotu Aug 25, 2025
5335241
Fixed modification also with pre-commit
antotu Aug 25, 2025
96096a0
Refactor the test ml predictor considering to join function related M…
antotu Aug 25, 2025
4613012
Modified part of helper in order to solve problems code
antotu Aug 26, 2025
1c728e2
Pre-commit has substituted Wille in Will
antotu Aug 26, 2025
c31cb46
Update tests/device_selection/test_predictor_ml.py
antotu Aug 27, 2025
13cf0f4
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 27, 2025
713343f
first round fixes
antotu Aug 27, 2025
17c6575
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 27, 2025
169b00e
pre-commit fixes
antotu Aug 27, 2025
2248081
pre-commit fixes
antotu Aug 27, 2025
8f90b12
Update src/mqt/predictor/ml/predictor.py
antotu Aug 27, 2025
74ec34b
Update src/mqt/predictor/ml/predictor.py
antotu Aug 27, 2025
f99e17b
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 27, 2025
57b1a29
Partial modification
antotu Aug 27, 2025
96232f0
Merge branch 'gnn-branch' of github.com:antotu/predictor-gnn into gnn…
antotu Aug 27, 2025
61965d8
🎨 pre-commit fixes
pre-commit-ci[bot] Aug 27, 2025
93f5414
fixed comments repo
antotu Aug 27, 2025
95f5359
Merge branch 'gnn-branch' of github.com:antotu/predictor-gnn into gnn…
antotu Aug 27, 2025
4fb7112
Modified the gates accepted
antotu Aug 28, 2025
5ea1720
Modified list
antotu Aug 28, 2025
312e6ea
Fixed bug Swap and Cswap gates
antotu Sep 8, 2025
156b7e6
Edit for saving memory GPU
antotu Sep 12, 2025
77c9f5c
Added patience as variable
antotu Oct 6, 2025
1ff39e1
Updated GNN for predictions
antotu Nov 24, 2025
5a2d583
partial modification guessed by bot
antotu Nov 24, 2025
820895c
eliminated italian comments
antotu Nov 24, 2025
8b0b51f
eliminated italian comments
antotu Nov 24, 2025
de738df
eliminated redundancy torch_clamp
antotu Nov 24, 2025
794896e
removed small errors
antotu Nov 24, 2025
29761dc
solved partial errors
antotu Nov 25, 2025
3716688
Merge branch 'main' into gnn-branch
antotu Nov 25, 2025
65b409b
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 25, 2025
ef8e567
Corrected for the lint
antotu Nov 25, 2025
a734050
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
antotu Nov 25, 2025
a43dd5a
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 25, 2025
07e937e
error deprecation warning of a useless library
antotu Nov 25, 2025
1e29f6b
error deprecation warning of a useless library
antotu Nov 25, 2025
6dc9d28
small error correction
antotu Nov 25, 2025
f664616
small error correction
antotu Nov 25, 2025
f97e164
small error correction
antotu Nov 25, 2025
2e9cc1e
problem torch_geometric
antotu Nov 25, 2025
1a8b1a4
problem torch_geometric
antotu Nov 25, 2025
595469e
problem torch_geometric
antotu Nov 26, 2025
15d4814
problem torch_geometric
antotu Nov 26, 2025
ca5339e
lightweight import
antotu Nov 26, 2025
ddb6f50
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 26, 2025
a2cca5c
lightweight import
antotu Nov 26, 2025
af38ff4
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
antotu Nov 26, 2025
fc48550
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 26, 2025
92897cb
lightweight import
antotu Nov 26, 2025
f27358f
return back
antotu Nov 26, 2025
3af112a
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 26, 2025
88256c9
modified version to solve the warning of deprecation
antotu Nov 26, 2025
2cf80d1
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
antotu Nov 26, 2025
be5210b
modified version to solve the warning of deprecation
antotu Nov 26, 2025
2e28a14
Try to fix error for windows
antotu Nov 26, 2025
1e4a279
fixed some code coverage
antotu Nov 26, 2025
e9f698e
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 26, 2025
ea825ff
Consider also verbose
antotu Nov 27, 2025
e28dc60
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
antotu Nov 27, 2025
620a1d7
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 27, 2025
c258fe0
Consider also verbose
antotu Nov 27, 2025
29cf56a
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
antotu Nov 27, 2025
f412af8
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 27, 2025
3c077b1
Consider also verbose
antotu Nov 27, 2025
8b79177
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
antotu Nov 27, 2025
2a9457d
Consider adjusted estiamted hellinger distance as regression problem
antotu Nov 27, 2025
77cca31
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 27, 2025
1acc0cb
Fixed regression
antotu Nov 27, 2025
64a94ff
Fixed regression
antotu Nov 27, 2025
c4cc835
Adjusted threshold for test regression
antotu Nov 28, 2025
7acbec7
Fixed some code lines for more clarity
antotu Nov 28, 2025
6ebded4
🎨 pre-commit fixes
pre-commit-ci[bot] Nov 28, 2025
6207f97
Merge branch 'main' into gnn-branch
antotu Nov 28, 2025
5828e7f
Modified a comment on test estimated_hellinger_distance
antotu Nov 28, 2025
a09b7dc
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
antotu Nov 28, 2025
fa7c1f7
Minor fixes
Dec 8, 2025
fa75639
Minor fixes
Dec 8, 2025
cfb74ed
Merge branch 'main' into gnn-branch
antotu Dec 8, 2025
a11f7ea
Minor fixes
Dec 8, 2025
1bd824e
Minor fixes
Dec 8, 2025
f3d7c55
Minor fixes
Dec 8, 2025
0992bd0
Minor fixes
Dec 8, 2025
2e08905
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 8, 2025
84165a2
Minor fixes
Dec 8, 2025
a67b92b
Minor fixes
Dec 8, 2025
909ce80
Minor fixes found
Dec 9, 2025
1246856
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 9, 2025
f3ac221
Minor fixes found
Dec 9, 2025
77f4889
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
Dec 9, 2025
0558921
Minor fixes found: error in predicting hellinger distance
Dec 9, 2025
462e57c
Minor fixes found: error in predicting hellinger distance
Dec 9, 2025
a6ada4d
Minor fixes found: error in predicting hellinger distance
Dec 9, 2025
81d05af
Minor modifications
Dec 9, 2025
26fcc32
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 9, 2025
41f3dc8
Minor modifications
Dec 9, 2025
ecd5981
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
Dec 9, 2025
98cc955
Minor modifications
Dec 9, 2025
f3d17ce
Minor modifications
Dec 9, 2025
678f408
Minor modifications
Dec 9, 2025
c903056
Minor fixes code and change of libraries
Dec 10, 2025
128fcb6
Minor fixes code and change of libraries
Dec 10, 2025
2652119
Reduced ignore on warning, modified doc, and minor fixes
Dec 10, 2025
df44c8c
Modified documentation
Dec 10, 2025
92e93ea
Modified documentation
Dec 10, 2025
50b7a66
Modified documentation
Dec 10, 2025
cdaa495
Modified taking into account to not use .pt for saving dataset
Dec 10, 2025
3f8ed63
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 10, 2025
cdd19f5
Modified not using pt for getting the dataset
Dec 10, 2025
5816e2a
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
Dec 10, 2025
7a3999a
Modified not using pt for getting the dataset
Dec 10, 2025
3884aa4
Fixes for code rabbit AI
Dec 10, 2025
99ad6e4
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 10, 2025
a5fd1c9
Minor fixes
Dec 10, 2025
e3050f1
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
Dec 10, 2025
e8c50b7
Minor fixes
Dec 10, 2025
b23cee5
Minor fixes
Dec 10, 2025
cb03412
🎨 pre-commit fixes
pre-commit-ci[bot] Dec 10, 2025
d072b42
Minor fixes
Dec 10, 2025
b1ad8d3
Merge branch 'gnn-branch' of https://github.com/antotu/predictor-gnn …
Dec 10, 2025
a4e2671
Minor fixes
Dec 10, 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
14 changes: 13 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ dependencies = [
"numpy>=1.26; python_version >= '3.12'",
"numpy>=1.24; python_version >= '3.11'",
"numpy>=1.22",
"numpy>=1.22,<2; sys_platform == 'darwin' and 'x86_64' in platform_machine and python_version < '3.13'", # Restrict numpy v2 for macOS x86 since it is not supported anymore since torch v2.3.0
"optuna>=4.5.0",
"torch-geometric>=2.6.1,<2.7.0",
"torch>=2.7.1,<2.8.0; sys_platform == 'darwin' and 'x86_64' in platform_machine and python_version < '3.13'", # Restrict torch v2.3.0 for macOS x86 since it is not supported anymore.
"typing-extensions>=4.1", # for `assert_never`
]

Expand Down Expand Up @@ -118,6 +122,8 @@ xfail_strict = true
filterwarnings = [
'error',
'ignore:.*pytorch.*:UserWarning:',
"ignore:.*torch_geometric.*:UserWarning:",
"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 @@ -126,6 +132,7 @@ 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::DeprecationWarning:torch_geometric\\.distributed.*",
]

[tool.coverage]
Expand Down Expand Up @@ -163,9 +170,13 @@ implicit_reexport = true
# 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.*"]
module = ["qiskit.*", "joblib.*", "sklearn.*", "matplotlib.*", "gymnasium.*", "mqt.bench.*", "sb3_contrib.*", "bqskit.*", "qiskit_ibm_runtime.*", "networkx.*", "stable_baselines3.*", "torch", "torch.*", "torch_geometric", "torch_geometric.*", "optuna.*"]
ignore_missing_imports = true

[[tool.mypy.overrides]]
module = ["mqt.predictor.ml.*"]
disallow_subclassing_any = false

[tool.ruff]
line-length = 120
extend-include = ["*.ipynb"]
Expand Down Expand Up @@ -247,6 +258,7 @@ wille = "wille"
anc = "anc"
aer = "aer"
fom = "fom"
TPE = "TPE"

[tool.repo-review]
ignore = [
Expand Down
40 changes: 40 additions & 0 deletions src/mqt/predictor/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2023 - 2025 Chair for Design Automation, TUM
# Copyright (c) 2025 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
from __future__ import annotations

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

TYPE_CHECKING = False
if TYPE_CHECKING:
VERSION_TUPLE = tuple[int | str, ...]

Check warning

Code scanning / CodeQL

Unreachable code Warning

This statement is unreachable.
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.dev719+g5ea17201a.d20250908"
__version_tuple__ = version_tuple = (0, 1, "dev719", "g5ea17201a.d20250908")

__commit_id__ = commit_id = None
15 changes: 8 additions & 7 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:
def get_hellinger_model_path(device: Target, *, gnn: bool = False) -> 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")
training_data_path = Path(str(resources.files("mqt.predictor"))) / "ml" / "training_data" / "trained_model"
device_description = str(device.description)
filename = (
("trained_hellinger_distance_regressor_gnn_" + device_description + ".pth")
if gnn
else ("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