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