class_docstr: Tests that the template defines the correct decomposition.
class_docstr_tok: ["Tests","that","the","template","defines","the","correct","decomposition","."]
docstr: Test the decomposition of the :math:`Q_{theta, phi}` gate by asserting the prepared state.
docstr_tok: ["Test","the","decomposition","of","the",":","math",":","`","Q_","{","theta",",","phi","}","`","gate","by","asserting","the","prepared","state","."]
code: def test_decomposition_q(self, init_state, exp_state, tol):
      """Test the decomposition of the :math:`Q_{theta, phi}` gate by asserting the prepared state."""
  
      N = 4
      wires = range(N)
  
      weight = [[[np.pi / 2, np.pi / 2]]]
  
      dev = qml.device("default.qubit", wires=N)
  
      @qml.qnode(dev)
      def circuit(weight):
          qml.GateFabric(weight, wires, init_state=init_state)
          return qml.state()
  
      assert qml.math.allclose(circuit(weight), exp_state, atol=tol)
  
imports: import numpy
  import pytest
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 2 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_decomposition_q(init_state, exp_state, tol) and returns: qml