class_docstr: tests for qml.ops._ctrl_decomp_bisect_general
docstr: Tests that the controlled decomposition of a single-qubit operation
  behaves as expected in a quantum circuit
docstr_tok: ["Tests","that","the","controlled","decomposition","of","a","single-qubit","operation","behaves","as","expected","in","a","quantum","circuit"]
code: def test_decomposition_circuit(self, op, control_wires, auto, tol):
      """Tests that the controlled decomposition of a single-qubit operation
      behaves as expected in a quantum circuit"""
      dev = qml.device("default.qubit", wires=max(control_wires) + 1)
  
      @qml.qnode(dev)
      def decomp_circuit():
          qml.broadcast(
              unitary=qml.Hadamard,
              pattern="single",
              wires=control_wires,
          )
          if auto:
              ctrl_decomp_bisect(op, Wires(control_wires))
          else:
              record_from_list(_ctrl_decomp_bisect_general)(
                  _convert_to_su2(op.matrix()),
                  op.wires,
                  Wires(control_wires),
              )
          return qml.probs()
  
      @qml.qnode(dev)
      def expected_circuit():
          qml.broadcast(
              unitary=qml.Hadamard,
              pattern="single",
              wires=control_wires,
          )
          qml.ctrl(op, control_wires)
          return qml.probs()
  
      res = decomp_circuit()
      expected = expected_circuit()
      assert np.allclose(res, expected, atol=tol, rtol=tol)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.ops import ctrl_decomp_zyz
  from pennylane.wires import Wires
  from pennylane.ops.op_math.controlled_decompositions import _ctrl_decomp_bisect_od, _ctrl_decomp_bisect_md, _ctrl_decomp_bisect_general, ctrl_decomp_bisect, _convert_to_su2, _bisect_compute_a, _bisect_compute_b
  from pennylane.ops.op_math.controlled import Controlled
  from pennylane import math
label_desc: Use image node_id 2 for calling the TestControlledBisectGeneral obj's underlying member method code with example usage: obj.test_decomposition_circuit(op, control_wires, auto, tol) and returns: qml, qml