class_docstr: Test that adjacent inverse gates are cancelled.
class_docstr_tok: ["Test","that","adjacent","inverse","gates","are","cancelled","."]
docstr: Test that two adjacent CNOTs cancel.
docstr_tok: ["Test","that","two","adjacent","CNOTs","cancel","."]
code: def test_two_qubits_cnot_same_direction(self):
      """Test that two adjacent CNOTs cancel."""
  
      def qfunc():
          qml.CNOT(wires=[0, 1])
          qml.CNOT(wires=[0, 1])
  
      transformed_qfunc = cancel_inverses(qfunc)
  
      ops = qml.tape.make_qscript(transformed_qfunc)().operations
  
      assert len(ops) == 0
  
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 9 for calling the TestCancelInverses obj's underlying member method code with example usage: obj.test_two_qubits_cnot_same_direction() without return types