From 980f38c5d0f26524d5448b56a6439072be11121c Mon Sep 17 00:00:00 2001 From: burgholzer Date: Tue, 3 Oct 2023 10:28:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20output=20permutation=20ded?= =?UTF-8?q?uction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: burgholzer --- src/python/qiskit/QuantumCircuit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/python/qiskit/QuantumCircuit.cpp b/src/python/qiskit/QuantumCircuit.cpp index 590b108ff..56a683ac4 100644 --- a/src/python/qiskit/QuantumCircuit.cpp +++ b/src/python/qiskit/QuantumCircuit.cpp @@ -468,11 +468,13 @@ void qc::qiskit::QuantumCircuit::importInitialLayout(qc::QuantumComputation& qc, const auto physicalQubits = layout.attr("get_physical_bits")().cast(); - // create initial layout + // create initial layout (and assume identical output permutation) for (const auto& [physicalQubit, logicalQubit] : physicalQubits) { if (logicalQubitIndices.contains(logicalQubit)) { qc.initialLayout[physicalQubit.cast()] = logicalQubitIndices[logicalQubit].cast(); + qc.outputPermutation[physicalQubit.cast()] = + logicalQubitIndices[logicalQubit].cast(); } } }