Skip to content

Commit

Permalink
reindex() for Decompose() output only
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed Oct 20, 2024
1 parent 7dde547 commit 44495c6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.9)
project (Qrack VERSION 9.11.4 DESCRIPTION "High Performance Quantum Bit Simulation" LANGUAGES CXX)
project (Qrack VERSION 9.11.8 DESCRIPTION "High Performance Quantum Bit Simulation" LANGUAGES CXX)

# Installation commands
include (GNUInstallDirs)
Expand Down
24 changes: 24 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
libqrack (9.11.7) bionic; urgency=medium

* Decompose() / Dispose() algorithm improvement (Bionic 4/4)

-- Daniel Strano <[email protected]> Sun, 20 Oct 2024 07:23:25 -0400

libqrack (9.11.6) focal; urgency=medium

* Decompose() / Dispose() algorithm improvement (Focal 3/4)

-- Daniel Strano <[email protected]> Sun, 20 Oct 2024 07:21:25 -0400

libqrack (9.11.5) jammy; urgency=medium

* Decompose() / Dispose() algorithm improvement (Jammy 2/4)

-- Daniel Strano <[email protected]> Sun, 20 Oct 2024 07:19:41 -0400

libqrack (9.11.4) noble; urgency=medium

* Decompose() / Dispose() algorithm improvement (Noble 1/4)

-- Daniel Strano <[email protected]> Sun, 20 Oct 2024 07:16:21 -0400

libqrack (9.9.65) bionic; urgency=medium

* Debug QBDD high rounding (Bionic 4/4)
Expand Down
12 changes: 11 additions & 1 deletion src/qunit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,12 +366,22 @@ void QUnit::Detach(bitLenInt start, bitLenInt length, QUnitPtr dest)
dest->shards[i] = shard;
}
}

// Find the rest of the qubits.
for (auto&& shard : shards) {
const auto subunit = subunits.find(shard.unit);
if (subunit != subunits.end() &&
shard.mapped >= (shards[decomposedUnits[shard.unit]].mapped + subunit->second)) {
shard.mapped -= subunit->second;
}
}

shards.erase(start, start + length);
shards.reindex();

if (dest) {
dest->shards.reindex();
}

SetQubitCount(qubitCount - length);
}

Expand Down

0 comments on commit 44495c6

Please sign in to comment.