class_docstr: Tests phase estimation using the template
class_docstr_tok: ["Tests","phase","estimation","using","the","template"]
docstr: Tests that the QPE defined using ControlledSequence works correctly for compound operators
docstr_tok: ["Tests","that","the","QPE","defined","using","ControlledSequence","works","correctly","for","compound","operators"]
code: def test_phase_estimated_composite_ops(self, phase):
      """Tests that the QPE defined using ControlledSequence works correctly for compound operators"""
      unitary = qml.RX(phase, wires=[0]) @ qml.CNOT(wires=[0, 1])
      estimation_wires = range(2, 6)
      dev = qml.device("default.qubit")
  
      @qml.qnode(dev)
      def circuit():
          for i in estimation_wires:
              qml.Hadamard(wires=i)
  
          qml.ControlledSequence(unitary, control=estimation_wires)
  
          qml.adjoint(qml.QFT)(wires=estimation_wires)
  
          return qml.state()
  
      qpe = qml.QuantumPhaseEstimation(
          unitary, estimation_wires=estimation_wires
      )
  
      assert np.allclose(qml.matrix(circuit)(), qml.matrix(qpe))
  
imports: import pytest
  import numpy
  from pennylane import numpy
  import pennylane
  from pennylane.wires import Wires
label_desc: Use image node_id 2 for calling the TestQPEResults obj's underlying member method code with example usage: obj.test_phase_estimated_composite_ops(phase) and returns: qml