class_docstr: Tests for `drawable_layers`
class_docstr_tok: ["Tests","for","`","drawable_layers","`"]
docstr: Test that custom wires do not break the drawing of mid-circuit measurements.
docstr_tok: ["Test","that","custom","wires","do","not","break","the","drawing","of","mid-circuit","measurements","."]
code: def test_mid_measure_custom_wires(self):
      """Test that custom wires do not break the drawing of mid-circuit measurements."""
      mp0 = MidMeasureMP("A", id="foo")
      mp1 = MidMeasureMP("a", id="bar")
      m0 = qml.measurements.MeasurementValue([mp0], lambda v: v)
      m1 = qml.measurements.MeasurementValue([mp1], lambda v: v)
  
      def teleport(state):
          qml.QubitStateVector(state, wires=["A"])
          qml.Hadamard(wires="a")
          qml.CNOT(wires=["a", "B"])
          qml.CNOT(wires=["A", "a"])
          qml.Hadamard(wires="A")
          qml.apply(mp0)
          qml.apply(mp1)
          qml.cond(m1, qml.PauliX)("B")
          qml.cond(m0, qml.PauliZ)("B")
  
      tape_custom = qml.tape.make_qscript(teleport)([0, 1])
      [tape_standard], _ = qml.map_wires(
          tape_custom, {"A": 0, "a": 1, "B": 2}
      )
      ops = tape_standard.operations
      bit_map = {
          MidMeasureMP(0, id="foo"): None,
          MidMeasureMP(1, id="bar"): None,
      }
      layers = drawable_layers(ops, bit_map=bit_map)
      assert layers == [ops[:2]] + [[op] for op in ops[2:]]
  
imports: import pytest
  import pennylane
  from pennylane.measurements import MidMeasureMP
  from pennylane.queuing import AnnotatedQueue
  from pennylane.drawer.drawable_layers import _recursive_find_layer, _recursive_find_mcm_stats_layer, drawable_layers
label_desc: Use image node_id 8 for calling the TestDrawableLayers obj's underlying member method code with example usage: obj.test_mid_measure_custom_wires() without return types