class_docstr: Test that adjacent rotation gates of the same type will add the angles.
docstr: Test whether tolerance argument is respected for merging.
docstr_tok: ["Test","whether","tolerance","argument","is","respected","for","merging","."]
code: def test_two_qubits_rotation_merge_tolerance(self):
      """Test whether tolerance argument is respected for merging."""
  
      def qfunc():
          qml.RZ(1e-7, wires=0)
          qml.RZ(-2e-7, wires=0)
  
      # Try with default tolerance; these ops should still be applied
      transformed_qfunc = merge_rotations(qfunc)
  
      ops = qml.tape.make_qscript(transformed_qfunc)().operations
  
      assert len(ops) == 1
      assert ops[0].name == "RZ"
      assert ops[0].parameters[0] == -1e-7
  
      # Now try with higher tolerance threshold; the ops should cancel
      transformed_qfunc = merge_rotations(qfunc, atol=1e-5)
      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 merge_rotations
label_desc: Use image node_id 3 for calling the TestMergeRotations obj's underlying member method code with example usage: obj.test_two_qubits_rotation_merge_tolerance() without return types