code: def _equal_operators(
      op1: Operator,
      op2: Operator,
      check_interface=True,
      check_trainability=True,
      rtol=1e-5,
      atol=1e-9,
  ):
      """Default function to determine whether two Operator objects are equal."""
      if not isinstance(
          op2, type(op1)
      ):  # clarifies cases involving PauliX/Y/Z (Observable/Operation)
          return False
  
      if op1.arithmetic_depth != op2.arithmetic_depth:
          return False
  
      if op1.arithmetic_depth > 0:
          # Other dispatches cover cases of operations with arithmetic depth > 0.
          # If any new operations are added with arithmetic depth > 0, a new dispatch
          # should be created for them.
          return False
      if not all(
          qml.math.allclose(d1, d2, rtol=rtol, atol=atol)
          for d1, d2 in zip(op1.data, op2.data)
      ):
          return False
      if op1.wires != op2.wires:
          return False
  
      if op1.hyperparameters != op2.hyperparameters:
          return False
  
      if check_trainability:
          for params_1, params_2 in zip(op1.data, op2.data):
              if qml.math.requires_grad(
                  params_1
              ) != qml.math.requires_grad(params_2):
                  return False
  
      if check_interface:
          for params_1, params_2 in zip(op1.data, op2.data):
              if qml.math.get_interface(
                  params_1
              ) != qml.math.get_interface(params_2):
                  return False
  
      return True
  
imports: from collections.abc import Iterable
  from functools import singledispatch
  from typing import Union
  import pennylane
  from pennylane.measurements import MeasurementProcess
  from pennylane.measurements.classical_shadow import ShadowExpvalMP
  from pennylane.measurements.mid_measure import MidMeasureMP, MeasurementValue
  from pennylane.measurements.mutual_info import MutualInfoMP
  from pennylane.measurements.vn_entropy import VnEntropyMP
  from pennylane.measurements.counts import CountsMP
  from pennylane.pulse.parametrized_evolution import ParametrizedEvolution
  from pennylane.operation import Observable, Operator, Tensor
  from pennylane.ops import Hamiltonian, Controlled, Pow, Adjoint, Exp, SProd, CompositeOp
  from pennylane.templates.subroutines import ControlledSequence
  from pennylane.tape import QuantumTape
label_desc: Use image node_id 4 for calling a global function with example usage: _equal_operators(op1, op2, check_interface, check_trainability, rtol, atol) and returns: True, False, False, False, False, False, False, False, False