class_docstr: Test the decomposition of the TrotterProduct class.
class_docstr_tok: ["Test","the","decomposition","of","the","TrotterProduct","class","."]
docstr: Test the decomposition is correct and queues
docstr_tok: ["Test","the","decomposition","is","correct","and","queues"]
code: def test_compute_decomposition(
      self, hamiltonian, hamiltonian_index, order
  ):
      """Test the decomposition is correct and queues"""
      op = qml.TrotterProduct(hamiltonian, 4.2, order=order)
      with qml.tape.QuantumTape() as tape:
          decomp = op.compute_decomposition(
              *op.parameters, **op.hyperparameters
          )
  
      assert (
          decomp == tape.operations
      )  # queue matches decomp with circuit ordering
  
      decomp = [qml.simplify(op) for op in decomp]
      true_decomp = [
          qml.simplify(op)
          for op in test_decompositions[(hamiltonian_index, order)][
              ::-1
          ]
      ]
      assert all(
          qml.equal(op1, op2) for op1, op2 in zip(decomp, true_decomp)
      )
  
imports: import copy
  from functools import reduce
  import pytest
  import pennylane
  from pennylane import numpy
  from pennylane.math import allclose, get_interface
  from pennylane.templates.subroutines.trotter import _recursive_expression, _scalar
label_desc: Use image node_id 1 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_compute_decomposition(hamiltonian, hamiltonian_index, order) without return types