class_docstr: Test to check that the iterative quantum phase estimation function works as expected.
class_docstr_tok: ["Test","to","check","that","the","iterative","quantum","phase","estimation","function","works","as","expected","."]
docstr: Test to check that the measurement process expval works correctly
docstr_tok: ["Test","to","check","that","the","measurement","process","expval","works","correctly"]
code: def test_measurement_processes_expval(self, phi):
      """Test to check that the measurement process expval works correctly"""
  
      dev = qml.device("default.qubit")
  
      @qml.qnode(dev)
      def circuit_qpe():
          # Initial state
          qml.PauliX(wires=[0])
  
          # Iterative QPE
          qml.QuantumPhaseEstimation(
              qml.RZ(phi, wires=[0]), estimation_wires=[1, 2, 3]
          )
  
          # We will use the projector as an observable
          return [
              qml.expval(qml.Hermitian([[0, 0], [0, 1]], wires=i))
              for i in [1, 2, 3]
          ]
  
      @qml.qnode(dev)
      def circuit_iterative():
          # Initial state
          qml.PauliX(wires=[0])
  
          # Iterative QPE
          measurements = qml.iterative_qpe(
              qml.RZ(phi, wires=[0]), ancilla=[1], iters=3
          )
  
          return [qml.expval(op=i) for i in measurements]
  
      assert np.allclose(circuit_qpe(), circuit_iterative())
  
file_path: pennylane/tests/ops/functions/test_iterative_qpe.py
imports: import pytest
  import numpy
  import pennylane
label_desc: Use image node_id 8 for calling the TestIQPE obj's underlying member method code with example usage: obj.test_measurement_processes_expval(phi) and returns: unknown, unknown