Skip to content

Commit

Permalink
Reverse wire order
Browse files Browse the repository at this point in the history
  • Loading branch information
WrathfulSpatula committed May 31, 2024
1 parent e9e8326 commit 3f572a8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pennylane_qrack/qrack_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ struct QrackDevice final : public Catalyst::Runtime::QuantumDevice {
{
std::vector<bitLenInt> 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;
}

Expand Down

0 comments on commit 3f572a8

Please sign in to comment.