class_docstr: Test that adjacent rotation gates of the same type will add the angles.
docstr: Test that a single-qubit circuit with adjacent rotation along the same
  axis either merge, or cancel if the angles sum to 0.
docstr_tok: ["Test","that","a","single-qubit","circuit","with","adjacent","rotation","along","the","same","axis","either","merge",",","or","cancel","if","the","angles","sum","to","0","."]
code: def test_one_qubit_rotation_merge(
      self, theta_1, theta_2, expected_ops
  ):
      """Test that a single-qubit circuit with adjacent rotation along the same
      axis either merge, or cancel if the angles sum to 0."""
  
      def qfunc():
          qml.RZ(theta_1, wires=0)
          qml.RZ(theta_2, wires=0)
  
      transformed_qfunc = merge_rotations(qfunc)
  
      ops = qml.tape.make_qscript(transformed_qfunc)().operations
  
      assert len(ops) == len(expected_ops)
  
      # Check that all operations and parameter values are as expected
      for op_obtained, op_expected in zip(ops, expected_ops):
          assert op_obtained.name == op_expected.name
          assert np.allclose(
              op_obtained.parameters, op_expected.parameters
          )
  
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 1 for calling the TestMergeRotations obj's underlying member method code with example usage: obj.test_one_qubit_rotation_merge(theta_1, theta_2, expected_ops) without return types