class_docstr: Test that adjacent inverse gates are cancelled.
class_docstr_tok: ["Test","that","adjacent","inverse","gates","are","cancelled","."]
docstr: Test that a single-qubit circuit with adjacent adjoint gate cancels.
docstr_tok: ["Test","that","a","single-qubit","circuit","with","adjacent","adjoint","gate","cancels","."]
code: def test_one_qubit_cancel_preceded_adjoint(self):
      """Test that a single-qubit circuit with adjacent adjoint gate cancels."""
  
      def qfunc():
          qml.adjoint(qml.S)(wires=0)
          qml.S(wires=0)
  
      transformed_qfunc = cancel_inverses(qfunc)
  
      new_tape = qml.tape.make_qscript(transformed_qfunc)()
  
      assert len(new_tape.operations) == 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 3 for calling the TestCancelInverses obj's underlying member method code with example usage: obj.test_one_qubit_cancel_preceded_adjoint() without return types