Repository: PennyLaneAI/pennylane
Pull request #5789 (2024-06-03 17:23:08)

Adding documentation for `qml.breakpoint()` and `qml.PLDB` 
**Context:**
Adding documentation for the new debugger feature.


Jaybsoni: [sc-62245]
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/PennyLaneAI/pennylane/pull/5789?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PennyLaneAI) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 99.66%. Comparing base [(`3f9585d`)](https://app.codecov.io/gh/PennyLaneAI/pennylane/commit/3f9585da2cb43ea4059051cc4379f284fe38767e?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PennyLaneAI) to head [(`aaef07a`)](https://app.codecov.io/gh/PennyLaneAI/pennylane/commit/aaef07a16e1edfc6a2e3e35bb3a90c3401e8800b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PennyLaneAI).


<details><summary>Additional details and impacted files</summary>


```diff
@@                   Coverage Diff                    @@
##           algo_debug_measurements    #5789   +/-   ##
========================================================
  Coverage                    99.66%   99.66%           
========================================================
  Files                          414      414           
  Lines                        39089    39089           
========================================================
  Hits                         38959    38959           
  Misses                         130      130           
```



</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/PennyLaneAI/pennylane/pull/5789?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PennyLaneAI).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=PennyLaneAI).


Patch:
diff --git a/doc/code/qml_debugging.rst b/doc/code/qml_debugging.rst
new file mode 100644
index 000000000..6464ec821
--- /dev/null
+++ b/doc/code/qml_debugging.rst
@@ -0,0 +1,222 @@
+qml.debugging
+=============
+
+.. automodapi:: pennylane.debugging
+    :no-heading:
+    :no-inherited-members:
+    :skip: PLDB
+    :skip: pldb_device_manager
+
+Entering the Debugging Context
+------------------------------
+
+The :func:`~pennylane.breakpoint` function provides an interface for interacting with and
+stepping through a quantum circuit during execution. It allows for faster debugging
+by providing access to the internal state of the circuit and the ``QuantumTape`` as 
+the circuit operations are applied. The functionality is highlighted by the example 
+circuit below.
+
+.. code-block:: python
+
+    import pennylane as qml
+    
+    @qml.qnode(qml.device('default.qubit', wires=(0,1,2)))
+    def circuit(x):
+        qml.breakpoint()
+
+        qml.Hadamard(wires=0)
+        qml.CNOT(wires=(0,2))
+
+        for w in (0, 1, 2):
+            qml.RX(2*x, wires=w)
+
+        qml.breakpoint()
+        qml.RX(-x, wires=1)
+        return qml.sample()
+
+    circuit(1.2345)
+
+Running the above python script opens up the interactive ``[pldb]:`` prompt in the terminal.
+When this code reaches ``qml.breakpoint()`` it will pause and launch an interactive
+debugging prompt. The prompt specifies the path to the script and the next line to be 
+executed after the breakpoint:
+
+.. code-block:: console
+
+    > /Users/your/path/to/script.py(7)circuit()
+    -> qml.Hadamard(wires=0)
+    [pldb]:
+
+Controlling Code Execution in the Debugging Context
+---------------------------------------------------
+
+The Pennylane Debugger (PLDB) is built from the native python debugger (Pdb), as such 
+it shares a similar interface. We can interact with the debugger using the 
+builtin commands: ``list``, ``longlist``, ``next``, ``continue``, and ``quit``. Any 
+variables defined in the scope of the quantum function can also be accessed from the 
+debugger.
+
+.. code-block:: console
+
+    [pldb]: print(x)
+    1.2345
+
+The ``list`` (and ``longlist``) command will print a section of code around the 
+breakpoint, highlighting the next line to be executed. This can be used to determine
+the location of execution in the circuit.
+
+.. code-block:: console
+
+    [pldb]: longlist
+      3  	@qml.qnode(qml.device('default.qubit', wires=(0,1,2)))
+      4  	def circuit(x):
+      5  	    qml.breakpoint()
+      6
+      7  ->	    qml.Hadamard(wires=0)
+      8  	    qml.CNOT(wires=(0,2))
+      9
+     10  	    for w in (0, 1, 2):
+     11  	        qml.RX(2*x, wires=w)
+     12
+     13  	    qml.breakpoint()
+     14  	    qml.RX(-x, wires=1)
+     15  	    return qml.sample()
+    
+The ``next`` command will execute the next line of code, and print the following 
+line to be executed, e.g., the next operation to execute is ``CNOT``.
+
+.. code-block:: console
+    
+    [pldb]: next
+    > /Users/your/path/to/script.py(8)circuit()
+    -> qml.CNOT(wires=(0,2))
+    [pldb]: list
+      3  	@qml.qnode(qml.device('default.qubit', wires=(0,1,2)))
+      4  	def circuit(x):
+      5  	    qml.breakpoint()
+      6
+      7  	    qml.Hadamard(wires=0)
+      8  ->	    qml.CNOT(wires=(0,2))
+      9
+     10  	    for w in (0, 1, 2):
+     11  	        qml.RX(2*x, wires=w)
+     12
+     13  	    qml.breakpoint()
+
+Alternative, the ``continue`` command allows for jumping between breakpoints. This command resumes
+code execution until the next breakpoint is reached. Finally, the ``quit`` command
+ends the debugging prompt.
+
+.. code-block:: console
+
+    [pldb]: continue
+    > /Users/your/path/to/script.py(14)circuit()
+    -> qml.RX(-x, wires=1)
+    [pldb]: list
+      9
+     10  	    for w in (0, 1, 2):
+     11  	        qml.RX(2*x, wires=w)
+     12
+     13  	    qml.breakpoint()
+     14  ->	    qml.RX(-x, wires=1)
+     15  	    return qml.sample()
+     16
+     17  	circuit(1.2345)
+    [EOF]
+    [pldb]: quit
+
+
+Extracting Circuit Information
+------------------------------
+
+While in the debugging prompt, we can extract information and perform measurements 
+on the qunatum circuit. Specifically we can make measurements using 
+:func:`~pennylane.debug_expval`, :func:`~pennylane.debug_state`, 
+:func:`~pennylane.debug_probs`, and access the gates in the circuit using
+:func:`~pennylane.debug_tape`. 
+
+Consider the circuit from above, 
+
+.. code-block:: console
+
+    > /Users/your/path/to/script.py(7)circuit()
+    -> qml.Hadamard(wires=0)
+    [pldb]: longlist
+      3  	@qml.qnode(qml.device('default.qubit', wires=(0,1,2)))
+      4  	def circuit(x):
+      5  	    qml.breakpoint()
+      6
+      7  ->	    qml.Hadamard(wires=0)
+      8  	    qml.CNOT(wires=(0,2))
+      9
+     10  	    for w in (0, 1, 2):
+     11  	        qml.RX(2*x, wires=w)
+     12
+     13  	    qml.breakpoint()
+     14  	    qml.RX(-x, wires=1)
+     15  	    return qml.sample()
+    [pldb]: next
+    > /Users/your/path/to/script.py(8)circuit()
+    -> qml.CNOT(wires=(0,2))
+    [pldb]: next
+    > /Users/your/path/to/script.py(10)circuit()
+    -> for w in (0, 1, 2):
+    [pldb]:
+
+All of the operations applied so far are tracked in the circuit's ``QuantumTape`` 
+which is accessible using :func:`~pennylane.debug_tape`. This can be used to
+*visually* debug the circuit.
+
+.. code-block:: console
+
+    [pldb]: qtape = qml.debug_tape()
+    [pldb]: qtape.operations
+    [Hadamard(wires=[0]), CNOT(wires=[0, 2])]
+    [pldb]: print(qtape.draw())
+    0: ──H─╭●─┤
+    2: ────╰X─┤
+
+The quantum state of the circuit at this point can be extracted using 
+:func:`~pennylane.debug_state`. The associated probability distribution 
+for the wires of interest can be probed using :func:`~pennylane.debug_probs`.
+
+.. code-block:: console
+
+    [pldb]: qml.debug_state()
+    array([0.70710678+0.j, 0.        +0.j, 0.        +0.j, 0.        +0.j,
+           0.        +0.j, 0.70710678+0.j, 0.        +0.j, 0.        +0.j])
+    [pldb]: qml.debug_probs(wires=(0,2))
+    array([0.5, 0. , 0. , 0.5])
+
+Another method for probing the system is by measuring observables via 
+:func:`~pennylane.debug_expval`.
+
+.. code-block:: console
+
+    [pldb]: qml.debug_expval(qml.Z(0))
+    0.0
+    [pldb]: qml.debug_expval(qml.X(0)@qml.X(2))
+    0.9999999999999996
+
+Additionally, the quantum circuit can be dynamically updated by adding gates directly
+from the prompt. This allows users to modify the circuit *on-the-fly*!
+
+.. code-block:: console
+
+    [pldb]: continue
+    > /Users/your/path/to/script.py(14)circuit()
+    -> qml.RX(-x, wires=1)
+    [pldb]: qtape = qml.debug_tape()
+    [pldb]: print(qtape.draw(wire_order=(0,1,2)))
+    0: ──H─╭●──RX─┤
+    1: ────│───RX─┤
+    2: ────╰X──RX─┤
+    [pldb]: qml.RZ(0.5*x, wires=0)
+    RZ(0.61725, wires=[0])
+    [pldb]: qml.CZ(wires=(1,2))
+    CZ(wires=[1, 2])
+    [pldb]: qtape = qml.debug_tape()
+    [pldb]: print(qtape.draw(wire_order=(0,1,2)))
+    0: ──H─╭●──RX──RZ─┤
+    1: ────│───RX─╭●──┤
+    2: ────╰X──RX─╰Z──┤
diff --git a/doc/index.rst b/doc/index.rst
index d99491730..a95d156da 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -194,6 +194,7 @@ PennyLane is **free** and **open source**, released under the Apache License, Ve
    code/qml
    code/qml_compiler
    code/qml_data
