Skip to content

Commit 3179789

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents dde15d3 + 119c781 commit 3179789

13 files changed

+58
-33
lines changed

.github/workflows/cd.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ on:
1010
jobs:
1111
python-packaging:
1212
name: 🐍 Packaging
13-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.2.1
13+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-packaging.yml@v1.3
1414

1515
deploy:
1616
if: github.event_name == 'release' && github.event.action == 'published'

.github/workflows/ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ concurrency:
1414
jobs:
1515
change-detection:
1616
name: 🔍 Change
17-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.2.1
17+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-change-detection.yml@v1.3
1818

1919
cpp-tests:
2020
name: 🇨‌ Test
2121
needs: change-detection
2222
if: fromJSON(needs.change-detection.outputs.run-cpp-tests)
23-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.2.1
23+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-ci.yml@v1.3
2424
with:
2525
cmake-args: ""
2626
cmake-args-ubuntu: -G Ninja
@@ -31,21 +31,21 @@ jobs:
3131
name: 🇨‌ Lint
3232
needs: change-detection
3333
if: fromJSON(needs.change-detection.outputs.run-cpp-linter)
34-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.2.1
34+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-cpp-linter.yml@v1.3
3535

3636
python-tests:
3737
name: 🐍 Test
3838
needs: change-detection
3939
if: fromJSON(needs.change-detection.outputs.run-python-tests)
40-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-ci.yml@v1.2.1
40+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-python-ci.yml@v1.3
4141
with:
4242
skip-testing-latest-python: true
4343

4444
code-ql:
4545
name: 📝 CodeQL
4646
needs: change-detection
4747
if: fromJSON(needs.change-detection.outputs.run-code-ql)
48-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.2.1
48+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-code-ql.yml@v1.3
4949

5050
required-checks-pass: # This job does nothing and is only used for branch protection
5151
name: 🚦 Check

.github/workflows/update-mqt-core.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ concurrency:
2121
jobs:
2222
update-mqt-core:
2323
name: ⬆️ Update MQT Core
24-
uses: cda-tum/mqt-workflows/.github/workflows/reusable-mqt-core-update.yml@v1.1.5
24+
uses: cda-tum/mqt-workflows/.github/workflows/reusable-mqt-core-update.yml@v1.3
2525
with:
26-
update-to-head: ${{ fromJSON(github.event.inputs.update-to-head) || false }}
26+
update-to-head: ${{ github.event.inputs.update-to-head || false }}

.pre-commit-config.yaml

+18-5
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ repos:
5656

5757
# Python linting and formatting using ruff
5858
- repo: https://github.com/astral-sh/ruff-pre-commit
59-
rev: v0.5.6
59+
rev: v0.5.7
6060
hooks:
6161
- id: ruff
6262
args: ["--fix", "--show-fixes"]
@@ -107,11 +107,10 @@ repos:
107107
- pytest
108108

109109
# Check for spelling
110-
- repo: https://github.com/codespell-project/codespell
111-
rev: v2.3.0
110+
- repo: https://github.com/crate-ci/typos
111+
rev: v1.23.6
112112
hooks:
113-
- id: codespell
114-
args: ["-L", "wille,linz", "--skip", "*.ipynb"]
113+
- id: typos
115114

116115
# Catch common capitalization mistakes
117116
- repo: local
@@ -128,3 +127,17 @@ repos:
128127
hooks:
129128
- id: sp-repo-review
130129
additional_dependencies: ["repo-review[cli]"]
130+
131+
# Check JSON schemata
132+
- repo: https://github.com/python-jsonschema/check-jsonschema
133+
rev: 0.29.1
134+
hooks:
135+
- id: check-dependabot
136+
- id: check-github-workflows
137+
- id: check-readthedocs
138+
139+
# Check the pyproject.toml file
140+
- repo: https://github.com/henryiii/validate-pyproject-schema-store
141+
rev: 2024.08.08
142+
hooks:
143+
- id: validate-pyproject

cmake/ExternalDependencies.cmake

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ if(BUILD_MQT_QCEC_BINDINGS)
2020
endif()
2121

