code: def test_adjoint():
      """Tests the CommutingEvolution.adjoint method provides the correct adjoint operation."""
  
      n_wires = 2
      dev = qml.device("default.qubit", wires=n_wires)
  
      obs = [
          qml.PauliX(0) @ qml.PauliY(1),
          qml.PauliY(0) @ qml.PauliX(1),
      ]
      coeffs = [1, -1]
      hamiltonian = qml.Hamiltonian(coeffs, obs)
      frequencies = (2,)
  
      @qml.qnode(dev)
      def adjoint_evolution_circuit(time):
          for i in range(n_wires):
              qml.Hadamard(i)
          qml.adjoint(qml.CommutingEvolution)(
              hamiltonian, time, frequencies
          )
          return qml.expval(qml.PauliZ(1)), qml.state()
  
      @qml.qnode(dev)
      def evolution_circuit(time):
          for i in range(n_wires):
              qml.Hadamard(i)
          qml.CommutingEvolution(hamiltonian, time, frequencies)
          return qml.expval(qml.PauliZ(1)), qml.state()
  
      res1, state1 = evolution_circuit(0.13)
      res2, state2 = adjoint_evolution_circuit(-0.13)
  
      assert res1 == res2
      assert all(np.isclose(state1, state2))
  
file_path: pennylane/tests/templates/test_subroutines/test_commuting_evolution.py
imports: import pytest
  from scipy.linalg import expm
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: test_adjoint() and returns: qml,  qml, qml,  qml