class_docstr: Unit tests for transpile function
class_docstr_tok: ["Unit","tests","for","transpile","function"]
docstr: Test that if probs or sample are requested broadcasted over all wires, transpile fills in the device wires.
docstr_tok: ["Test","that","if","probs","or","sample","are","requested","broadcasted","over","all","wires",",","transpile","fills","in","the","device","wires","."]
code: def test_transpile_probs_sample_filled_in_wires(self):
      """Test that if probs or sample are requested broadcasted over all wires, transpile fills in the device wires."""
      dev = qml.device("default.qubit", wires=(0, 1, 2))
  
      tape = qml.tape.QuantumScript(
          [qml.PauliX(0), qml.CNOT(wires=(0, 2))],
          [qml.probs(), qml.sample()],
          shots=100,
      )
      batch, fn = qml.transforms.transpile(
          tape, coupling_map=[(0, 1), (1, 2)], device=dev
      )
  
      assert batch[0].measurements[0] == qml.probs(wires=(0, 2, 1))
      assert batch[0].measurements[1] == qml.sample(wires=(0, 2, 1))
  
      pre, post = dev.preprocess()[0]((tape,))
      original_results = post(dev.execute(pre))[0]
      transformed_results = fn(dev.execute(batch))
      assert qml.math.allclose(
          original_results[0], transformed_results[0]
      )
      assert qml.math.allclose(
          original_results[1], transformed_results[1]
      )
  
imports: from math import isclose
  import pytest
  from pennylane import numpy
  import pennylane
  from pennylane.transforms.transpile import transpile
label_desc: Use image node_id 16 for calling the TestTranspile obj's underlying member method code with example usage: obj.test_transpile_probs_sample_filled_in_wires() without return types