class_docstr: Test that adjacent inverse gates are cancelled.
class_docstr_tok: ["Test","that","adjacent","inverse","gates","are","cancelled","."]
docstr: Test that two adjacent CZ with the control/target flipped do cancel due to symmetry.
docstr_tok: ["Test","that","two","adjacent","CZ","with","the","control\/target","flipped","do","cancel","due","to","symmetry","."]
code: def test_two_qubits_cz_opposite_direction(self):
      """Test that two adjacent CZ with the control/target flipped do cancel due to symmetry."""
  
      def qfunc():
          qml.CZ(wires=[0, 1])
          qml.CZ(wires=[1, 0])
  
      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 11 for calling the TestCancelInverses obj's underlying member method code with example usage: obj.test_two_qubits_cz_opposite_direction() without return types