From 3f572a856eb814e1315dd01efc3bbb8635e65151 Mon Sep 17 00:00:00 2001 From: WrathfulSpatula Date: Fri, 31 May 2024 16:40:56 -0400 Subject: [PATCH] Reverse wire order --- pennylane_qrack/qrack_device.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pennylane_qrack/qrack_device.cpp b/pennylane_qrack/qrack_device.cpp index d4ad9e9..dd022fd 100644 --- a/pennylane_qrack/qrack_device.cpp +++ b/pennylane_qrack/qrack_device.cpp @@ -42,7 +42,8 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice { { std::vector res; res.reserve(wires.size()); - std::transform(wires.begin(), wires.end(), std::back_inserter(res), [](auto w) { return (bitLenInt)w; }); + const bitLenInt end = qsim->GetQubitCount() - 1U; + std::transform(wires.begin(), wires.end(), std::back_inserter(res), [end](auto w) { return end - (bitLenInt)w; }); return res; }