Skip to content

Commit 2be7d02

Browse files
authored
Merge branch 'main' into new_structure
Signed-off-by: Shaobo-Zhou <109073755+Shaobo-Zhou@users.noreply.github.com>
2 parents 44e0e40 + a0d2dc3 commit 2be7d02

File tree

13 files changed

+128
-109
lines changed

13 files changed

+128
-109
lines changed

.github/renovate.json5

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
$schema: "https://docs.renovatebot.com/renovate-schema.json",
3-
extends: ["config:recommended", ":gitSignOff", "helpers:pinGitHubActionDigests"],
3+
extends: ["config:recommended", ":gitSignOff", "helpers:pinGitHubActionDigestsToSemver"],
44
prHourlyLimit: 10,
55
enabledManagers: ["cargo", "github-actions", "npm", "pep621", "pre-commit"],
66
"pre-commit": {

.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 # v1.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/reusable-change-detection.yml@v1.16
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/reusable-python-linter.yml@v1.16
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)

.github/workflows/templating.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
with:
1919
app-id: ${{ secrets.APP_ID }}
2020
private-key: ${{ secrets.APP_PRIVATE_KEY }}
21-
- uses: munich-quantum-toolkit/templates@79179b743b3909010c5df4073cbb110eb6e0167b # v1.1.5
21+
- uses: munich-quantum-toolkit/templates@c31f629609147889858088dcd368b8dbcc71bd44 # v1.1.6
2222
with:
2323
token: ${{ steps.create-token.outputs.token }}
2424
name: Predictor

.pre-commit-config.yaml

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@ 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

6666
# Also run Black on examples in the documentation
6767
- repo: https://github.com/adamchainz/blacken-docs
68-
rev: 1.19.1
68+
rev: 1.20.0
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
@@ -85,7 +85,7 @@ repos:
8585

8686
# Check static types with mypy
8787
- repo: https://github.com/pre-commit/mirrors-mypy
88-
rev: v1.17.1
88+
rev: v1.18.1
8989
hooks:
9090
- id: mypy
9191
files: ^(src/mqt|test/python)
@@ -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/installation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Installation
55

66
MQT Predictor is a Python package available on [PyPI](https://pypi.org/project/mqt.predictor/).
7-
It can be installed on all major operating systems with all supported Python versions.
7+
It can be installed on all major operating systems with all [officially supported Python versions](https://devguide.python.org/versions/).
88

99
:::::{tip}
1010
:name: uv-recommendation

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
@@ -225,7 +225,10 @@ ignore = [
225225
"S101", # Use of assert detected
226226
]
227227
flake8-unused-arguments.ignore-variadic-names = true
228-
isort.required-imports = ["from __future__ import annotations"]
228+
future-annotations = true
229+
230+
[tool.ruff.lint.isort]
231+
known-first-party = ["mqt.predictor"]
229232

230233
[tool.ruff.lint.per-file-ignores]
231234
"*.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.

0 commit comments

Comments
 (0)