class_docstr: Test that adjacent inverse gates are cancelled.
class_docstr_tok: ["Test","that","adjacent","inverse","gates","are","cancelled","."]
docstr: Test that a three-qubit circuit with a blocking CNOT causes no cancellation.
docstr_tok: ["Test","that","a","three-qubit","circuit","with","a","blocking","CNOT","causes","no","cancellation","."]
code: def test_three_qubits_blocking_cnot(self):
      """Test that a three-qubit circuit with a blocking CNOT causes no cancellation."""
  
      def qfunc():
          qml.Hadamard(wires=0)
          qml.PauliX(wires=1)
          qml.CNOT(wires=[0, 1])
          qml.RZ(0.5, wires=2)
          qml.PauliX(wires=1)
  
      transformed_qfunc = cancel_inverses(qfunc)
  
      ops = qml.tape.make_qscript(transformed_qfunc)().operations
  
      names_expected = ["Hadamard", "PauliX", "CNOT", "RZ", "PauliX"]
      wires_expected = [
          Wires(0),
          Wires(1),
          Wires([0, 1]),
          Wires(2),
          Wires(1),
      ]
      compare_operation_lists(ops, names_expected, wires_expected)
  
imports: import pytest
  from utils import compare_operation_lists
  import pennylane
  from pennylane import numpy
  from pennylane.wires import Wires
  from pennylane.transforms.optimization import cancel_inverses
label_desc: Use image node_id 7 for calling the TestCancelInverses obj's underlying member method code with example usage: obj.test_three_qubits_blocking_cnot() without return types