2222
# cmake-format: off
23-
set(MQT_CORE_VERSION 2.5.1
23+
set(MQT_CORE_VERSION 2.6.0
2424
CACHE STRING "MQT Core version")
25-
set(MQT_CORE_REV "35e06ca3067ca3cf36bda1f0c38edf5bd7456fb6"
25+
set(MQT_CORE_REV "2a7a92951fb67d0c4e795afbd17449063aa42d20"
2626
CACHE STRING "MQT Core identifier (tag, branch or commit hash)")
2727
set(MQT_CORE_REPO_OWNER "cda-tum"
2828
CACHE STRING "MQT Core repository owner (change when using a fork)")

docs/source/ParameterizedCircuits.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"\n",
1212
"Variational quantum algorithms are a family of mixed quantum-classical algorithms that try to achieve a quantum advantage via low-depth circuits. This is achieved by offloading a substantial amount of computational work to a classical processor. The quantum circuits employed by variational quantum algorithms involve *parameterized gates* which depend on some a-priori uninstantiated variable.\n",
1313
"\n",
14-
"Variational quantum algorithms try to optimize the circuit's parameters in each iteration with the classical post-processor while the quantum circuit is used to compute the cost function that is being optimized. Because recompiling the quantum circuit in each of these iterations is a costly procedure, the circuit is usually compiled in *paramterized* form in which the parameters tuned by the classical optimization routine are not bound to specific values.\n",
14+
"Variational quantum algorithms try to optimize the circuit's parameters in each iteration with the classical post-processor while the quantum circuit is used to compute the cost function that is being optimized. Because recompiling the quantum circuit in each of these iterations is a costly procedure, the circuit is usually compiled in *parameterized* form in which the parameters tuned by the classical optimization routine are not bound to specific values.\n",
1515
"\n",
1616
"As is the case with parameter-free circuits, errors can be made during the compilation process. Therefore, verifying the correctness of compilations of parameterized quantum circuits is an important task for near-term quantum computing.\n",
1717
"\n",

docs/source/PartialEquivalence.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@
103103
"id": "10fff8c7-f36c-422e-8deb-796cc7637e45",
104104
"metadata": {},
105105
"source": [
106-
"Aditionally, consider the following circuit, which only acts on two qubits."
106+
"Additionally, consider the following circuit, which only acts on two qubits."
107107
]
108108
},
109109
{

noxfile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# and get better caching performance. This only concerns dependencies that are
2727
# not available via wheels on PyPI (i.e., only as source distributions).
2828
BUILD_REQUIREMENTS = [
29-
"scikit-build-core[pyproject]>=0.8.1",
29+
"scikit-build-core[pyproject]>=0.10.1",
3030
"setuptools_scm>=7",
3131
"pybind11>=2.13",
3232
"wheel>=0.40", # transitive dependency of pytest on Windows

pyproject.toml

+19-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["scikit-build-core>=0.8.1", "setuptools-scm>=7", "pybind11>=2.13"]
2+
requires = ["scikit-build-core>=0.10.1", "setuptools-scm>=7", "pybind11>=2.13"]
33
build-backend = "scikit_build_core.build"
44

55
[project]
@@ -71,23 +71,22 @@ Discussions = "https://github.com/cda-tum/mqt-qcec/discussions"
7171

7272
[tool.scikit-build]
7373
# Protect the configuration against future changes in scikit-build-core
74-
minimum-version = "0.8.1"
74+
minimum-version = "build-system.requires"
7575

7676
# Set the wheel install directory
7777
wheel.install-dir = "mqt/qcec"
7878

79-
# Set required CMake and Ninja versions
80-
cmake.version = ">=3.19"
79+
# Set required Ninja version
8180
ninja.version = ">=1.10"
8281

8382
# Setuptools-style build caching in a local directory
84-
build-dir = "build/{wheel_tag}"
83+
build-dir = "build/{build_type}"
8584

8685
# Explicitly set the package directory
8786
wheel.packages = ["src/mqt"]
8887

8988
# Only build the Python bindings target
90-
cmake.targets = ["pyqcec"]
89+
build.targets = ["pyqcec"]
9190

9291
# Only install the Python package component
9392
install.components = ["mqt-qcec_Python"]
@@ -257,8 +256,21 @@ isort.required-imports = ["from __future__ import annotations"]
257256
convention = "google"
258257

259258

259+
[tool.typos]
260+
default.extend-ignore-re = [
261+
'"id": ".*",',
262+
"(?Rm)^.*(#|//)\\s*spellchecker:disable-line$", # ignore line
263+
"(?s)(#|//)\\s*spellchecker:off.*?\\n\\s*(#|//)\\s*spellchecker:on" # ignore block
264+
]
265+
[tool.typos.default.extend-words]
266+
wille = "wille"
267+
anc = "anc"
268+
aer = "aer"
269+
270+
260271
[tool.repo-review]
261272
ignore = [
273+
"PC160", # "Uses codespell" -> switched to https://github.com/crate-ci/typos
262274
"PC180", # "Uses prettier" -> switched to different prettier-mirror that is not recognized by the check
263275
]
264276

@@ -281,4 +293,4 @@ environment = { MACOSX_DEPLOYMENT_TARGET = "10.15" }
281293
[tool.cibuildwheel.windows]
282294
before-build = "pip install delvewheel>=1.7.3"
283295
repair-wheel-command = "delvewheel repair -v -w {dest_dir} {wheel} --namespace-pkg mqt"
284-
environment = { CMAKE_ARGS = "-T ClangCL" }
296+
environment = { CMAKE_ARGS = "-T ClangCL", SKBUILD_CMAKE_ARGS="--fresh" }

src/checker/EquivalenceChecker.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <nlohmann/json.hpp>
1111

1212
// this function is mainly placed here in order to have an out-of-line
13-
// virtual method definition which avoids emitting the classe's vtable in
13+
// virtual method definition which avoids emitting the classes' vtable in
1414
// every translation unit.
1515
void ec::EquivalenceChecker::json(nlohmann::basic_json<>& j) const noexcept {
1616
j["equivalence"] = toString(equivalence);

src/mqt/qcec/compilation_flow_profiles.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def create_gate_profile_data(
265265
cost = compute_cost(qc, basis_gates, optimization_level)
266266

267267
# add the cost to the profile data
268-
profile_data[(gate, control)] = cost
268+
profile_data[gate, control] = cost
269269
return profile_data
270270

271271

@@ -360,7 +360,7 @@ def find_continuation(
360360
if next_term >= prediction_cutoff:
361361
break
362362
sequence.append(next_term)
363-
profile_data[(gate, max_control + i + 1)] = next_term
363+
profile_data[gate, max_control + i + 1] = next_term
364364

365365

366366
gate_collection_for_mode = {

test/python/test_symbolic.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ def test_non_equivalent_phase_rz_commute(
138138
assert result.equivalence == qcec.EquivalenceCriterion.not_equivalent
139139

140140

141-
def test_equivalent_roation_gate_fuse(
141+
def test_equivalent_rotation_gate_fuse(
142142
rotation_gate_fuse_lhs: QuantumCircuit, rotation_gate_fuse_rhs_correct: QuantumCircuit
143143
) -> None:
144144
"""Test a rotation gate fusion rule."""
145145
result = qcec.verify(rotation_gate_fuse_lhs, rotation_gate_fuse_rhs_correct)
146146
assert result.equivalence == qcec.EquivalenceCriterion.equivalent
147147

148148

149-
def test_non_equivalent_roation_gate_fuse(
149+
def test_non_equivalent_rotation_gate_fuse(
150150
rotation_gate_fuse_lhs: QuantumCircuit, rotation_gate_fuse_rhs_incorrect: QuantumCircuit
151151
) -> None:
152152
"""Test an invalid rotation gate fusion rule."""

test/test_partial_equivalence.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ void addStandardOperationToCircuit(QuantumComputation& circuit,
103103
}
104104

105105
std::vector<qc::Qubit>
106-
fiveDiffferentRandomNumbers(const qc::Qubit min, const qc::Qubit max,
107-
std::mt19937_64& randomGenerator) {
106+
fiveDifferentRandomNumbers(const qc::Qubit min, const qc::Qubit max,
107+
std::mt19937_64& randomGenerator) {
108108
std::vector<qc::Qubit> numbers;
109109

110110
for (qc::Qubit i = min; i < max; i++) {
@@ -202,7 +202,7 @@ StandardOperation
202202
makeRandomStandardOperation(const qc::Qubit nrQubits, const qc::Qubit min,
203203
std::mt19937_64& randomGenerator) {
204204
const auto randomNumbers =
205-
fiveDiffferentRandomNumbers(min, min + nrQubits, randomGenerator);
205+
fiveDifferentRandomNumbers(min, min + nrQubits, randomGenerator);
206206

207207
// choose one of the non-compound operations, but not "None", and also
208208
// not GPhase or I or Barrier

0 commit comments

Comments
 (0)