class_docstr: Tests that the template defines the correct decomposition.
class_docstr_tok: ["Tests","that","the","template","defines","the","correct","decomposition","."]
docstr: Tests errors with specifying target_wires and estimation_wires
docstr_tok: ["Tests","errors","with","specifying","target_wires","and","estimation_wires"]
code: def test_wires_specified(self):
      """Tests errors with specifying target_wires and estimation_wires"""
  
      unitary = unitary_group.rvs(4, random_state=1967)
  
      with pytest.raises(
          qml.QuantumFunctionError,
          match="Target wires must be specified if the unitary is expressed as a matrix.",
      ):
          qml.QuantumPhaseEstimation(unitary, estimation_wires=[2, 3])
  
      unitary = qml.RX(3, wires=[0])
      with pytest.raises(
          qml.QuantumFunctionError,
          match="The unitary is expressed as an operator, which already has target wires "
          "defined, do not additionally specify target wires.",
      ):
          qml.QuantumPhaseEstimation(
              unitary, target_wires=[1], estimation_wires=[2, 3]
          )
  
      with pytest.raises(
          qml.QuantumFunctionError,
          match="No estimation wires specified.",
      ):
          qml.QuantumPhaseEstimation(unitary)
  
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 6 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_wires_specified() without return types