class_docstr: Test that simulate works with broadcasted parameters
docstr: Test that broadcasting works when the operations don't act on all wires.
docstr_tok: ["Test","that","broadcasting","works","when","the","operations","do","n't","act","on","all","wires","."]
code: def test_broadcasting_with_extra_measurement_wires(self, mocker):
      """Test that broadcasting works when the operations don't act on all wires."""
      # I can't mock anything in `simulate` because the module name is the function name
      spy = mocker.spy(qml, "map_wires")
      x = np.array([0.8, 1.0, 1.2, 1.4])
  
      ops = [
          qml.PauliX(wires=2),
          qml.RY(x, wires=1),
          qml.CNOT(wires=[1, 2]),
      ]
      measurements = [qml.expval(qml.PauliZ(i)) for i in range(3)]
  
      qs = qml.tape.QuantumScript(ops, measurements)
      res = simulate(qs)
  
      assert isinstance(res, tuple)
      assert len(res) == 3
      assert np.allclose(res[0], 1.0)
      assert np.allclose(res[1], np.cos(x))
      assert np.allclose(res[2], -np.cos(x))
      assert spy.call_args_list[0].args == (qs, {2: 0, 1: 1, 0: 2})
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.devices.qubit import simulate, get_final_state, measure_final_state
label_desc: Use image node_id 5 for calling the TestBroadcasting obj's underlying member method code with example usage: obj.test_broadcasting_with_extra_measurement_wires(mocker) without return types