class_docstr: Test that adjacent inverse gates are cancelled.
class_docstr_tok: ["Test","that","adjacent","inverse","gates","are","cancelled","."]
docstr: Test that a two-qubit circuit self-inverse on each qubit does not cancel.
docstr_tok: ["Test","that","a","two-qubit","circuit","self-inverse","on","each","qubit","does","not","cancel","."]
code: def test_two_qubits_no_inverse(self):
      """Test that a two-qubit circuit self-inverse on each qubit does not cancel."""
  
      def qfunc():
          qml.Hadamard(wires=0)
          qml.Hadamard(wires=1)
  
      transformed_qfunc = cancel_inverses(qfunc)
  
      ops = qml.tape.make_qscript(transformed_qfunc)().operations
  
      names_expected = ["Hadamard"] * 2
      wires_expected = [Wires(0), 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 5 for calling the TestCancelInverses obj's underlying member method code with example usage: obj.test_two_qubits_no_inverse() without return types