diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md
index be08cf91ec4..813ee6374e4 100644
--- a/doc/releases/changelog-dev.md
+++ b/doc/releases/changelog-dev.md
@@ -34,10 +34,14 @@
* Fix `qml.PrepSelPrep` template to work with `torch`:
[(#6191)](https://github.com/PennyLaneAI/pennylane/pull/6191)
-
Contributors ✍️
+* The ``qml.QSVT`` template now orders the ``projector`` wires first and the ``UA`` wires second, which is the expected order of the decomposition.
+ [(#6212)](https://github.com/PennyLaneAI/pennylane/pull/6212)
+
+* Contributors ✍️
This release contains contributions from (in alphabetical order):
+Guillermo Alonso
Utkarsh Azad
Jack Brown
Christina Lee
diff --git a/pennylane/templates/subroutines/qsvt.py b/pennylane/templates/subroutines/qsvt.py
index 42d8fcff7fe..e272811a733 100644
--- a/pennylane/templates/subroutines/qsvt.py
+++ b/pennylane/templates/subroutines/qsvt.py
@@ -285,9 +285,9 @@ def __init__(self, UA, projectors, id=None):
"projectors": projectors,
}
- total_wires = qml.wires.Wires(UA.wires) + qml.wires.Wires.all_wires(
+ total_wires = qml.wires.Wires.all_wires(
[proj.wires for proj in projectors]
- )
+ ) + qml.wires.Wires(UA.wires)
super().__init__(wires=total_wires, id=id)
diff --git a/tests/templates/test_subroutines/test_qsvt.py b/tests/templates/test_subroutines/test_qsvt.py
index acb08c00ad6..81046fd40c8 100644
--- a/tests/templates/test_subroutines/test_qsvt.py
+++ b/tests/templates/test_subroutines/test_qsvt.py
@@ -172,9 +172,10 @@ def test_decomposition_queues_its_contents(self):
def test_wire_order(self):
"""Test that the wire order is preserved."""
- op = qml.QFT(wires=[2, 1])
- qsvt_wires = qml.QSVT(op, [op]).wires
- assert qsvt_wires == op.wires
+ op1 = qml.GroverOperator(wires=[0, 3])
+ op2 = qml.QFT(wires=[2, 1])
+ qsvt_wires = qml.QSVT(op2, [op1]).wires
+ assert qsvt_wires == op1.wires + op2.wires
@pytest.mark.parametrize(
("quantum_function", "phi_func", "A", "phis", "results"),