class_docstr: tests for qml.ops._ctrl_decomp_bisect_md
docstr: Tests that the B matrix subroutine returns a correct A matrix.
docstr_tok: ["Tests","that","the","B","matrix","subroutine","returns","a","correct","A","matrix","."]
code: def test_b_matrix(self, op, tol):
      """Tests that the B matrix subroutine returns a correct A matrix."""
      su = op.matrix()
      sx = qml.PauliX.compute_matrix()
      sh = qml.Hadamard.compute_matrix()
      b = _bisect_compute_b(su)
      bt = _matrix_adjoint(b)
      assert np.allclose(
          sh @ bt @ sx @ b @ sx @ sh, 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 TestControlledBisectMD obj's underlying member method code with example usage: obj.test_b_matrix(op, tol) without return types