code: def test_evolution_template_ops(op, new_params, expected_op):
      """Test that `bind_new_parameters` with template operators returns a new
      template operator with the new parameters without mutating the original
      operator."""
      new_op = bind_new_parameters(op, new_params)
  
      assert new_op is not op
      # Need the following assertions since there is a `Hamiltonian` in the hyperparameters so
      # `qml.equal` fails.
      assert isinstance(new_op, type(op))
      assert new_op.arithmetic_depth == expected_op.arithmetic_depth
      assert all(
          qml.math.allclose(d1, d2)
          for d1, d2 in zip(new_op.data, expected_op.data)
      )
      assert new_op.wires == op.wires
      for val1, val2 in zip(
          new_op.hyperparameters.values(),
          expected_op.hyperparameters.values(),
      ):
          if isinstance(val1, qml.Hamiltonian):
              assert qml.equal(val1, val2)
          else:
              assert val1 == val2
  
file_path: pennylane/tests/ops/functions/test_bind_new_parameters.py
imports: import pytest
  from gate_data import X, Y, Z, I, GELL_MANN
  import pennylane
  from pennylane.ops.functions import bind_new_parameters
  from pennylane.operation import Tensor
label_desc: Use image node_id 8 for calling a global function with example usage: test_evolution_template_ops(op, new_params, expected_op) without return types