Skip to content

Commit c8fdb0d

Browse files
denialhaagpre-commit-ci[bot]burgholzer
authored
👷 Update workflows and pre-commit config (#452)
## Description This PR updates workflows that are currently not detected by Renovate. Furthermore, this PR updates the `pre-commit` configuration for `ruff` and the `ruff` configuration itself. ## Checklist: - [x] The pull request only contains commits that are focused and relevant to this change. - [x] ~I have added appropriate tests that cover the new/changed functionality.~ - [x] ~I have updated the documentation to reflect these changes.~ - [x] ~I have added entries to the changelog for any noteworthy additions, changes, fixes, or removals.~ - [x] ~I have added migration instructions to the upgrade guide (if needed).~ - [x] The changes follow the project's style guidelines and introduce no new warnings. - [x] The changes are fully tested and pass the CI checks. - [x] I have reviewed my own code changes. --------- Signed-off-by: Daniel Haag <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Lukas Burgholzer <[email protected]>
1 parent 48de5ac commit c8fdb0d

File tree

10 files changed

+125
-105
lines changed

10 files changed

+125
-105
lines changed

.github/workflows/cd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ on:
1010
jobs:
1111
build-sdist:
1212
name: 🐍 Packaging
13-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@v1.16
13+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
1414

1515
build-wheel:
1616
name: 🐍 Packaging
17-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@v1.16
17+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
1818

1919
deploy:
2020
if: github.event_name == 'release' && github.event.action == 'published'
@@ -38,4 +38,4 @@ jobs:
3838
uses: actions/attest-build-provenance@v3
3939
with:
4040
subject-path: "dist/*"
41-
- uses: pypa/gh-action-pypi-publish@release/v1
41+
- uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # 1.13.0

.github/workflows/ci.yml

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ concurrency:
1414
jobs:
1515
change-detection:
1616
name: 🔍 Change
17-
uses: munich-quantum-toolkit/workflows/.github/workflows/[email protected]
18-
19-
python-linter:
20-
name: 🐍 Lint
21-
needs: change-detection
22-
if: fromJSON(needs.change-detection.outputs.run-python-tests)
23-
uses: munich-quantum-toolkit/workflows/.github/workflows/[email protected]
17+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-change-detection.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
2418

2519
python-tests:
2620
name: 🐍 Test
@@ -30,62 +24,57 @@ jobs:
3024
fail-fast: false
3125
matrix:
3226
runs-on: [ubuntu-24.04, macos-14, windows-2022]
33-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@v1.16
27+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-tests.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
3428
with:
3529
runs-on: ${{ matrix.runs-on }}
3630

3731
python-coverage:
3832
name: 🐍 Coverage
3933
needs: [change-detection, python-tests]
4034
if: fromJSON(needs.change-detection.outputs.run-python-tests)
41-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@v1.16
35+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-coverage.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
4236
permissions:
4337
contents: read
4438
id-token: write
4539

46-
code-ql:
47-
name: 📝 CodeQL
40+
python-linter:
41+
name: 🐍 Lint
4842
needs: change-detection
49-
if: fromJSON(needs.change-detection.outputs.run-code-ql)
50-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-code-ql-python.yml@v1.16
43+
if: fromJSON(needs.change-detection.outputs.run-python-tests)
44+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-linter.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
5145

5246
build-sdist:
5347
name: 🚀 CD
5448
needs: change-detection
5549
if: fromJSON(needs.change-detection.outputs.run-cd)
56-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@v1.16
50+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-sdist.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
5751

5852
build-wheel:
5953
name: 🚀 CD
6054
needs: change-detection
6155
if: fromJSON(needs.change-detection.outputs.run-cd)
62-
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@v1.16
56+
uses: munich-quantum-toolkit/workflows/.github/workflows/reusable-python-packaging-wheel-build.yml@56cf3608b07dc10bda5b98d77ed6ad21ecf7ef5d # v1.17.0
6357

6458
# this job does nothing and is only used for branch protection
6559
required-checks-pass:
6660
name: 🚦 Check
6761
if: always()
6862
needs:
6963
- change-detection
70-
- python-linter
7164
- python-tests
7265
- python-coverage
73-
- code-ql
66+
- python-linter
7467
- build-sdist
7568
- build-wheel
7669
runs-on: ubuntu-latest
7770
steps:
7871
- name: Decide whether the needed jobs succeeded or failed
79-
uses: re-actors/alls-green@release/v1
72+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
8073
with:
8174
allowed-skips: >-
8275
${{
8376
fromJSON(needs.change-detection.outputs.run-python-tests)
84-
&& '' || 'python-linter,python-tests,python-coverage,'
85-
}}
86-
${{
87-
fromJSON(needs.change-detection.outputs.run-code-ql)
88-
&& '' || 'code-ql,'
77+
&& '' || 'python-tests,python-coverage,python-linter'
8978
}}
9079
${{
9180
fromJSON(needs.change-detection.outputs.run-cd)

.pre-commit-config.yaml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ repos:
5757

5858
# Python linting and formatting using ruff
5959
- repo: https://github.com/astral-sh/ruff-pre-commit
60-
rev: v0.12.12
60+
rev: v0.13.0
6161
hooks:
62-
- id: ruff
62+
- id: ruff-check
6363
args: ["--fix", "--show-fixes"]
6464
- id: ruff-format
6565

@@ -68,7 +68,7 @@ repos:
6868
rev: 1.19.1
6969
hooks:
7070
- id: blacken-docs
71-
additional_dependencies: [black==24.*]
71+
additional_dependencies: [black==25.*]
7272

7373
# Check for license headers
7474
- repo: https://github.com/emzeat/mz-lictools
@@ -134,6 +134,24 @@ repos:
134134

135135
# Check the pyproject.toml file
136136
- repo: https://github.com/henryiii/validate-pyproject-schema-store
137-
rev: 2025.06.23
137+
rev: 2025.09.12
138138
hooks:
139139
- id: validate-pyproject
140+
141+
# Tidy up BibTeX files
142+
- repo: https://github.com/FlamingTempura/bibtex-tidy
143+
rev: v1.14.0
144+
hooks:
145+
- id: bibtex-tidy
146+
args:
147+
[
148+
"--align=20",
149+
"--curly",
150+
"--months",
151+
"--blank-lines",
152+
"--sort",
153+
"--strip-enclosing-braces",
154+
"--sort-fields",
155+
"--trailing-commas",
156+
"--remove-empty-fields",
157+
]

CITATION.bib

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
@ARTICLE{quetschlich2025mqtpredictor,
2-
AUTHOR = {N. Quetschlich and L. Burgholzer and R. Wille},
3-
TITLE = {{MQT Predictor: Automatic Device Selection with Device-Specific Circuit Compilation for Quantum Computing}},
4-
YEAR = {2025},
5-
JOURNAL = {ACM Transactions on Quantum Computing (TQC)},
6-
DOI = {10.1145/3673241},
7-
EPRINT = {2310.06889},
8-
EPRINTTYPE = {arxiv},
1+
@article{quetschlich2025mqtpredictor,
2+
title = {MQT Predictor: Automatic Device Selection with Device-Specific Circuit Compilation for Quantum Computing},
3+
author = {N. Quetschlich and L. Burgholzer and R. Wille},
4+
year = {2025},
5+
journal = {ACM Transactions on Quantum Computing (TQC)},
6+
doi = {10.1145/3673241},
7+
eprint = {2310.06889},
8+
eprinttype = {arxiv},
99
}

docs/refs.bib

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,85 @@
11
@article{esp-idle,
2-
title = {Suppressing Quantum Circuit Errors Due to System Variability},
3-
author = {Nation, Paul D. and Treinish, Matthew},
4-
year = {2023},
5-
journal = {PRX Quantum},
6-
doi = {10.1103/PRXQuantum.4.010327},
7-
url = {https://link.aps.org/doi/10.1103/PRXQuantum.4.010327}
2+
title = {Suppressing Quantum Circuit Errors Due to System Variability},
3+
author = {Nation, Paul D. and Treinish, Matthew},
4+
year = {2023},
5+
journal = {PRX Quantum},
6+
doi = {10.1103/PRXQuantum.4.010327},
7+
url = {https://link.aps.org/doi/10.1103/PRXQuantum.4.010327},
88
}
99

1010
@misc{esp-lifetime,
11-
title = {Clifford Assisted Optimal Pass Selection for Quantum Transpilation},
12-
author = {Siddharth Dangwal and Gokul Subramanian Ravi and Lennart Maximilian Seifert and Frederic T. Chong},
13-
year = {2023},
14-
url = {https://arxiv.org/abs/2306.15020},
15-
note = {arXiv 2306.15020},
16-
eprint = {2306.15020},
17-
archiveprefix = {arXiv},
18-
primaryclass = {quant-ph}
11+
title = {Clifford Assisted Optimal Pass Selection for Quantum Transpilation},
12+
author = {Siddharth Dangwal and Gokul Subramanian Ravi and Lennart Maximilian Seifert and Frederic T. Chong},
13+
year = {2023},
14+
url = {https://arxiv.org/abs/2306.15020},
15+
note = {arXiv 2306.15020},
16+
eprint = {2306.15020},
17+
archiveprefix = {arXiv},
18+
primaryclass = {quant-ph},
1919
}
2020

2121
@inproceedings{esp-lifetime-min,
22-
title = {Software Mitigation of Crosstalk on Noisy Intermediate-Scale Quantum Computers},
23-
author = {Murali, Prakash and Mckay, David C. and Martonosi, Margaret and Javadi-Abhari, Ali},
24-
year = {2020},
25-
booktitle = {Proceedings of the Twenty-Fifth Int'l Conf. on Architectural Support for Programming Languages and Operating Systems},
26-
doi = {10.1145/3373376.3378477},
27-
url = {http://dx.doi.org/10.1145/3373376.3378477}
22+
title = {Software Mitigation of Crosstalk on Noisy Intermediate-Scale Quantum Computers},
23+
author = {Murali, Prakash and Mckay, David C. and Martonosi, Margaret and Javadi-Abhari, Ali},
24+
year = {2020},
25+
booktitle = {Proceedings of the Twenty-Fifth Int'l Conf. on Architectural Support for Programming Languages and Operating Systems},
26+
doi = {10.1145/3373376.3378477},
27+
url = {http://dx.doi.org/10.1145/3373376.3378477},
2828
}
2929

3030
@inproceedings{mqt,
31-
title = {The {{MQT}} Handbook: {{A}} Summary of Design Automation Tools and Software for Quantum Computing},
32-
shorttitle = {{The MQT Handbook}},
33-
author = {Wille, Robert and Berent, Lucas and Forster, Tobias and Kunasaikaran, Jagatheesan and Mato, Kevin and Peham, Tom and Quetschlich, Nils and Rovara, Damian and Sander, Aaron and Schmid, Ludwig and Schoenberger, Daniel and Stade, Yannick and Burgholzer, Lukas},
34-
year = {2024},
35-
booktitle = {IEEE International Conference on Quantum Software (QSW)},
36-
doi = {10.1109/QSW62656.2024.00013},
37-
eprint = {2405.17543},
38-
eprinttype = {arxiv},
39-
addendum = {A live version of this document is available at \url{https://mqt.readthedocs.io}}
31+
title = {The {{MQT}} Handbook: {{A}} Summary of Design Automation Tools and Software for Quantum Computing},
32+
shorttitle = {The MQT Handbook},
33+
author = {Wille, Robert and Berent, Lucas and Forster, Tobias and Kunasaikaran, Jagatheesan and Mato, Kevin and Peham, Tom and Quetschlich, Nils and Rovara, Damian and Sander, Aaron and Schmid, Ludwig and Schoenberger, Daniel and Stade, Yannick and Burgholzer, Lukas},
34+
year = {2024},
35+
booktitle = {IEEE International Conference on Quantum Software (QSW)},
36+
doi = {10.1109/QSW62656.2024.00013},
37+
eprint = {2405.17543},
38+
eprinttype = {arxiv},
39+
addendum = {A live version of this document is available at \url{https://mqt.readthedocs.io}},
4040
}
4141

4242
@inproceedings{quetschlich2023compileroptimization,
43-
title = {{Compiler Optimization for Quantum Computing Using Reinforcement Learning}},
44-
author = {N. Quetschlich and L. Burgholzer and R. Wille},
45-
year = {2023},
46-
booktitle = {{Design Automation Conference (DAC)}},
47-
eprint = {2212.04508},
48-
eprinttype = {arxiv}
43+
title = {Compiler Optimization for Quantum Computing Using Reinforcement Learning},
44+
author = {N. Quetschlich and L. Burgholzer and R. Wille},
45+
year = {2023},
46+
booktitle = {Design Automation Conference (DAC)},
47+
eprint = {2212.04508},
48+
eprinttype = {arxiv},
4949
}
5050

5151
@inproceedings{quetschlich2023prediction,
52-
title = {{Predicting Good Quantum Circuit Compilation Options}},
53-
author = {N. Quetschlich and L. Burgholzer and R. Wille},
54-
year = {2023},
55-
booktitle = {IEEE International Conference on Quantum Software (QSW)},
56-
eprint = {2210.08027},
57-
eprinttype = {arxiv}
52+
title = {Predicting Good Quantum Circuit Compilation Options},
53+
author = {N. Quetschlich and L. Burgholzer and R. Wille},
54+
year = {2023},
55+
booktitle = {IEEE International Conference on Quantum Software (QSW)},
56+
eprint = {2210.08027},
57+
eprinttype = {arxiv},
5858
}
5959

6060
@inproceedings{quetschlich2024application_compilation,
61-
title = {{Towards Application-Aware Quantum Circuit Compilation}},
62-
author = {N. Quetschlich and F. J. Kiwit and M. A. Wolf and C. A. Riofrio and A. Luckow and L. Burgholzer and R. Wille},
63-
year = {2024},
64-
booktitle = {IEEE International Conference on Quantum Software (QSW)},
65-
eprint = {2404.12433},
66-
eprinttype = {arXiv}
61+
title = {Towards Application-Aware Quantum Circuit Compilation},
62+
author = {N. Quetschlich and F. J. Kiwit and M. A. Wolf and C. A. Riofrio and A. Luckow and L. Burgholzer and R. Wille},
63+
year = {2024},
64+
booktitle = {IEEE International Conference on Quantum Software (QSW)},
65+
eprint = {2404.12433},
66+
eprinttype = {arXiv},
6767
}
6868

6969
@article{quetschlich2025mqtpredictor,
70-
title = {{MQT Predictor: Automatic Device Selection with Device-Specific Circuit Compilation for Quantum Computing}},
71-
author = {N. Quetschlich and L. Burgholzer and R. Wille},
72-
year = {2025},
73-
journal = {ACM Transactions on Quantum Computing (TQC)},
74-
doi = {10.1145/3673241},
75-
eprint = {2310.06889},
76-
eprinttype = {arxiv}
70+
title = {MQT Predictor: Automatic Device Selection with Device-Specific Circuit Compilation for Quantum Computing},
71+
author = {N. Quetschlich and L. Burgholzer and R. Wille},
72+
year = {2025},
73+
journal = {ACM Transactions on Quantum Computing (TQC)},
74+
doi = {10.1145/3673241},
75+
eprint = {2310.06889},
76+
eprinttype = {arxiv},
7777
}
7878

7979
@misc{tomesh2022supermarq,
80-
title = {SupermarQ: A Scalable Quantum Benchmark Suite},
81-
author = {Teague Tomesh and Pranav Gokhale and Victory Omole and Gokul Subramanian Ravi and Kaitlin N. Smith and Joshua Viszlai and Xin-Chuan Wu and Nikos Hardavellas and Margaret R. Martonosi and Frederic T. Chong},
82-
year = {2022},
83-
eprint = {2202.11045},
84-
eprinttype = {arxiv}
80+
title = {SupermarQ: A Scalable Quantum Benchmark Suite},
81+
author = {Teague Tomesh and Pranav Gokhale and Victory Omole and Gokul Subramanian Ravi and Kaitlin N. Smith and Joshua Viszlai and Xin-Chuan Wu and Nikos Hardavellas and Margaret R. Martonosi and Frederic T. Chong},
82+
year = {2022},
83+
eprint = {2202.11045},
84+
eprinttype = {arxiv},
8585
}

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ ignore = [
220220
"S101", # Use of assert detected
221221
]
222222
flake8-unused-arguments.ignore-variadic-names = true
223-
isort.required-imports = ["from __future__ import annotations"]
223+
future-annotations = true
224+
225+
[tool.ruff.lint.isort]
226+
known-first-party = ["mqt.predictor"]
224227

225228
[tool.ruff.lint.per-file-ignores]
226229
"*.pyi" = ["D"] # pydocstyle

src/mqt/predictor/rl/parsing.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,21 @@
1212

1313
import operator
1414
from functools import cache
15+
from typing import TYPE_CHECKING
1516

1617
from bqskit.ir import gates
17-
from pytket import Circuit, Qubit
18+
from pytket import Qubit
1819
from pytket.circuit import Node
1920
from pytket.placement import place_with_map
20-
from qiskit import QuantumCircuit, QuantumRegister
21-
from qiskit.transpiler import Layout, PassManager, Target, TranspileLayout
21+
from qiskit import QuantumRegister
22+
from qiskit.transpiler import Layout, TranspileLayout
2223
from qiskit.transpiler.passes import ApplyLayout
2324

25+
if TYPE_CHECKING:
26+
from pytket import Circuit
27+
from qiskit import QuantumCircuit
28+
from qiskit.transpiler import PassManager, Target
29+
2430

2531
class PreProcessTKETRoutingAfterQiskitLayout:
2632
"""Pre-processing step to route a circuit with TKET after a Qiskit Layout pass has been applied.

src/mqt/predictor/rl/predictorenv.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
from pathlib import Path
2525

2626
from bqskit import Circuit
27+
from qiskit.transpiler import Target
2728

29+
from mqt.predictor.reward import figure_of_merit
2830
from mqt.predictor.rl.actions import Action
2931

3032

@@ -40,7 +42,7 @@
4042
from pytket.extensions.qiskit import qiskit_to_tk, tk_to_qiskit
4143
from qiskit import QuantumCircuit
4244
from qiskit.passmanager.flow_controllers import DoWhileController
43-
from qiskit.transpiler import CouplingMap, PassManager, Target, TranspileLayout
45+
from qiskit.transpiler import CouplingMap, PassManager, TranspileLayout
4446
from qiskit.transpiler.passes import CheckMap, GatesInBasis
4547
from qiskit.transpiler.passes.layout.vf2_layout import VF2LayoutStopReason
4648

@@ -51,7 +53,6 @@
5153
estimated_hellinger_distance,
5254
estimated_success_probability,
5355
expected_fidelity,
54-
figure_of_merit,
5556
)
5657
from mqt.predictor.rl.actions import CompilationOrigin, DeviceDependentAction, PassType, get_actions_by_pass_type
5758
from mqt.predictor.rl.helper import create_feature_dict, get_path_training_circuits, get_state_sample

tests/compilation/test_integration_further_SDKs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,14 @@
2323
from qiskit.transpiler.layout import TranspileLayout
2424
from qiskit.transpiler.passes import CheckMap, GatesInBasis
2525

26-
from mqt.predictor.rl.actions import Action, CompilationOrigin, PassType, get_actions_by_pass_type
26+
from mqt.predictor.rl.actions import CompilationOrigin, PassType, get_actions_by_pass_type
2727
from mqt.predictor.rl.parsing import final_layout_bqskit_to_qiskit, final_layout_pytket_to_qiskit
2828

2929
if TYPE_CHECKING:
3030
from qiskit.transpiler import Target
3131

32+
from mqt.predictor.rl.actions import Action
33+
3234

3335
@pytest.fixture
3436
def available_actions_dict() -> dict[str, Action]:

0 commit comments

Comments
 (0)