class_docstr: Tests of input validation and output correctness of function `generate_shift_rule`.
class_docstr_tok: ["Tests","of","input","validation","and","output","correctness","of","function","`","generate_shift_rule","`","."]
docstr: Tests the correct two term equidistant rule is generated using the default shifts [pi/4, 3*pi/4].
  The frequency [1,2] corresponds to a generator e.g. of the form 1/2*X0Y1 + 1/2*Y0X1.
code: def test_four_term_rule_default_shifts(self):
      """Tests the correct two term equidistant rule is generated using the default shifts [pi/4, 3*pi/4].
      The frequency [1,2] corresponds to a generator e.g. of the form 1/2*X0Y1 + 1/2*Y0X1.
      """
  
      frequencies = (1, 2)
  
      correct_terms = [
          [0.8535533905932737, np.pi / 4],
          [-0.8535533905932737, -np.pi / 4],
          [-0.14644660940672624, 3 * np.pi / 4],
          [0.14644660940672624, -3 * np.pi / 4],
      ]
      generated_terms = generate_shift_rule(frequencies)
  
      assert np.allclose(generated_terms, correct_terms)
  
imports: import pytest
  import numpy
  import pennylane
  from pennylane.gradients.general_shift_rules import eigvals_to_frequencies, frequencies_to_period, generate_shift_rule, _get_shift_rule, generate_multi_shift_rule, generate_shifted_tapes, generate_multishifted_tapes, _iterate_shift_rule_with_multipliers
label_desc: Use image node_id 4 for calling the TestGenerateShiftRule obj's underlying member method code with example usage: obj.test_four_term_rule_default_shifts() without return types