class_docstr: Tests that the template defines the correct decomposition.
class_docstr_tok: ["Tests","that","the","template","defines","the","correct","decomposition","."]
docstr: Test that random wires are picked for the gates. This is done by
  taking the mean of all wires, which should be 1 for labels [0, 1, 2]
docstr_tok: ["Test","that","random","wires","are","picked","for","the","gates",".","This","is","done","by","taking","the","mean","of","all","wires",",","which","should","be","1","for","labels","[","0",",","1",",","2","]"]
code: def test_random_wires(self):
      """Test that random wires are picked for the gates. This is done by
      taking the mean of all wires, which should be 1 for labels [0, 1, 2]
      """
      n_rots = 5000
      weights = np.random.random(size=(2, n_rots))
  
      op = qml.RandomLayers(weights, wires=range(3))
      queue = op.expand().operations
  
      gate_wires = [gate.wires.labels for gate in queue]
      wires_flat = [item for w in gate_wires for item in w]
      mean_wire = np.mean(wires_flat)
  
      assert np.isclose(mean_wire, 1, atol=0.05)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane import numpy
label_desc: Use image node_id 4 for calling the TestDecomposition obj's underlying member method code with example usage: obj.test_random_wires() without return types