class_docstr: Tests that the template defines the correct decomposition.
class_docstr_tok: ["Tests","that","the","template","defines","the","correct","decomposition","."]
docstr: Test the correctness of the AllSinglesDoubles template including the gate count
  and order, the wires the operation acts on and the correct use of parameters
  in the circuit.
docstr_tok: ["Test","the","correctness","of","the","AllSinglesDoubles","template","including","the","gate","count","and","order",",","the","wires","the","operation","acts","on","and","the","correct","use","of","parameters","in","the","circuit","."]
code: def test_allsinglesdoubles_operations(
      self, singles, doubles, weights, ref_gates
  ):
      """Test the correctness of the AllSinglesDoubles template including the gate count
      and order, the wires the operation acts on and the correct use of parameters
      in the circuit."""
  
      N = 6
      wires = range(N)
  
      hf_state = np.array([1, 1, 0, 0, 0, 0])
  
      op = qml.AllSinglesDoubles(
          weights, wires, hf_state, singles=singles, doubles=doubles
      )
      queue = op.expand().operations
  
      assert len(queue) == len(singles) + len(doubles) + 1
  
      for gate in ref_gates:
          idx = gate[0]
  
          exp_gate = gate[1]
          res_gate = queue[idx]
          assert isinstance(res_gate, exp_gate)
  
          exp_wires = gate[2]
          res_wires = queue[idx].wires
          assert res_wires.tolist() == exp_wires
  
          exp_weight = gate[3]
          res_weight = queue[idx].parameters
          assert np.allclose(res_weight, exp_weight)
  
imports: import pytest
  import numpy
  from pennylane import numpy
  import pennylane
label_desc: Use image node_id 1 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_allsinglesdoubles_operations(singles, doubles, weights, ref_gates) without return types