class_docstr: Tests the QubitCarry operator.
docstr: Test if ``QubitCarry`` produces the right output and is expandable.
docstr_tok: ["Test","if","``","QubitCarry","``","produces","the","right","output","and","is","expandable","."]
code: def test_output(
      self, wires, input_string, output_string, expand, mocker
  ):
      """Test if ``QubitCarry`` produces the right output and is expandable."""
      dev = qml.device("default.qubit", wires=4)
      spy = mocker.spy(qml.QubitCarry, "decomposition")
  
      with qml.queuing.AnnotatedQueue() as q:
          for i, letter in enumerate(input_string):
              if letter == "1":
                  qml.PauliX(i)
          qml.QubitCarry(wires=wires)
          qml.probs(wires=[0, 1, 2, 3])
  
      tape = qml.tape.QuantumScript.from_queue(q)
      if expand:
          tape = tape.expand()
      result = dev.execute(tape)
      result = np.argmax(result)
      result = format(result, "04b")
      assert result == output_string
  
      # checks that decomposition is only used when intended
      assert expand is (len(spy.call_args_list) != 0)
  
imports: import copy
  import itertools
  import pytest
  import numpy
  import pennylane
  from pennylane.wires import Wires
label_desc: Use image node_id 1 for calling the TestQubitCarry obj's underlying member method code with example usage: obj.test_output(wires, input_string, output_string, expand, mocker) without return types