class_docstr: Tests that the template defines the correct decomposition.
class_docstr_tok: ["Tests","that","the","template","defines","the","correct","decomposition","."]
docstr: Tests that QPE behaves correctly in a wire map
docstr_tok: ["Tests","that","QPE","behaves","correctly","in","a","wire","map"]
code: def test_map_wires(self):
      """Tests that QPE behaves correctly in a wire map"""
      # pylint: disable=protected-access
  
      unitary = qml.RX(np.pi / 4, wires=[0]) @ qml.CNOT(wires=[0, 1])
      qpe = qml.QuantumPhaseEstimation(unitary, estimation_wires=[2, 3])
      new_qpe = qml.map_wires(
          qpe,
          wire_map={
              0: 2,
              1: 3,
              2: 4,
              3: 5,
          },
      )
  
      assert list(new_qpe.wires) == [2, 3, 4, 5]
      assert list(new_qpe._hyperparameters["target_wires"]) == [2, 3]
      assert list(new_qpe._hyperparameters["estimation_wires"]) == [
          4,
          5,
      ]
      assert list(new_qpe._hyperparameters["unitary"].wires) == [2, 3]
  
file_path: pennylane/tests/templates/test_subroutines/test_qpe.py
imports: import pytest
  import numpy
  from scipy.stats import unitary_group
  import pennylane
label_desc: Use image node_id 7 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_map_wires() without return types