Skip to content

Commit fec5499

Browse files
authored
⬆️ update mqt-core (#460)
## Description This PR updates QCEC with the latest changes from MQT Core. It also contains a small configuration tweak for the noxfile. ## Checklist: <!--- This checklist serves as a reminder of a couple of things that ensure your pull request will be merged swiftly. --> - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines. --------- Signed-off-by: burgholzer <burgholzer@me.com>
1 parent 0d0121b commit fec5499

4 files changed

+11
-11
lines changed

cmake/ExternalDependencies.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ endif()
2222
# cmake-format: off
2323
set(MQT_CORE_VERSION 2.6.1
2424
CACHE STRING "MQT Core version")
25-
set(MQT_CORE_REV "41eea72cdbefbd86ba06f76dc41a911950dd3081"
25+
set(MQT_CORE_REV "3529a4435339af3b400e976b1a5e7393d8e5bf4f"
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)")

noxfile.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def _run_tests(
6868

6969
session.install(*BUILD_REQUIREMENTS, *install_args, env=env)
7070
install_arg = f"-ve.[{','.join(_extras)}]"
71-
session.install("--no-build-isolation", "--reinstall-package", "mqt.qcec", install_arg, *install_args, env=env)
71+
session.install("--no-build-isolation", install_arg, *install_args, env=env)
7272
session.run("pytest", *run_args, *posargs, env=env)
7373

7474

@@ -103,7 +103,7 @@ def docs(session: nox.Session) -> None:
103103
serve = args.builder == "html" and session.interactive
104104
extra_installs = ["sphinx-autobuild"] if serve else []
105105
session.install(*BUILD_REQUIREMENTS, *extra_installs)
106-
session.install("--no-build-isolation", "-ve.[docs]", "--reinstall-package", "mqt.qcec")
106+
session.install("--no-build-isolation", "-ve.[docs]")
107107

108108
if args.builder == "linkcheck":
109109
session.run("sphinx-build", "-b", "linkcheck", "docs", "docs/_build/linkcheck", *posargs)

pyproject.toml

+4
Original file line numberDiff line numberDiff line change
@@ -300,3 +300,7 @@ environment = { MACOSX_DEPLOYMENT_TARGET = "10.15" }
300300
before-build = "pip install delvewheel>=1.7.3"
301301
repair-wheel-command = "delvewheel repair -v -w {dest_dir} {wheel} --namespace-pkg mqt"
302302
environment = { CMAKE_ARGS = "-T ClangCL", SKBUILD_CMAKE_ARGS="--fresh" }
303+
304+
305+
[tool.uv]
306+
reinstall-package = ["mqt.qcec"]

src/EquivalenceCheckingManager.cpp

+4-8
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,7 @@ void EquivalenceCheckingManager::stripIdleQubits() {
7070
// Remove idle logical qubit present exclusively in largerCircuit
7171
if (qubitDifference > 0 &&
7272
((smallerCircuit.getNqubits() == 0) ||
73-
logicalQubitIndex >
74-
qc::QuantumComputation::getHighestLogicalQubitIndex(
75-
smallerCircuit.initialLayout))) {
73+
logicalQubitIndex > smallerCircuit.initialLayout.maxValue())) {
7674
const bool physicalUsedInOutputPermutation =
7775
largerCircuit.outputPermutation.find(physicalQubitIndex) !=
7876
largerCircuit.outputPermutation.end();
@@ -198,9 +196,7 @@ void EquivalenceCheckingManager::setupAncillariesAndGarbage() {
198196
std::vector<bool> garbage(nqubits);
199197

200198
for (std::size_t i = 0; i < qubitDifference; ++i) {
201-
const auto logicalQubitIndex =
202-
qc::QuantumComputation::getHighestLogicalQubitIndex(
203-
largerCircuit.initialLayout);
199+
const auto logicalQubitIndex = largerCircuit.initialLayout.maxValue();
204200
garbage[logicalQubitIndex] =
205201
largerCircuit.logicalQubitIsGarbage(logicalQubitIndex);
206202
removed.push_back(largerCircuit.removeQubit(logicalQubitIndex));
@@ -230,8 +226,8 @@ void EquivalenceCheckingManager::runOptimizationPasses() {
230226
return;
231227
}
232228

233-
const auto isDynamicCircuit1 = qc::CircuitOptimizer::isDynamicCircuit(qc1);
234-
const auto isDynamicCircuit2 = qc::CircuitOptimizer::isDynamicCircuit(qc2);
229+
const auto isDynamicCircuit1 = qc1.isDynamic();
230+
const auto isDynamicCircuit2 = qc2.isDynamic();
235231
if (isDynamicCircuit1 || isDynamicCircuit2) {
236232
if (configuration.optimizations.transformDynamicCircuit) {
237233
if (isDynamicCircuit1) {

0 commit comments

Comments
 (0)