+   code/qml_debugging
    code/qml_drawer
    code/qml_fermi
    code/qml_fourier
diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md
index a9de6a1b3..f189eeeff 100644
--- a/doc/releases/changelog-dev.md
+++ b/doc/releases/changelog-dev.md
@@ -4,6 +4,15 @@
 
 <h3>New features since last release</h3>
 
+* Added a quantum debugger (`PLDB`) which interfaces via `qml.breakpoint()` and provides tools for 
+  debugging quantum circuits. Users can step through the quantum circuit operations, dynamically
+  queue operations and make measurements using (`qml.debug_state()`, `qml.debug_probs()`, 
+  `qml.debug_expval()`, and `qml.debug_tape()`). Consider the following python script 
+  containing the quantum circuit with breakpoints.
+  [(#5680)](https://github.com/PennyLaneAI/pennylane/pull/5680)
+  [(#5749)](https://github.com/PennyLaneAI/pennylane/pull/5749)
+  [(#5789)](https://github.com/PennyLaneAI/pennylane/pull/5789)
+
 * The `default.tensor` device now supports the `tn` method to simulate quantum circuits using exact tensor networks.
   [(#5786)](https://github.com/PennyLaneAI/pennylane/pull/5786)
 
diff --git a/pennylane/__init__.py b/pennylane/__init__.py
index 998b355ce..76de6be8a 100644
--- a/pennylane/__init__.py
+++ b/pennylane/__init__.py
@@ -126,7 +126,14 @@ from pennylane.ops.functions import (
 )
 from pennylane.ops.identity import I
 from pennylane.optimize import *
-from pennylane.debugging import snapshots, breakpoint
+from pennylane.debugging import (
+    snapshots,
+    breakpoint,
+    debug_expval,
+    debug_state,
+    debug_probs,
+    debug_tape,
+)
 from pennylane.shadows import ClassicalShadow
 from pennylane.qcut import cut_circuit, cut_circuit_mc
 import pennylane.pulse
diff --git a/pennylane/debugging/__init__.py b/pennylane/debugging/__init__.py
index b6ea46e0f..67c68e361 100644
--- a/pennylane/debugging/__init__.py
+++ b/pennylane/debugging/__init__.py
@@ -19,10 +19,10 @@ from .snapshot import snapshots
 
 from .debugger import (
     breakpoint,
-    expval,
+    debug_expval,
     PLDB,
     pldb_device_manager,
-    probs,
-    state,
-    tape,
+    debug_probs,
+    debug_state,
+    debug_tape,
 )
diff --git a/pennylane/debugging/debugger.py b/pennylane/debugging/debugger.py
index 6a2c34e8d..63db114ce 100644
--- a/pennylane/debugging/debugger.py
+++ b/pennylane/debugging/debugger.py
@@ -100,7 +100,7 @@ class PLDB(pdb.Pdb):
 
     @classmethod
     def _execute(cls, batch_tapes):
-        """Execute tape on the active device"""
+        """Execute the batch of tapes on the active device"""
         dev = cls.get_active_device()
 
         valid_batch = batch_tapes
@@ -132,18 +132,143 @@ def pldb_device_manager(device):
 
 
 def breakpoint():
-    """Launch the custom PennyLane debugger."""
+    """A function which freezes execution and launches the PennyLane debugger (PLDB).
+
+    This function marks a location in a quantum circuit (QNode). When it is encountered during
+    execution of the quantum circuit, an interactive debugging prompt is launched to step
+    throught the circuit execution using Pdb like commands (:code:`list`, :code:`next`,
+    :code:`continue`, :code:`quit`).
+
+    **Example**
+
+    Consider the following python script containing the quantum circuit with breakpoints.
+
+    .. code-block:: python3
+
+        dev = qml.device("default.qubit", wires=2)
+
+        @qml.qnode(dev)
+        def circuit(x):
+            qml.breakpoint()
+
+            qml.RX(x, wires=0)
+            qml.Hadamard(wires=1)
+
+            qml.breakpoint()
+
+            qml.CNOT(wires=[0, 1])
+            return qml.expval(qml.Z(0))
+
+        circuit(1.23)
+
+    Running the above python script opens up the interactive :code:`[pldb]:` prompt in the terminal.
+    The prompt specifies the path to the script along with the next line to be executed after the breakpoint.
+
+    .. code-block:: console
+
+        > /Users/your/path/to/script.py(8)circuit()
+        -> qml.RX(x, wires=0)
+        [pldb]:
+
+    We can interact with the prompt using the commands: :code:`list` , :code:`next`,
+    :code:`continue`, and :code:`quit`. Additionally, we can also access any variables defined in the function.
+
+    .. code-block:: console
+
+        [pldb]: x
+        1.23
+
+    The :code:`list` command will print a section of code around the breakpoint, highlighting the next line
+    to be executed.
+
+    .. code-block:: console
+
+        [pldb]: list
+          3
+          4  	@qml.qnode(dev)
+          5  	def circuit(x):
+          6  	    qml.breakpoint()
+          7
+          8  ->	    qml.RX(x, wires=0)
+          9  	    qml.Hadamard(wires=1)
+         10
+         11  	    qml.breakpoint()
+         12
+         13  	    qml.CNOT(wires=[0, 1])
+        [pldb]:
+
+    The :code:`next` command will execute the next line of code, and print the new line to be executed.
+
+    .. code-block:: console
+
+        [pldb]: next
+        > /Users/your/path/to/script.py(9)circuit()
+        -> qml.Hadamard(wires=1)
+        [pldb]:
+
+    The :code:`continue` command will resume code execution until another breakpoint is reached. It will
+    then print the new line to be executed. Finally, :code:`quit` will resume execution of the file and
+    terminate the debugging prompt.
+
+    .. code-block:: console
+
+        [pldb]: continue
+        > /Users/your/path/to/script.py(13)circuit()
+        -> qml.CNOT(wires=[0, 1])
+        [pldb]: quit
+
+    """
     PLDB.valid_context()  # Ensure its being executed in a valid context
 
     debugger = PLDB(skip=["pennylane.*"])  # skip internals when stepping through trace
     debugger.set_trace(sys._getframe().f_back)  # pylint: disable=protected-access
 
 
-def state():
-    """Compute the state of the quantum circuit.
+def debug_state():
+    """Compute the quantum state at the current point in the quantum circuit.
 
     Returns:
-        Array(complex): quantum state of the circuit.
+        Array(complex): quantum state of the circuit
+
+    **Example**
+
+    While in a "debugging context", we can query the state as we would at the end of a circuit.
+
+    .. code-block:: python3
+
+        dev = qml.device("default.qubit", wires=2)
+
+        @qml.qnode(dev)
+        def circuit(x):
+            qml.RX(x, wires=0)
+            qml.Hadamard(wires=1)
+
+            qml.breakpoint()
+
+            qml.CNOT(wires=[0, 1])
+            return qml.expval(qml.Z(0))
+
+        circuit(1.23)
+
+    Running the above python script opens up the interactive :code:`[pldb]:` prompt in the terminal.
+    We can query the state:
+
+    .. code-block:: console
+
+        [pldb]: longlist
+          4  	@qml.qnode(dev)
+          5  	def circuit(x):
+          6  	    qml.RX(x, wires=0)
+          7  	    qml.Hadamard(wires=1)
+          8
+          9  	    qml.breakpoint()
+         10
+         11  ->	    qml.CNOT(wires=[0, 1])
+         12  	    return qml.expval(qml.Z(0))
+        [pldb]: qml.debug_state()
+        array([0.57754604+0.j        , 0.57754604+0.j        ,
+        0.        -0.40797128j, 0.        -0.40797128j])
+
     """
     with qml.queuing.QueuingManager.stop_recording():
         m = qml.state()
@@ -151,14 +276,54 @@ def state():
     return _measure(m)
 
 
-def expval(op):
-    """Compute the expectation value of an observable.
+def debug_expval(op):
+    """Compute the expectation value of an observable at the
+    current point in the quantum circuit.
 
     Args:
-        op (Operator): the observable to compute the expectation value for
+        op (Operator): the observable to compute the expectation value for.
 
     Returns:
         complex: expectation value of the operator
+
+    **Example**
+
+    While in a "debugging context", we can query the expectation value of an observable
+    as we would at the end of a circuit.
+
+    .. code-block:: python3
+
+        dev = qml.device("default.qubit", wires=2)
+
+        @qml.qnode(dev)
+        def circuit(x):
+            qml.RX(x, wires=0)
+            qml.Hadamard(wires=1)
+
+            qml.breakpoint()
+
+            qml.CNOT(wires=[0, 1])
+            return qml.state()
+
+        circuit(1.23)
+
+    Running the above python script opens up the interactive :code:`[pldb]:` prompt in the terminal.
+    We can query the expectation value:
+
+    .. code-block:: console
+
+        [pldb]: longlist
+          4  	@qml.qnode(dev)
+          5  	def circuit(x):
+          6  	    qml.RX(x, wires=0)
+          7  	    qml.Hadamard(wires=1)
+          8
+          9  	    qml.breakpoint()
+         10
+         11  ->	    qml.CNOT(wires=[0, 1])
+         12  	    return qml.state()
+        [pldb]: qml.debug_expval(qml.Z(0))
+        0.33423772712450256
     """
 
     qml.queuing.QueuingManager.active_context().remove(op)  # ensure we didn't accidentally queue op
@@ -169,16 +334,58 @@ def expval(op):
     return _measure(m)
 
 
-def probs(wires=None, op=None):
-    """Compute the probability distribution for the state.
+def debug_probs(wires=None, op=None):
+    """Compute the probability distribution for the state at the current
+    point in the quantum circuit.
+
     Args:
         wires (Union[Iterable, int, str, list]): the wires the operation acts on
         op (Union[Observable, MeasurementValue]): observable (with a ``diagonalizing_gates``
-            attribute) that rotates the computational basis, or a ``MeasurementValue``
+            attribute) that rotates the computational basis, or a  ``MeasurementValue``
             corresponding to mid-circuit measurements.
 
     Returns:
         Array(float): the probability distribution of the bitstrings for the wires
+
+    **Example**
+
+    While in a "debugging context", we can query the probability distribution
+    as we would at the end of a circuit.
+
+    .. code-block:: python3
+
+        dev = qml.device("default.qubit", wires=2)
+
+        @qml.qnode(dev)
+        def circuit(x):
+            qml.RX(x, wires=0)
+            qml.Hadamard(wires=1)
+
+            qml.breakpoint()
+
+            qml.CNOT(wires=[0, 1])
+            return qml.state()
+
+        circuit(1.23)
+
+    Running the above python script opens up the interactive :code:`[pldb]:` prompt in the terminal.
+    We can query the probability distribution:
+
+    .. code-block:: console
+
+        [pldb]: longlist
+          4  	@qml.qnode(dev)
+          5  	def circuit(x):
+          6  	    qml.RX(x, wires=0)
+          7  	    qml.Hadamard(wires=1)
+          8
+          9  	    qml.breakpoint()
+         10
+         11  ->	    qml.CNOT(wires=[0, 1])
+         12  	    return qml.state()
+        [pldb]: qml.debug_probs()
+        array([0.33355943, 0.33355943, 0.16644057, 0.16644057])
+
     """
     if op:
         qml.queuing.QueuingManager.active_context().remove(
@@ -208,11 +415,47 @@ def _measure(measurement):
     return PLDB._execute((qtape,))  # pylint: disable=protected-access
 
 
-def tape():
-    """Access the quantum tape of the circuit.
+def debug_tape():
+    """Access the tape of the quantum circuit.
+
+    The tape can then be used to access all properties stored in :class:`~pennylane.tape.QuantumTape`.
+    This can be used to visualize the gates that have
+    been applied from the quantum circuit so far or otherwise process the operations.
 
     Returns:
-        QuantumScript: the quantum tape representing the circuit
+        QuantumTape: the quantum tape representing the circuit
+
+    **Example**
+
+    While in a "debugging context", we can access the :code:`QuantumTape` representing the
+    operations we have applied so far:
+
+    .. code-block:: python3
+
+        dev = qml.device("default.qubit", wires=2)
+
+        @qml.qnode(dev)
+        def circuit(x):
+            qml.RX(x, wires=0)
+            qml.Hadamard(wires=1)
+            qml.CNOT(wires=[0, 1])
+
+            qml.breakpoint()
+
+            return qml.expval(qml.Z(0))
+
+        circuit(1.23)
+
+    Running the above python script opens up the interactive :code:`[pldb]:` prompt in the terminal.
+    We can access the tape and draw it as follows:
+
+    .. code-block:: console
+
+        [pldb]: t = qml.debug_tape()
+        [pldb]: print(t.draw())
+        0: ──RX─╭●─┤
+        1: ──H──╰X─┤
+
     """
     active_queue = qml.queuing.QueuingManager.active_context()
     return qml.tape.QuantumScript.from_queue(active_queue)


Test patch:
diff --git a/tests/test_debugging.py b/tests/test_debugging.py
index 89d4b4e50..a071c4ed6 100644
--- a/tests/test_debugging.py
+++ b/tests/test_debugging.py
@@ -853,7 +853,7 @@ def test_tape():
         qml.Z(0)
         qml.expval(qml.Z(0))
 
-        executed_tape = qml.debugging.tape()
+        executed_tape = qml.debug_tape()
 
     expected_tape = qml.tape.QuantumScript.from_queue(queue)
     qml.assert_equal(expected_tape, executed_tape)
@@ -889,7 +889,7 @@ def test_state(_mock_method):
         qml.RY(0.45, 2)
         qml.sample()
 
-        qml.debugging.state()
+        qml.debug_state()
 
     assert qml.state() not in queue
 
@@ -903,7 +903,7 @@ def test_expval(_mock_method):
             qml.RY(0.45, 2)
             qml.sample()
 
-            qml.debugging.expval(op)
+            qml.debug_expval(op)
 
         assert op not in queue
         assert qml.expval(op) not in queue
@@ -919,7 +919,7 @@ def test_probs_with_op(_mock_method):
             qml.RY(0.45, 2)
             qml.sample()
 
-            qml.debugging.probs(op=op)
+            qml.debug_probs(op=op)
 
         assert op not in queue
         assert qml.probs(op=op) not in queue
@@ -935,7 +935,7 @@ def test_probs_with_wires(_mock_method):
             qml.RY(0.45, 2)
             qml.sample()
 
-            qml.debugging.probs(wires=wires)
+            qml.debug_probs(wires=wires)
 
         assert qml.probs(wires=wires) not in queue