Skip to content

Commit 9a80fc4

Browse files
committed
🐛 fix bug where output permutation was inferred incorrectly in heuristic mapper
Signed-off-by: Lukas Burgholzer <lukas.burgholzer@jku.at>
1 parent 74a87ce commit 9a80fc4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/heuristic/HeuristicMapper.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,11 @@ void HeuristicMapper::map(const Configuration& configuration) {
176176
++loc;
177177
}
178178
locations.at(target) = static_cast<std::int16_t>(loc);
179+
qubits.at(loc) = static_cast<std::int16_t>(target);
179180
op->setTargets({static_cast<qc::Qubit>(loc)});
180-
qcMapped.initialLayout.at(target) = loc;
181+
qcMapped.initialLayout.at(target) = loc;
182+
qcMapped.outputPermutation[static_cast<qc::Qubit>(loc)] = target;
183+
qcMapped.garbage.at(loc) = false;
181184
} else {
182185
op->setTargets({static_cast<qc::Qubit>(targetLocation)});
183186
}

0 commit comments

Comments
 (0)