class_docstr: These tests are useful as they test operators that might not have
  matrix forms defined, requiring decomposition.
class_docstr_tok: ["These","tests","are","useful","as","they","test","operators","that","might","not","have","matrix","forms","defined",",","requiring","decomposition","."]
docstr: Test an operation that must be decomposed twice
code: def test_nested_instantiated(self):
      """Test an operation that must be decomposed twice"""
  
      class CustomOp(qml.operation.Operation):
          num_params = 1
          num_wires = 2
  
          @staticmethod
          def compute_decomposition(weights, wires):
              return [
                  qml.StronglyEntanglingLayers(weights, wires=wires)
              ]
  
      weights = np.array([[[0.1, 0.2, 0.3], [0.1, 0.2, 0.3]]])
      op = CustomOp(weights, wires=[0, 1])
      res = qml.matrix(op)
  
      op = qml.StronglyEntanglingLayers(weights, wires=[0, 1])
      with qml.queuing.AnnotatedQueue() as q:
          op.decomposition()
  
      tape = qml.tape.QuantumScript.from_queue(q)
      expected = qml.matrix(tape)
      np.allclose(res, expected)
  
imports: from functools import reduce, partial
  from warnings import catch_warnings
  import pytest
  from gate_data import I, X, Y, Z, H, S, CNOT, Rotx, Roty
  import pennylane
  from pennylane import numpy
  from pennylane.transforms.op_transforms import OperationTransformError
label_desc: Use image node_id 3 for calling the TestTemplates obj's underlying member method code with example usage: obj.test_nested_instantiated() and returns: list