class_docstr: tests for qml.ops._ctrl_decomp_bisect_od
docstr: Tests that the operators in the decomposition match expectations.
docstr_tok: ["Tests","that","the","operators","in","the","decomposition","match","expectations","."]
code: def test_decomposed_operators(self, op, tol):
      """Tests that the operators in the decomposition match expectations."""
      control_wires = [1, 2, 3, 4, 5]
  
      su = op.matrix()
      sx = qml.PauliX.compute_matrix()
      op_seq = _ctrl_decomp_bisect_od(
          op.matrix(), op.wires, Wires(control_wires)
      )
  
      assert len(op_seq) == 8
  
      mcx1 = qml.MultiControlledX(
          control_wires=Wires([1, 2, 3]),
          wires=Wires(0),
          work_wires=Wires([4, 5]),
      )
      assert qml.equal(mcx1, op_seq[0])
      assert qml.equal(mcx1, op_seq[4])
  
      mcx2 = qml.MultiControlledX(
          control_wires=Wires([4, 5]),
          wires=Wires(0),
          work_wires=Wires([1, 2, 3]),
      )
      assert qml.equal(mcx2, op_seq[2])
      assert qml.equal(mcx2, op_seq[6])
  
      a = op_seq[1].matrix()
      at = op_seq[3].matrix()
      a2 = op_seq[5].matrix()
      at2 = op_seq[7].matrix()
      assert np.array_equal(a, a2)
      assert np.array_equal(at, at2)
  
      i2 = np.identity(2)
      assert np.allclose(a @ at, i2, atol=tol, rtol=tol)
      assert np.allclose(at @ a, i2, atol=tol, rtol=tol)
  
      assert np.allclose(
          at @ sx @ a @ sx @ at @ sx @ a @ sx, su, 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 4 for calling the TestControlledBisectOD obj's underlying member method code with example usage: obj.test_decomposed_operators(op, tol) without return types