class_docstr: Test the construction of composite ops.
class_docstr_tok: ["Test","the","construction","of","composite","ops","."]
docstr: Test that Tensor and Hamiltonian instances get converted to Prod and Sum.
docstr_tok: ["Test","that","Tensor","and","Hamiltonian","instances","get","converted","to","Prod","and","Sum","."]
code: def test_tensor_and_hamiltonian_converted(self):
      """Test that Tensor and Hamiltonian instances get converted to Prod and Sum."""
      operands = [
          qml.Hamiltonian(
              [1.1, 2.2],
              [
                  qml.PauliZ(0),
                  qml.operation.Tensor(qml.PauliX(0), qml.PauliZ(1)),
              ],
          ),
          qml.prod(qml.PauliX(0), qml.PauliZ(1)),
          qml.operation.Tensor(qml.PauliX(2), qml.PauliZ(3)),
      ]
      op = ValidOp(*operands)
      assert isinstance(op[0], Sum)
      assert isinstance(op[0][1], SProd)
      assert isinstance(op[0][1].base, Prod)
      assert op[1] is operands[1]
      assert isinstance(op[2], Prod)
      assert op.operands == (
          qml.dot(
              [1.1, 2.2],
              [qml.PauliZ(0), qml.prod(qml.PauliX(0), qml.PauliZ(1))],
          ),
          operands[1],
          qml.prod(qml.PauliX(2), qml.PauliZ(3)),
      )
  
imports: from copy import copy
  import numpy
  import pytest
  import pennylane
  from pennylane.operation import DecompositionUndefinedError
  from pennylane.ops.op_math import CompositeOp, Prod, Sum, SProd
  from pennylane.wires import Wires
label_desc: Use image node_id 19 for calling the TestConstruction obj's underlying member method code with example usage: obj.test_tensor_and_hamiltonian_converted() without return types